cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1101549 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
Date Tue, 10 May 2011 17:22:10 GMT
Author: aadamchik
Date: Tue May 10 17:22:10 2011
New Revision: 1101549

URL: http://svn.apache.org/viewvc?rev=1101549&view=rev
Log:
CAY-1563 CayenneCase unit tests conversion(3)

patch by Dzmitry Kazimirchyk - PrimitiveAttributesTest

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

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java?rev=1101549&r1=1101548&r2=1101549&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
Tue May 10 17:22:10 2011
@@ -18,17 +18,28 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
-import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.test.jdbc.DBHelper;
 import org.apache.cayenne.testdo.testmap.PrimitivesTestEntity;
-import org.apache.cayenne.unit.CayenneCase;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-public class PrimitiveAttributesTest extends CayenneCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class PrimitiveAttributesTest extends ServerCase {
 
-    public void testCommit() {
-        ObjectContext context = createDataContext();
+    @Inject
+    private DataContext context;
+
+    @Inject
+    private DBHelper dbHelper;
 
-        PrimitivesTestEntity e = context
-                .newObject(PrimitivesTestEntity.class);
+    @Override
+    protected void setUpAfterInjection() throws Exception {
+        dbHelper.deleteAll("PRIMITIVES_TEST");
+    }
+
+    public void testCommit() {
+        PrimitivesTestEntity e = context.newObject(PrimitivesTestEntity.class);
         e.setBooleanColumn(true);
         e.setIntColumn(88);
         context.commitChanges();



Mime
View raw message