cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1073774 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOMany2OneNoRevTest.java
Date Wed, 23 Feb 2011 15:22:45 GMT
Author: aadamchik
Date: Wed Feb 23 15:22:44 2011
New Revision: 1073774

URL: http://svn.apache.org/viewvc?rev=1073774&view=rev
Log:
tests cleanup

switching to DI

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

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOMany2OneNoRevTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOMany2OneNoRevTest.java?rev=1073774&r1=1073773&r2=1073774&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOMany2OneNoRevTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/CDOMany2OneNoRevTest.java
Wed Feb 23 15:22:44 2011
@@ -21,28 +21,26 @@ package org.apache.cayenne;
 
 import java.util.Arrays;
 
-import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.testdo.testmap.Artist;
 import org.apache.cayenne.testdo.testmap.Painting1;
-import org.apache.cayenne.unit.CayenneCase;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-/**
- * Tests DataObjects with no reverse relationships.
- * 
- */
-public class CDOMany2OneNoRevTest extends CayenneCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class CDOMany2OneNoRevTest extends ServerCase {
 
-    public void testNewAdd() throws Exception {
-        deleteTestData();
+    @Inject
+    private ObjectContext context;
 
-        DataContext context = createDataContext();
+    public void testNewAdd() throws Exception {
 
-        Artist a1 = (Artist) context.newObject("Artist");
+        Artist a1 = context.newObject(Artist.class);
         a1.setArtistName("a");
-        Painting1 p1 = (Painting1) context.newObject("Painting1");
+        Painting1 p1 = context.newObject(Painting1.class);
         p1.setPaintingTitle("p");
 
-        // *** TESTING THIS ***
+        // TESTING THIS
         p1.setToArtist(a1);
 
         assertSame(a1, p1.getToArtist());



Mime
View raw message