cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r954012 [2/2] - in /cayenne/main/trunk: framework/cayenne-di-unpublished/src/main/java/org/apache/cayenne/di/spi/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/...
Date Sat, 12 Jun 2010 14:32:54 GMT
Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
Sat Jun 12 14:32:52 2010
@@ -108,7 +108,7 @@ public class DataDomainProviderTest exte
 
         final DefaultRuntimeProperties testProperties = new DefaultRuntimeProperties(
                 Collections.singletonMap(
-                        RuntimeProperties.CONFIGURATION_LOCATION,
+                        ServerModule.CONFIGURATION_LOCATION,
                         testConfigName));
 
         final EventManager eventManager = new MockEventManager();

Copied: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeTest.java
(from r953778, cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeTest.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeTest.java?p2=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeTest.java&p1=cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeTest.java&r1=953778&r2=954012&rev=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeTest.java
Sat Jun 12 14:32:52 2010
@@ -26,7 +26,6 @@ import org.apache.cayenne.QueryResponse;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.configuration.ObjectContextFactory;
 import org.apache.cayenne.configuration.RuntimeProperties;
-import org.apache.cayenne.configuration.server.CayenneServerRuntime;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.event.EventManager;
@@ -34,21 +33,21 @@ import org.apache.cayenne.graph.GraphDif
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.Query;
 
-public class CayenneServerRuntimeTest extends TestCase {
+public class ServerRuntimeTest extends TestCase {
 
     public void testDefaultConstructor() {
-        CayenneServerRuntime runtime = new CayenneServerRuntime("xxxx");
+        ServerRuntime runtime = new ServerRuntime("xxxx");
 
         assertEquals("xxxx", runtime
                 .getInjector()
                 .getInstance(RuntimeProperties.class)
-                .get(RuntimeProperties.CONFIGURATION_LOCATION));
+                .get(ServerModule.CONFIGURATION_LOCATION));
 
         assertEquals(1, runtime.getModules().length);
 
         Module m0 = runtime.getModules()[0];
-        assertTrue(m0 instanceof CayenneServerModule);
-        assertEquals("xxxx", ((CayenneServerModule) m0).configurationLocation);
+        assertTrue(m0 instanceof ServerModule);
+        assertEquals("xxxx", ((ServerModule) m0).configurationLocation);
     }
 
     public void testConstructor_Modules() {
@@ -69,15 +68,14 @@ public class CayenneServerRuntimeTest ex
             }
         };
 
-        CayenneServerRuntime runtime = new CayenneServerRuntime(m1, m2);
-        assertEquals(2, runtime.getModules().length);
+        ServerRuntime runtime = new ServerRuntime("xxxx", m1, m2);
+        assertEquals(3, runtime.getModules().length);
 
-        for (int i = 0; i < configured.length; i++) {
-            assertTrue(configured[i]);
-        }
+        assertTrue(configured[0]);
+        assertTrue(configured[1]);
     }
 
-    public void testGetDataChannel() {
+    public void testGetDataChannel_CustomModule() {
         final DataChannel channel = new DataChannel() {
 
             public EntityResolver getEntityResolver() {
@@ -107,18 +105,18 @@ public class CayenneServerRuntimeTest ex
             }
         };
 
-        CayenneServerRuntime runtime = new CayenneServerRuntime(module);
-        assertSame(channel, runtime.getDataChannel());
+        ServerRuntime runtime = new ServerRuntime("Yuis", module);
+        assertSame(channel, runtime.getChannel());
     }
 
-    public void testGetObjectContext() {
+    public void testGetObjectContext_CustomModule() {
         final ObjectContext context = new DataContext();
         final ObjectContextFactory factory = new ObjectContextFactory() {
-            
+
             public ObjectContext createContext(DataChannel parent) {
                 return context;
             }
-            
+
             public ObjectContext createContext() {
                 return context;
             }
@@ -131,7 +129,7 @@ public class CayenneServerRuntimeTest ex
             }
         };
 
-        CayenneServerRuntime runtime = new CayenneServerRuntime(module);
+        ServerRuntime runtime = new ServerRuntime("mnYw", module);
         assertSame(context, runtime.getContext());
         assertSame(context, runtime.getContext());
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
Sat Jun 12 14:32:52 2010
@@ -20,9 +20,9 @@ package org.apache.cayenne.configuration
 
 import junit.framework.TestCase;
 
-import org.apache.cayenne.configuration.CayenneRuntime;
+import org.apache.cayenne.configuration.Runtime;
 import org.apache.cayenne.configuration.RuntimeProperties;
-import org.apache.cayenne.configuration.server.CayenneServerModule;
+import org.apache.cayenne.configuration.server.ServerModule;
 
 import com.mockrunner.mock.web.MockFilterChain;
 import com.mockrunner.mock.web.MockFilterConfig;
@@ -45,13 +45,13 @@ public class CayenneFilterTest extends T
         assertNull(WebUtil.getCayenneRuntime(context));
         filter.init(config);
 
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
+        Runtime runtime = WebUtil.getCayenneRuntime(context);
         assertNotNull(runtime);
 
         assertEquals("abc.xml", runtime
                 .getInjector()
                 .getInstance(RuntimeProperties.class)
-                .get(RuntimeProperties.CONFIGURATION_LOCATION));
+                .get(ServerModule.CONFIGURATION_LOCATION));
     }
 
     public void testInitWithLocation() throws Exception {
@@ -66,13 +66,13 @@ public class CayenneFilterTest extends T
         CayenneFilter filter = new CayenneFilter();
         filter.init(config);
 
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
+        Runtime runtime = WebUtil.getCayenneRuntime(context);
         assertNotNull(runtime);
 
         assertEquals("xyz", runtime
                 .getInjector()
                 .getInstance(RuntimeProperties.class)
-                .get(RuntimeProperties.CONFIGURATION_LOCATION));
+                .get(ServerModule.CONFIGURATION_LOCATION));
     }
 
     public void testInitWithStandardModules() throws Exception {
@@ -88,13 +88,13 @@ public class CayenneFilterTest extends T
         assertNull(WebUtil.getCayenneRuntime(context));
         filter.init(config);
 
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
+        Runtime runtime = WebUtil.getCayenneRuntime(context);
         assertNotNull(runtime);
 
         assertEquals("cayenne-abc.xml", runtime.getInjector().getInstance(
-                RuntimeProperties.class).get(RuntimeProperties.CONFIGURATION_LOCATION));
+                RuntimeProperties.class).get(ServerModule.CONFIGURATION_LOCATION));
         assertEquals(2, runtime.getModules().length);
