cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1103020 - /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderPartialTest.java
Date Sat, 14 May 2011 10:46:53 GMT
Author: aadamchik
Date: Sat May 14 10:46:53 2011
New Revision: 1103020

URL: http://svn.apache.org/viewvc?rev=1103020&view=rev
Log:
CAY-1564 CayenneCase unit tests conversion(4)

    patch by Dzmitry Kazimirchyk - DbLoaderPartialTest

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

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderPartialTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderPartialTest.java?rev=1103020&r1=1103019&r2=1103020&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderPartialTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/DbLoaderPartialTest.java
Sat May 14 10:46:53 2011
@@ -21,23 +21,33 @@ package org.apache.cayenne.access;
 
 import java.util.Collection;
 
+import javax.sql.DataSource;
+
 import org.apache.cayenne.CayenneException;
+import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjEntity;
-import org.apache.cayenne.unit.CayenneCase;
+import org.apache.cayenne.unit.di.server.ServerCase;
+import org.apache.cayenne.unit.di.server.UseServerRuntime;
 
-public class DbLoaderPartialTest extends CayenneCase {
+@UseServerRuntime(ServerCase.TESTMAP_PROJECT)
+public class DbLoaderPartialTest extends ServerCase {
 
-    protected DbLoader loader;
+    @Inject
+    private DbAdapter adapter;
 
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
+    @Inject
+    private DataSource dataSource;
 
+    private DbLoader loader;
+
+    @Override
+    protected void setUpAfterInjection() throws Exception {
         loader = new DbLoader(
-                getConnection(),
-                getNode().getAdapter(),
+                dataSource.getConnection(),
+                adapter,
                 new DbLoaderDelegate() {
 
                     public boolean overwriteDbEntity(DbEntity ent)
@@ -76,13 +86,13 @@ public class DbLoaderPartialTest extends
         try {
 
             DataMap map = new DataMap();
-            String tableLabel = getNode().getAdapter().tableTypeForTable();
+            String tableLabel = adapter.tableTypeForTable();
 
             loader.loadDataMapFromDB(null, "%", new String[] {
                 tableLabel
             }, map);
 
-            Collection rels = getDbEntity(map, "ARTIST").getRelationships();
+            Collection<?> rels = getDbEntity(map, "ARTIST").getRelationships();
             assertNotNull(rels);
             int artistRels = rels.size();
 



Mime
View raw message