cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1565638 - in /cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server: ServerCaseDataDomainProvider.java ServerRuntimeProvider.java
Date Fri, 07 Feb 2014 13:16:12 GMT
Author: aadamchik
Date: Fri Feb  7 13:16:12 2014
New Revision: 1565638

URL: http://svn.apache.org/r1565638
Log:
fixing stored procedures bootstrap in unt tests

Modified:
    cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java
    cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerRuntimeProvider.java

Modified: cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java?rev=1565638&r1=1565637&r2=1565638&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java
(original)
+++ cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java
Fri Feb  7 13:16:12 2014
@@ -27,6 +27,8 @@ import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.map.Procedure;
+import org.apache.cayenne.unit.UnitDbAdapter;
 
 class ServerCaseDataDomainProvider extends DataDomainProvider {
 
@@ -35,9 +37,12 @@ class ServerCaseDataDomainProvider exten
 
     @Inject
     private DbAdapter adapter;
-    
+
     @Inject
     private JdbcEventLogger jdbcEventLogger;
+    
+    @Inject
+    private UnitDbAdapter unitDbAdapter;
 
     @Override
     protected DataDomain createDataDomain(String name) {
@@ -49,9 +54,10 @@ class ServerCaseDataDomainProvider exten
 
         DataDomain domain = super.createAndInitDataDomain();
 
-        // add nodes and DataSources dynamically...
+       
         for (DataMap dataMap : domain.getDataMaps()) {
 
+            // add nodes and DataSources dynamically...
             DataNode node = new DataNode(dataMap.getName());
             node.setJdbcEventLogger(jdbcEventLogger);
 
@@ -61,7 +67,13 @@ class ServerCaseDataDomainProvider exten
             node.addDataMap(dataMap);
             node.setSchemaUpdateStrategy(new SkipSchemaUpdateStrategy());
 
-            // customizations from SimpleAccessStackAdapter that are not yet ported...
+            // tweak procedures for testing...
+            for (Procedure proc : dataMap.getProcedures()) {
+                unitDbAdapter.tweakProcedure(proc);
+            }
+            
+            // customizations from SimpleAccessStackAdapter that are not yet
+            // ported...
             // those can be done better now
 
             // node
@@ -69,10 +81,6 @@ class ServerCaseDataDomainProvider exten
             // .getExtendedTypes()
             // .registerType(new StringET1ExtendedType());
             //
-            // // tweak mapping with a delegate
-            // for (Procedure proc : map.getProcedures()) {
-            // getAdapter(node).tweakProcedure(proc);
-            // }
 
             domain.addNode(node);
         }

Modified: cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerRuntimeProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerRuntimeProvider.java?rev=1565638&r1=1565637&r2=1565638&view=diff
==============================================================================
--- cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerRuntimeProvider.java
(original)
+++ cayenne/main/branches/STABLE-3.1/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/di/server/ServerRuntimeProvider.java
Fri Feb  7 13:16:12 2014
@@ -26,21 +26,25 @@ import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.di.Provider;
+import org.apache.cayenne.unit.UnitDbAdapter;
 
 public class ServerRuntimeProvider implements Provider<ServerRuntime> {
 
     private ServerCaseProperties properties;
     private ServerCaseDataSourceFactory dataSourceFactory;
+    private UnitDbAdapter unitDbAdapter;
 
     private Provider<DbAdapter> dbAdapterProvider;
 
     public ServerRuntimeProvider(@Inject ServerCaseDataSourceFactory dataSourceFactory,
             @Inject ServerCaseProperties properties,
-            @Inject Provider<DbAdapter> dbAdapterProvider) {
+            @Inject Provider<DbAdapter> dbAdapterProvider,
+            @Inject UnitDbAdapter unitDbAdapter) {
 
         this.dataSourceFactory = dataSourceFactory;
         this.properties = properties;
         this.dbAdapterProvider = dbAdapterProvider;
+        this.unitDbAdapter = unitDbAdapter;
     }
 
     public ServerRuntime get() throws ConfigurationException {
@@ -63,6 +67,7 @@ public class ServerRuntimeProvider imple
 
             binder.bind(DbAdapter.class).toProviderInstance(dbAdapterProvider);
             binder.bind(DataDomain.class).toProvider(ServerCaseDataDomainProvider.class);
+            binder.bind(UnitDbAdapter.class).toInstance(unitDbAdapter);
 
             // map DataSources for all test DataNode names
             binder.bind(ServerCaseDataSourceFactory.class).toInstance(dataSourceFactory);



Mime
View raw message