db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/odmg ManyToManyTest.java OneToOneTest.java
Date Sat, 07 Jun 2003 10:20:40 GMT
brj         2003/06/07 03:20:40

  Modified:    src/test/org/apache/ojb/odmg ManyToManyTest.java
                        OneToOneTest.java
  Log:
  some style fixes
  
  Revision  Changes    Path
  1.9       +44 -44    db-ojb/src/test/org/apache/ojb/odmg/ManyToManyTest.java
  
  Index: ManyToManyTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/ManyToManyTest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ManyToManyTest.java	2 May 2003 08:39:04 -0000	1.8
  +++ ManyToManyTest.java	7 Jun 2003 10:20:40 -0000	1.9
  @@ -28,8 +28,8 @@
           junit.textui.TestRunner.main(arr);
       }
   
  -    Database db;
  -    Implementation odmg;
  +    Database m_db;
  +    Implementation m_odmg;
   
       /**
        * Insert the method's description here.
  @@ -46,9 +46,9 @@
        */
       public void setUp() throws Exception
       {
  -        odmg = OJB.getInstance();
  -        db = odmg.newDatabase();
  -        db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);
  +        m_odmg = OJB.getInstance();
  +        m_db = m_odmg.newDatabase();
  +        m_db.open(TestHelper.DEF_DATABASE_NAME, Database.OPEN_READ_WRITE);
       }
   
       /**
  @@ -57,12 +57,12 @@
        */
       public void tearDown() throws Exception
       {
  -        if (odmg.currentTransaction() != null && odmg.currentTransaction().isOpen())
  +        if (m_odmg.currentTransaction() != null && m_odmg.currentTransaction().isOpen())
           {
  -            odmg.currentTransaction().abort();
  +            m_odmg.currentTransaction().abort();
           }
  -        db.close();
  -        odmg = null;
  +        m_db.close();
  +        m_odmg = null;
       }
   
   
  @@ -88,18 +88,18 @@
           doris.addFavoriteFood(trout);
           doris.addFavoriteFood(lolloverde);
   
  -        Transaction tx = odmg.newTransaction();
  +        Transaction tx = m_odmg.newTransaction();
           tx.begin();
  -        db.makePersistent(james);
  -        db.makePersistent(doris);
  +        m_db.makePersistent(james);
  +        m_db.makePersistent(doris);
           tx.commit();
   
           int dorisId = doris.getGourmetId();
           int jamesId = james.getGourmetId();
   
  -        tx = odmg.newTransaction();
  +        tx = m_odmg.newTransaction();
           tx.begin();
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select gourmets from " + ODMGGourmet.class.getName() +
                   " where gourmetId=$1");
           query.bind(new Integer(dorisId));
  @@ -111,7 +111,7 @@
           assertEquals(3, loadedDoris.getFavoriteFood().size());
   
           tx.begin();
  -        query = odmg.newOQLQuery();
  +        query = m_odmg.newOQLQuery();
           query.create("select gourmets from " + ODMGGourmet.class.getName() +
                   " where gourmetId=$1");
           query.bind(new Integer(jamesId));
  @@ -160,10 +160,10 @@
           /*
           we expect one created 'gourment' per store
           */
  -        assertEquals(1, store(odmg, db, paula));
  -        assertEquals(1, store(odmg, db, candy));
  +        assertEquals(1, store(m_odmg, m_db, paula));
  +        assertEquals(1, store(m_odmg, m_db, candy));
   
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2)");
           query.bind(tuna.getName());
  @@ -192,10 +192,10 @@
           /*
           we expect one created 'gourment' per store
           */
  -        assertEquals(1, store(odmg, db, james));
  -        assertEquals(1, store(odmg, db, doris));
  +        assertEquals(1, store(m_odmg, m_db, james));
  +        assertEquals(1, store(m_odmg, m_db, doris));
   
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2)");
           query.bind(tuna.getName());
  @@ -227,12 +227,12 @@
           /*
           we expect one created 'gourment' per store
           */
  -        assertEquals(1, store(odmg, db, paula));
  -        assertEquals(1, store(odmg, db, candy));
  -        assertEquals(1, store(odmg, db, james));
  -        assertEquals(1, store(odmg, db, doris));
  +        assertEquals(1, store(m_odmg, m_db, paula));
  +        assertEquals(1, store(m_odmg, m_db, candy));
  +        assertEquals(1, store(m_odmg, m_db, james));
  +        assertEquals(1, store(m_odmg, m_db, doris));
   
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2)");
           query.bind(tuna.getName());
  @@ -270,12 +270,12 @@
           /*
           we expect one created 'gourment' per store
           */
  -        assertEquals(1, store(odmg, db, paula));
  -        assertEquals(1, store(odmg, db, candy));
  -        assertEquals(1, store(odmg, db, james));
  -        assertEquals(1, store(odmg, db, doris));
  +        assertEquals(1, store(m_odmg, m_db, paula));
  +        assertEquals(1, store(m_odmg, m_db, candy));
  +        assertEquals(1, store(m_odmg, m_db, james));
  +        assertEquals(1, store(m_odmg, m_db, doris));
   
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2)");
           query.bind(tuna.getName());
  @@ -286,9 +286,9 @@
           */
           assertEquals(2, fishs.size());
   
  -        Transaction tx = odmg.newTransaction();
  +        Transaction tx = m_odmg.newTransaction();
           tx.begin();
  -        query = odmg.newOQLQuery();
  +        query = m_odmg.newOQLQuery();
           query.create("select gourmets from " + ODMGGourmet.class.getName() +
                   " where name=$1");
           query.bind(doris.getName());
  @@ -303,14 +303,14 @@
           gourmet.addFavoriteFood(goldfish);
           tx.commit();
   
  -        query = odmg.newOQLQuery();
  +        query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2 or name=$3)");
           query.bind(tuna.getName());
           query.bind(trout.getName());
           query.bind(goldfish.getName());
   
  -        tx = odmg.newTransaction();
  +        tx = m_odmg.newTransaction();
           tx.begin();
           fishs = (List) query.execute();
           tx.commit();
  @@ -344,12 +344,12 @@
           /*
           we expect one created 'gourment' per store
           */
  -        assertEquals(1, store(odmg, db, paula));
  -        assertEquals(1, store(odmg, db, candy));
  -        assertEquals(1, store(odmg, db, james));
  -        assertEquals(1, store(odmg, db, doris));
  +        assertEquals(1, store(m_odmg, m_db, paula));
  +        assertEquals(1, store(m_odmg, m_db, candy));
  +        assertEquals(1, store(m_odmg, m_db, james));
  +        assertEquals(1, store(m_odmg, m_db, doris));
   
  -        OQLQuery query = odmg.newOQLQuery();
  +        OQLQuery query = m_odmg.newOQLQuery();
           query.create("select fishs from " + Fish.class.getName() +
                   " where (name=$1 or name=$2 or name=$3)");
           query.bind(tuna.getName());
  @@ -362,9 +362,9 @@
           */
           assertEquals(3, fishs.size());
   
  -        Transaction tx = odmg.newTransaction();
  +        Transaction tx = m_odmg.newTransaction();
           tx.begin();
  -        query = odmg.newOQLQuery();
  +        query = m_odmg.newOQLQuery();
           query.create("select gourmets from " + ODMGGourmet.class.getName() +
                   " where name=$1");
           query.bind(doris.getName());
  @@ -382,12 +382,12 @@
           //gourmet_doris.setFavoriteFood(foodList);
           tx.commit();
   
  -        query = odmg.newOQLQuery();
  +        query = m_odmg.newOQLQuery();
           query.create("select gourmets from " + ODMGGourmet.class.getName() +
                   " where name=$1");
           query.bind(doris.getName());
   
  -        tx = odmg.newTransaction();
  +        tx = m_odmg.newTransaction();
           tx.begin();
           result = (List) query.execute();
           assertEquals("We should found a gourmet_doris", 1, result.size());
  
  
  
  1.16      +14 -14    db-ojb/src/test/org/apache/ojb/odmg/OneToOneTest.java
  
  Index: OneToOneTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/OneToOneTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- OneToOneTest.java	2 Mar 2003 22:35:26 -0000	1.15
  +++ OneToOneTest.java	7 Jun 2003 10:20:40 -0000	1.16
  @@ -24,8 +24,8 @@
   	private org.odmg.Implementation odmg;
   	private org.odmg.Database db;
   
  -	TestClassA a;
  -	TestClassB b;
  +	TestClassA m_a;
  +	TestClassB m_b;
   
       public static void main(String[] args)
       {
  @@ -60,30 +60,30 @@
               ex.printStackTrace();
           }
   
  -    	a = new org.apache.ojb.odmg.TestClassA();
  -    	b = new org.apache.ojb.odmg.TestClassB();
  +    	m_a = new org.apache.ojb.odmg.TestClassA();
  +    	m_b = new org.apache.ojb.odmg.TestClassB();
   
       	// init a
  -    	a.setValue1("A.One");
  -    	a.setValue2("B.Two");
  -    	a.setValue3(3);
  -    	a.setB(b);
  +    	m_a.setValue1("A.One");
  +    	m_a.setValue2("B.Two");
  +    	m_a.setValue3(3);
  +    	m_a.setB(m_b);
   
       	// init b
  -    	b.setValue1("B.One");
  -    	b.setA(a);
  +    	m_b.setValue1("B.One");
  +    	m_b.setA(m_a);
       }
   
       public void testSave()
       {
           org.odmg.Transaction tx = odmg.newTransaction();
           tx.begin();
  -        tx.lock(a, Transaction.WRITE);
  -        tx.lock(b, Transaction.WRITE);
  +        tx.lock(m_a, Transaction.WRITE);
  +        tx.lock(m_b, Transaction.WRITE);
           tx.commit();
   
  -        assertTrue(a.getOid() != null);
  -        assertTrue(b.getOid() != null);
  +        assertTrue(m_a.getOid() != null);
  +        assertTrue(m_b.getOid() != null);
       }
   
       public void testRead()
  
  
  

Mime
View raw message