cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1098977 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java
Date Tue, 03 May 2011 09:17:52 GMT
Author: aadamchik
Date: Tue May  3 09:17:51 2011
New Revision: 1098977

URL: http://svn.apache.org/viewvc?rev=1098977&view=rev
Log:
CAY-1562 CayenneCase unit tests conversion

patches by Dzmitry Kazimirchyk:
DataContextCharTypeTest

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java?rev=1098977&r1=1098976&r2=1098977&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DataContextCharTypeTest.java
Tue May  3 09:17:51 2011
@@ -20,25 +20,31 @@ package org.apache.cayenne.access;
 
 import java.util.List;
 
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.query.SelectQuery;
+import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.ReturnTypesMap1;
-import org.apache.cayenne.unit.CayenneCase;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-
-public class DataContextCharTypeTest extends CayenneCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class DataContextCharTypeTest extends ServerCase {
+    
+    @Inject
+    protected ObjectContext context;
+    
+    @Inject
+    protected DBHelper dbHelper;
     
     @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        deleteTestData();
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("TYPES_MAPPING_TEST1");
     }
     
     public void testCharTrimming() {
-        DataContext context = createDataContext();
-        
         ReturnTypesMap1 map1 = context.newObject(ReturnTypesMap1.class);
         map1.setCharColumn("  text   ");
         ReturnTypesMap1 map2 = context.newObject(ReturnTypesMap1.class);



Mime
View raw message