Return-Path: Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 62220 invoked by uid 500); 11 Apr 2003 19:05:50 -0000 Received: (qmail 62217 invoked from network); 11 Apr 2003 19:05:50 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 11 Apr 2003 19:05:50 -0000 Received: (qmail 24922 invoked by uid 1513); 11 Apr 2003 19:05:50 -0000 Date: 11 Apr 2003 19:05:50 -0000 Message-ID: <20030411190550.24921.qmail@icarus.apache.org> From: brj@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/test/org/apache/ojb/broker ExtentAwarePathExpressionsTest.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brj 2003/04/11 12:05:50 Modified: src/test/org/apache/ojb/broker ExtentAwarePathExpressionsTest.java Log: additional testcase querying for abstract class Revision Changes Path 1.3 +65 -49 db-ojb/src/test/org/apache/ojb/broker/ExtentAwarePathExpressionsTest.java Index: ExtentAwarePathExpressionsTest.java =================================================================== RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/ExtentAwarePathExpressionsTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ExtentAwarePathExpressionsTest.java 9 Apr 2003 20:35:39 -0000 1.2 +++ ExtentAwarePathExpressionsTest.java 11 Apr 2003 19:05:49 -0000 1.3 @@ -2,70 +2,86 @@ import java.util.List; +import junit.framework.TestCase; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.QueryByCriteria; -import junit.framework.TestCase; - /** * * @author Leandro Rodrigo Saad Cruz */ public class ExtentAwarePathExpressionsTest extends TestCase { - private static Class CLASS = ExtentAwarePathExpressionsTest.class; + private static Class CLASS = ExtentAwarePathExpressionsTest.class; - private PersistenceBroker broker; - /** - * - */ - public ExtentAwarePathExpressionsTest() - { - super(); - } + private PersistenceBroker broker; + /** + * + */ + public ExtentAwarePathExpressionsTest() + { + super(); + } + + /** + * Insert the method's description here. + * Creation date: (23.12.2000 18:30:38) + * @param args java.lang.String[] + */ + public static void main(String[] args) + { + String[] arr = { CLASS.getName()}; + junit.textui.TestRunner.main(arr); + } + + /** + * @param testeName + */ + public ExtentAwarePathExpressionsTest(String testName) + { + super(testName); + } + + public void setUp() throws PBFactoryException + { + broker = PersistenceBrokerFactory.defaultPersistenceBroker(); + } + + /** + * Insert the method's description here. + * Creation date: (06.12.2000 21:59:14) + */ + public void tearDown() + { + broker.close(); + } /** - * Insert the method's description here. - * Creation date: (23.12.2000 18:30:38) - * @param args java.lang.String[] + * Querying News.qualifierNmaes */ - public static void main(String[] args) - { - String[] arr = {CLASS.getName()}; - junit.textui.TestRunner.main(arr); - } + public void testWithoutHintClass1() throws Exception + { + Criteria criteria = new Criteria(); + criteria.addEqualTo("qualifiers.name", "Cars"); + QueryByCriteria query = new QueryByCriteria(News.class, criteria); + + broker.clearCache(); + List content = (List) broker.getCollectionByQuery(query); + assertEquals(1, content.size()); + } /** - * @param testeName + * Querying News/Paper.qualifierNmaes */ - public ExtentAwarePathExpressionsTest(String testName) - { - super(testName); - } - - public void setUp() throws PBFactoryException - { - broker = PersistenceBrokerFactory.defaultPersistenceBroker(); - } - - /** - * Insert the method's description here. - * Creation date: (06.12.2000 21:59:14) - */ - public void tearDown() - { - broker.close(); - } - - public void testWithoutHintClass() - throws Exception - { - Criteria criteria = new Criteria(); - criteria.addEqualTo("qualifiers.name","Cars"); - QueryByCriteria query = new QueryByCriteria(News.class,criteria); - List content = (List) broker.getCollectionByQuery(query); - assertEquals(1,content.size() ); - } - + public void testWithoutHintClass2() throws Exception + { + Criteria criteria = new Criteria(); + criteria.addLike("qualifiers.name", "%ers%"); + QueryByCriteria query = new QueryByCriteria(BaseContentImpl.class, criteria, true); + + broker.clearCache(); + List content = (List) broker.getCollectionByQuery(query); + assertEquals(2, content.size()); + } }