db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/broker InheritanceMultipleTableTest.java
Date Thu, 29 Sep 2005 23:24:41 GMT
arminw      2005/09/29 16:24:41

  Modified:    src/test/org/apache/ojb/broker
                        InheritanceMultipleTableTest.java
  Log:
  comment out tests which will be no longer supported, code cleanup
  
  Revision  Changes    Path
  1.19      +107 -108  db-ojb/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java
  
  Index: InheritanceMultipleTableTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/InheritanceMultipleTableTest.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- InheritanceMultipleTableTest.java	18 Sep 2005 12:01:12 -0000	1.18
  +++ InheritanceMultipleTableTest.java	29 Sep 2005 23:24:41 -0000	1.19
  @@ -11,7 +11,6 @@
   import org.apache.commons.lang.builder.EqualsBuilder;
   import org.apache.commons.lang.builder.ToStringBuilder;
   import org.apache.commons.lang.builder.ToStringStyle;
  -import org.apache.ojb.broker.accesslayer.sql.SqlGenerator;
   import org.apache.ojb.broker.metadata.ClassDescriptor;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
  @@ -300,7 +299,7 @@
           consortium.setName(name);
           consortium.setShareholders(sh);
   
  -        Identity oidCon = null;
  +        Identity oidCon;
           try
           {
               broker.beginTransaction();
  @@ -934,7 +933,7 @@
           long timestamp = System.currentTimeMillis();
           String name = "testQuery_ReferenceOuterJoin_" + timestamp;
           Company company = prepareTestDataWithCompany(name);
  -        Long id_2 = company.getId();
  +        //Long id_2 = company.getId();
   
           // Store a dummy company
           Company dummyComp = new Company(null, name + "_dummy", Collections.EMPTY_LIST,
Collections.EMPTY_LIST);
  @@ -1172,109 +1171,109 @@
           assertFalse(obj_2.getSomeValue() == obj_3.getSomeValue());
       }
   
  -    /**
  -     * TODO: Should we support some kind of "declarative inheritance"? This test
  -     * try to use this kind of inheritance as class Dog expects some fields from a
  -     * "declarated super class" (no java inheritance, only declared in metadata).
  -     * In class {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor} the
  -     * support is comment out (but only works for simple objects without references).
  -     */
  -    public void testWithoutJavaInheritance_1()
  -    {
  -        if (ojbSkipKnownIssueProblem("Declarative Inheritance not supported"))
  -        {
  -            return;
  -        }
  -
  -        String name = "testWithoutJavaInheritance_1" + System.currentTimeMillis();
  -        Dog dog = new Dog(name, 35, 4);
  -        broker.beginTransaction();
  -        broker.store(dog);
  -        broker.commitTransaction();
  -
  -        broker.clearCache();
  -        Criteria crit = new Criteria();
  -        crit.addEqualTo("name", name);
  -        Query q = QueryFactory.newQuery(Dog.class, crit);
  -        Collection result = broker.getCollectionByQuery(q);
  -        assertNotNull(result);
  -        assertEquals(1, result.size());
  -        Dog newDog = (Dog) result.iterator().next();
  -        assertTrue(dog.equals(newDog));
  -
  -        broker.beginTransaction();
  -        newDog.setWeight(1000);
  -        newDog.setLegs(10);
  -        broker.store(newDog);
  -        broker.commitTransaction();
  -
  -        broker.clearCache();
  -        result = broker.getCollectionByQuery(q);
  -        assertNotNull(result);
  -        assertEquals(1, result.size());
  -        Dog newDog2 = (Dog) result.iterator().next();
  -        assertTrue(newDog.equals(newDog2));
  -
  -        broker.beginTransaction();
  -        broker.delete(dog);
  -        broker.commitTransaction();
  -    }
  -
  -    /**
  -     * TODO: Should we support some kind of "declarative inheritance"? This test
  -     * try to use this kind of inheritance as class Dog expects some fields from a
  -     * "declarated super class" (no java inheritance, only declared in metadata).
  -     * In class {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor} the
  -     * support is comment out (but only works for simple objects without references).
  -     */
  -    public void testWithoutJavaInheritance_2()
  -    {
  -        if (ojbSkipKnownIssueProblem("Declarative Inheritance not supported"))
  -        {
  -            return;
  -        }
  -
  -        String name = "testWithoutJavaInheritance_2" + System.currentTimeMillis();
  -        Dog dog = new Dog(name, 35, 4);
  -        Animal parent = new Animal(name + "_parent", 55);
  -        Food f1 = new Food(name + "fruit1");
  -        Food f2 = new Food(name + "fruit2");
  -        dog.addFood(f1);
  -        dog.addFood(f2);
  -        dog.setParent(parent);
  -
  -        broker.beginTransaction();
  -        broker.store(dog);
  -        broker.commitTransaction();
  -
  -        broker.clearCache();
  -        Criteria crit = new Criteria();
  -        crit.addEqualTo("name", name);
  -        Query q = QueryFactory.newQuery(Dog.class, crit);
  -        Collection result = broker.getCollectionByQuery(q);
  -        assertNotNull(result);
  -        assertEquals(1, result.size());
  -        Dog newDog = (Dog) result.iterator().next();
  -        assertEquals(dog, newDog);
  -
  -        broker.beginTransaction();
  -        newDog.setWeight(1000);
  -        newDog.setLegs(10);
  -        newDog.addFood(new Food(name + "_new"));
  -        broker.store(newDog);
  -        broker.commitTransaction();
  -
  -        broker.clearCache();
  -        result = broker.getCollectionByQuery(q);
  -        assertNotNull(result);
  -        assertEquals(1, result.size());
  -        Dog newDog2 = (Dog) result.iterator().next();
  -        assertTrue(newDog.equals(newDog2));
  -
  -        broker.beginTransaction();
  -        broker.delete(dog);
  -        broker.commitTransaction();
  -    }
  +//    /**
  +//     * TODO: Should we support some kind of "declarative inheritance"? This test
  +//     * try to use this kind of inheritance as class Dog expects some fields from a
  +//     * "declarated super class" (no java inheritance, only declared in metadata).
  +//     * In class {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor} the
  +//     * support is comment out (but only works for simple objects without references).
  +//     */
  +//    public void YYYtestWithoutJavaInheritance_1()
  +//    {
  +//        if (ojbSkipKnownIssueProblem("Declarative Inheritance not supported"))
  +//        {
  +//            return;
  +//        }
  +//
  +//        String name = "testWithoutJavaInheritance_1" + System.currentTimeMillis();
  +//        Dog dog = new Dog(name, 35, 4);
  +//        broker.beginTransaction();
  +//        broker.store(dog);
  +//        broker.commitTransaction();
  +//
  +//        broker.clearCache();
  +//        Criteria crit = new Criteria();
  +//        crit.addEqualTo("name", name);
  +//        Query q = QueryFactory.newQuery(Dog.class, crit);
  +//        Collection result = broker.getCollectionByQuery(q);
  +//        assertNotNull(result);
  +//        assertEquals(1, result.size());
  +//        Dog newDog = (Dog) result.iterator().next();
  +//        assertTrue(dog.equals(newDog));
  +//
  +//        broker.beginTransaction();
  +//        newDog.setWeight(1000);
  +//        newDog.setLegs(10);
  +//        broker.store(newDog);
  +//        broker.commitTransaction();
  +//
  +//        broker.clearCache();
  +//        result = broker.getCollectionByQuery(q);
  +//        assertNotNull(result);
  +//        assertEquals(1, result.size());
  +//        Dog newDog2 = (Dog) result.iterator().next();
  +//        assertTrue(newDog.equals(newDog2));
  +//
  +//        broker.beginTransaction();
  +//        broker.delete(dog);
  +//        broker.commitTransaction();
  +//    }
  +//
  +//    /**
  +//     * TODO: Should we support some kind of "declarative inheritance"? This test
  +//     * try to use this kind of inheritance as class Dog expects some fields from a
  +//     * "declarated super class" (no java inheritance, only declared in metadata).
  +//     * In class {@link org.apache.ojb.broker.metadata.SuperReferenceDescriptor} the
  +//     * support is comment out (but only works for simple objects without references).
  +//     */
  +//    public void YYYtestWithoutJavaInheritance_2()
  +//    {
  +//        if (ojbSkipKnownIssueProblem("Declarative Inheritance not supported"))
  +//        {
  +//            return;
  +//        }
  +//
  +//        String name = "testWithoutJavaInheritance_2" + System.currentTimeMillis();
  +//        Dog dog = new Dog(name, 35, 4);
  +//        Animal parent = new Animal(name + "_parent", 55);
  +//        Food f1 = new Food(name + "fruit1");
  +//        Food f2 = new Food(name + "fruit2");
  +//        dog.addFood(f1);
  +//        dog.addFood(f2);
  +//        dog.setParent(parent);
  +//
  +//        broker.beginTransaction();
  +//        broker.store(dog);
  +//        broker.commitTransaction();
  +//
  +//        broker.clearCache();
  +//        Criteria crit = new Criteria();
  +//        crit.addEqualTo("name", name);
  +//        Query q = QueryFactory.newQuery(Dog.class, crit);
  +//        Collection result = broker.getCollectionByQuery(q);
  +//        assertNotNull(result);
  +//        assertEquals(1, result.size());
  +//        Dog newDog = (Dog) result.iterator().next();
  +//        assertEquals(dog, newDog);
  +//
  +//        broker.beginTransaction();
  +//        newDog.setWeight(1000);
  +//        newDog.setLegs(10);
  +//        newDog.addFood(new Food(name + "_new"));
  +//        broker.store(newDog);
  +//        broker.commitTransaction();
  +//
  +//        broker.clearCache();
  +//        result = broker.getCollectionByQuery(q);
  +//        assertNotNull(result);
  +//        assertEquals(1, result.size());
  +//        Dog newDog2 = (Dog) result.iterator().next();
  +//        assertTrue(newDog.equals(newDog2));
  +//
  +//        broker.beginTransaction();
  +//        broker.delete(dog);
  +//        broker.commitTransaction();
  +//    }
   
       //************************************************************
       // inner classes used for test
  @@ -1650,7 +1649,7 @@
   
           public boolean equals(Object obj)
           {
  -            if (!(obj instanceof Shareholder))
  +            if (!(obj instanceof Consortium))
               {
                   return false;
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message