db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/test/org/apache/ojb/odmg OdmgExamples.java
Date Thu, 09 Jan 2003 18:38:34 GMT
arminw      2003/01/09 10:38:34

  Modified:    src/ejb/org/apache/ojb/ejb VOHelper.java
               src/test/org/apache/ojb/odmg OdmgExamples.java
  Log:
  remove try catch from test case,
  fix bug in helper class
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-ojb/src/ejb/org/apache/ojb/ejb/VOHelper.java
  
  Index: VOHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/ejb/org/apache/ojb/ejb/VOHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- VOHelper.java	30 Sep 2002 16:53:47 -0000	1.2
  +++ VOHelper.java	9 Jan 2003 18:38:33 -0000	1.3
  @@ -94,7 +94,7 @@
           a.setMinimumStock(10*counter);
           a.setOrderedUnits(17);
           a.setPrice(0.45*counter);
  -        a.setProductGroupId(111);
  +        a.setProductGroupId(1);
           a.setStock(234);
           a.setSupplierId(4);
           a.setUnit("bottle "+counter);
  
  
  
  1.9       +19 -32    jakarta-ojb/src/test/org/apache/ojb/odmg/OdmgExamples.java
  
  Index: OdmgExamples.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/test/org/apache/ojb/odmg/OdmgExamples.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- OdmgExamples.java	9 Jan 2003 17:25:18 -0000	1.8
  +++ OdmgExamples.java	9 Jan 2003 18:38:34 -0000	1.9
  @@ -208,7 +208,7 @@
           }
       }
   
  -    public void testPathExpressionOqlQuery()
  +    public void testPathExpressionOqlQuery() throws Exception
       {
           // get facade instance
           Implementation odmg = OJB.getInstance();
  @@ -225,42 +225,29 @@
           Transaction tx = odmg.newTransaction();
   
           //perform transaction
  -        try
  -        {
  -            tx.begin();
   
  -            OQLQuery query = odmg.newOQLQuery();
  -            query.create(
  -                    "select anArticle from " + Article.class.getName() + " where productGroup.groupName=\"Frui*\"");
  -            List results = (List) query.execute();
  -
  -            // crosscheck
  -            query = odmg.newOQLQuery();
  -            query.create("select aPG from " + ProductGroup.class.getName() + " where groupName=\"Fruit?\"");
  -            List check = (List) query.execute();
  -            ProductGroup pg = (ProductGroup) check.get(0);
  +        tx.begin();
   
  -            assertEquals(pg.getAllArticlesInGroup().size(), results.size());
  -            assertTrue((results.size() > 0));
  +        OQLQuery query = odmg.newOQLQuery();
  +        query.create(
  +                "select anArticle from " + Article.class.getName() + " where productGroup.groupName=\"Frui*\"");
  +        List results = (List) query.execute();
   
  -            tx.commit();
  -        }
  -        catch (Exception ex)
  +        // crosscheck
  +        query = odmg.newOQLQuery();
  +        query.create("select aPG from " + ProductGroup.class.getName() + " where groupName=\"Fruit?\"");
  +        List check = (List) query.execute();
  +        ProductGroup pg = (ProductGroup) check.get(0);
   
  -        {
  -            tx.abort();
  -            fail("ODMGException: " + ex.getMessage());
  -        }
  +        assertEquals(pg.getAllArticlesInGroup().size(), results.size());
  +        assertTrue((results.size() > 0));
   
  -        // close database
  -        try
  -        {
  -            db.close();
  -        }
  -        catch (ODMGException ex)
  -        {
  -            fail("ODMGException: " + ex.getMessage());
  -        }
  +        tx.commit();
  +
  +
  +    // close database
  +
  +        db.close();
       }
   
       public void testNrmAndDlists()
  
  
  

Mime
View raw message