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/broker QueryTest.java
Date Wed, 26 Mar 2003 21:45:58 GMT
brj         2003/03/26 13:45:58

  Modified:    src/test/org/apache/ojb/broker QueryTest.java
  Log:
  new testcase with pathHint
  
  Revision  Changes    Path
  1.24      +25 -2     db-ojb/src/test/org/apache/ojb/broker/QueryTest.java
  
  Index: QueryTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/QueryTest.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- QueryTest.java	15 Mar 2003 17:03:50 -0000	1.23
  +++ QueryTest.java	26 Mar 2003 21:45:58 -0000	1.24
  @@ -273,7 +273,7 @@
   		Collection results = new Vector();
   		crit.addLike("firstname", "%o%");
   		ReportQueryByCriteria q = QueryFactory.newReportQuery(Person.class, crit);
  -		q.setColumns(new String[]{"id", "firstname"});
  +		q.setColumns(new String[]{"id", "firstname", "count(*)"});
   
   		Iterator iter = broker.getReportQueryIteratorByQuery(q);
   		assertNotNull(iter);
  @@ -359,7 +359,6 @@
   			assertTrue("ProductGroups should be the same", cdPg.getRealSubject() == pg.getRealSubject());
   		}
   
  -
   	}
   
   	/**
  @@ -744,6 +743,30 @@
           // ProductGroups 4 and 5
           assertEquals("check size", list.size(), 2);
   
  +    }
  +
  +    /**
  +     * Test pathExpression and Extents
  +     * musicians is only defined in CD
  +     */
  +    public void testPathExpressionForExtents3()
  +    {
  +        ArrayList list = new java.util.ArrayList();
  +
  +        Criteria crit = new Criteria();
  +        crit.addLike("allArticlesInGroup.musicians", "%");
  +
  +        QueryByCriteria q = QueryFactory.newQuery(ProductGroup.class, crit, true);
  +        q.addPathClass("allArticlesInGroup",CdArticle.class);
  +
  +        Iterator iter = broker.getIteratorByQuery(q);
  +        while (iter.hasNext())
  +        {
  +            list.add(iter.next());
  +        }
  +
  +        // ProductGroups 5 
  +        assertEquals("check size", list.size(), 1);
       }
   
       /**
  
  
  

Mime
View raw message