-        assertTrue(runtime.getModules()[0] instanceof CayenneServerModule);
+        assertTrue(runtime.getModules()[0] instanceof ServerModule);
         assertTrue(runtime.getModules()[1] instanceof CayenneWebModule);
 
         RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
@@ -115,12 +115,12 @@ public class CayenneFilterTest extends T
         CayenneFilter filter = new CayenneFilter();
         filter.init(config);
 
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
+        Runtime runtime = WebUtil.getCayenneRuntime(context);
         assertNotNull(runtime);
 
         assertEquals(4, runtime.getModules().length);
 
-        assertTrue(runtime.getModules()[0] instanceof CayenneServerModule);
+        assertTrue(runtime.getModules()[0] instanceof ServerModule);
         assertTrue(runtime.getModules()[1] instanceof CayenneWebModule);
         assertTrue(runtime.getModules()[2] instanceof MockModule1);
         assertTrue(runtime.getModules()[3] instanceof MockModule2);
@@ -142,7 +142,7 @@ public class CayenneFilterTest extends T
         CayenneFilter filter = new CayenneFilter();
         filter.init(config);
 
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
+        Runtime runtime = WebUtil.getCayenneRuntime(context);
         CayenneFilter_DispatchRequestHandler handler = (CayenneFilter_DispatchRequestHandler)
runtime
                 .getInjector()
                 .getInstance(RequestHandler.class);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
Sat Jun 12 14:32:52 2010
@@ -18,7 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import org.apache.cayenne.configuration.CayenneRuntime;
+import org.apache.cayenne.configuration.Runtime;
 
 import com.mockrunner.mock.web.MockServletContext;
 
@@ -31,13 +31,13 @@ public class WebUtilTest extends TestCas
 
         assertNull(WebUtil.getCayenneRuntime(context));
 
