cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1584677 - in /cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access: DataContextEJBQLInheritanceTest.java DataContextQualifiedEntityTest.java
Date Fri, 04 Apr 2014 13:41:47 GMT
Author: aadamchik
Date: Fri Apr  4 13:41:46 2014
New Revision: 1584677

URL: http://svn.apache.org/r1584677
Log:
broken test cleanup routine

Modified:
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLInheritanceTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityTest.java

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLInheritanceTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLInheritanceTest.java?rev=1584677&r1=1584676&r2=1584677&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLInheritanceTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextEJBQLInheritanceTest.java
Fri Apr  4 13:41:46 2014
@@ -43,15 +43,19 @@ public class DataContextEJBQLInheritance
 
     @Override
     protected void setUpAfterInjection() throws Exception {
+
+        // manually break circular deps
+        dbHelper.update("PERSON").set("DEPARTMENT_ID", null, Types.INTEGER).execute();
+
+        dbHelper.deleteAll("ADDRESS");
+        dbHelper.deleteAll("DEPARTMENT");
+        dbHelper.deleteAll("PERSON_NOTES");
         dbHelper.deleteAll("PERSON");
+        dbHelper.deleteAll("CLIENT_COMPANY");
 
         TableHelper person = new TableHelper(dbHelper, "PERSON");
-        person.setColumns("PERSON_ID", "NAME", "PERSON_TYPE", "SALARY")
-                .setColumnTypes(
-                        Types.INTEGER, 
-                        Types.VARCHAR, 
-                        Types.CHAR,
-                        Types.FLOAT);
+        person.setColumns("PERSON_ID", "NAME", "PERSON_TYPE", "SALARY").setColumnTypes(Types.INTEGER,
Types.VARCHAR,
+                Types.CHAR, Types.FLOAT);
 
         person.insert(1, "a", "EE", 20000);
         person.insert(2, "b", "EE", 25000);
@@ -62,32 +66,16 @@ public class DataContextEJBQLInheritance
 
     public void testSelect() throws Exception {
 
-        EJBQLQuery superclass = new EJBQLQuery(
-                "select p from AbstractPerson p ORDER BY p.name");
+        EJBQLQuery superclass = new EJBQLQuery("select p from AbstractPerson p ORDER BY p.name");
 
         List<?> superclassResult = context.performQuery(superclass);
         assertEquals(5, superclassResult.size());
 
-        assertEquals(Employee.class.getName(), superclassResult
-                .get(0)
-                .getClass()
-                .getName());
-        assertEquals(Employee.class.getName(), superclassResult
-                .get(1)
-                .getClass()
-                .getName());
-        assertEquals(Manager.class.getName(), superclassResult
-                .get(2)
-                .getClass()
-                .getName());
-        assertEquals(Manager.class.getName(), superclassResult
-                .get(3)
-                .getClass()
-                .getName());
-        assertEquals(CustomerRepresentative.class.getName(), superclassResult
-                .get(4)
-                .getClass()
-                .getName());
+        assertEquals(Employee.class.getName(), superclassResult.get(0).getClass().getName());
+        assertEquals(Employee.class.getName(), superclassResult.get(1).getClass().getName());
+        assertEquals(Manager.class.getName(), superclassResult.get(2).getClass().getName());
+        assertEquals(Manager.class.getName(), superclassResult.get(3).getClass().getName());
+        assertEquals(CustomerRepresentative.class.getName(), superclassResult.get(4).getClass().getName());
 
         EJBQLQuery subclass = new EJBQLQuery("select e from Employee e ORDER BY e.name");
 

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityTest.java?rev=1584677&r1=1584676&r2=1584677&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/DataContextQualifiedEntityTest.java
Fri Apr  4 13:41:46 2014
@@ -49,8 +49,15 @@ public class DataContextQualifiedEntityT
 
     @Override
     protected void setUpAfterInjection() throws Exception {
-        dbHelper.deleteAll("PERSON");
+        // manually break circular deps
+        dbHelper.update("PERSON").set("DEPARTMENT_ID", null, Types.INTEGER).execute();
 
+        dbHelper.deleteAll("ADDRESS");
+        dbHelper.deleteAll("DEPARTMENT");
+        dbHelper.deleteAll("PERSON_NOTES");
+        dbHelper.deleteAll("PERSON");
+        dbHelper.deleteAll("CLIENT_COMPANY");
+        
         tPerson = new TableHelper(dbHelper, "PERSON");
         tPerson.setColumns(
                 "CLIENT_COMPANY_ID",



Mime
View raw message