-        CayenneRuntime runtime = new CayenneRuntime() {
+        Runtime runtime = new Runtime() {
         };
 
         WebUtil.setCayenneRuntime(context, runtime);
         assertSame(runtime, WebUtil.getCayenneRuntime(context));
 
-        CayenneRuntime runtime1 = new CayenneRuntime() {
+        Runtime runtime1 = new Runtime() {
         };
 
         WebUtil.setCayenneRuntime(context, runtime1);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/unit/jira/CAY_743Test.java
Sat Jun 12 14:32:52 2010
@@ -21,7 +21,7 @@ package org.apache.cayenne.unit.jira;
 import junit.framework.TestCase;
 
 import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.configuration.server.CayenneServerModule;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.map.DataMap;
@@ -31,7 +31,7 @@ public class CAY_743Test extends TestCas
 
     public void testLoad2MapsWithCrossMapInheritance() throws Exception {
 
-        Injector injector = DIBootstrap.createInjector(new CayenneServerModule(
+        Injector injector = DIBootstrap.createInjector(new ServerModule(
                 "cay743/cayenne-domain.xml"));
 
         DataDomain domain = injector.getInstance(DataDomain.class);

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/Application.java
Sat Jun 12 14:32:52 2010
@@ -33,7 +33,7 @@ import javax.swing.JRootPane;
 import javax.swing.SwingUtilities;
 
 import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.configuration.server.CayenneServerModule;
+import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.di.Module;
@@ -124,7 +124,7 @@ public class Application {
         this.initialProject = initialProject;
 
         Module projectModule = new CayenneProjectModule();
-        Module serverModule = new CayenneServerModule("CayenneModeler");
+        Module serverModule = new ServerModule("CayenneModeler");
 
         this.injector = DIBootstrap.createInjector(projectModule, serverModule);
 

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DataPortTask.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DataPortTask.java?rev=954012&r1=954011&r2=954012&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DataPortTask.java
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DataPortTask.java
Sat Jun 12 14:32:52 2010
@@ -26,8 +26,7 @@ import java.util.HashSet;
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.DataPort;
-import org.apache.cayenne.configuration.server.CayenneServerModule;
-import org.apache.cayenne.configuration.server.CayenneServerRuntime;
+import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.Module;
 import org.apache.cayenne.map.DataMap;
@@ -64,18 +63,17 @@ public class DataPortTask extends Cayenn
         validateParameters();
 
         String projectFileLocation = projectFile.getName();
-        Module module = new CayenneServerModule(projectFileLocation) {
+        Module dataPortModule = new Module() {
 
-            @Override
             public void configure(Binder binder) {
-                super.configure(binder);
-
                 binder.bind(ResourceLocator.class).toInstance(
                         new FilesystemResourceLocator(projectFile));
             }
         };
 
-        CayenneServerRuntime runtime = new CayenneServerRuntime(module);
+        ServerRuntime runtime = new ServerRuntime(
+                projectFileLocation,
+                dataPortModule);
         DataDomain domain;
 
         ClassLoader threadContextClassLoader = Thread

Copied: cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/ServerRuntimeCase.java
(from r953778, cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeCase.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/ServerRuntimeCase.java?p2=cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/ServerRuntimeCase.java&p1=cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeCase.java&r1=953778&r2=954012&rev=954012&view=diff
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/CayenneServerRuntimeCase.java
(original)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/main/java/org/apache/cayenne/configuration/server/ServerRuntimeCase.java
Sat Jun 12 14:32:52 2010
@@ -27,19 +27,19 @@ import junit.framework.TestCase;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
-import org.apache.cayenne.configuration.server.CayenneServerRuntime;
+import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.test.DBHelper;
 import org.apache.cayenne.test.TableHelper;
 
-public abstract class CayenneServerRuntimeCase extends TestCase {
+public abstract class ServerRuntimeCase extends TestCase {
 
-	static final Map<RuntimeName, CayenneServerRuntime> runtimeCache;
+	static final Map<RuntimeName, ServerRuntime> runtimeCache;
 
 	static {
-		runtimeCache = new HashMap<RuntimeName, CayenneServerRuntime>();
+		runtimeCache = new HashMap<RuntimeName, ServerRuntime>();
 	}
 
-	protected CayenneServerRuntime runtime;
+	protected ServerRuntime runtime;
 
 	@Override
 	protected void setUp() throws Exception {
@@ -50,7 +50,7 @@ public abstract class CayenneServerRunti
 		String location = "cayenne-" + name + ".xml";
 		runtime = runtimeCache.get(location);
 		if (runtime == null) {
-			runtime = new CayenneServerRuntime(location);
+			runtime = new ServerRuntime(location);
 			runtimeCache.put(name, runtime);
 
 			// setup schema

Copied: cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeIntegrationTest.java
(from r953778, cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeIntegrationTest.java?p2=cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeIntegrationTest.java&p1=cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java&r1=953778&r2=954012&rev=954012&view=diff
==============================================================================
--- cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/runtime/CayenneServerRuntimeIntegrationTest.java
(original)
+++ cayenne/main/trunk/itests/cayenne-di-stack/src/test/java/org/apache/cayenne/configuration/server/ServerRuntimeIntegrationTest.java
Sat Jun 12 14:32:52 2010
@@ -16,12 +16,12 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.runtime;
+package org.apache.cayenne.configuration.server;
 
 import org.apache.cayenne.Cayenne;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.configuration.server.CayenneServerRuntimeCase;
+import org.apache.cayenne.configuration.server.ServerRuntimeCase;
 import org.apache.cayenne.configuration.server.RuntimeName;
 import org.apache.cayenne.event.DefaultEventManager;
 import org.apache.cayenne.event.EventManager;
@@ -29,8 +29,7 @@ import org.apache.cayenne.itest.di_stack
 import org.apache.cayenne.query.SelectQuery;
 import org.apache.cayenne.test.DBHelper;
 
-public class CayenneServerRuntimeIntegrationTest extends
-		CayenneServerRuntimeCase {
+public class ServerRuntimeIntegrationTest extends ServerRuntimeCase {
 
 	@Override
 	protected RuntimeName getRuntimeName() {



Mime
View raw message