cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [09/24] cayenne git commit: CAY-2372. OSGI, web-module with tests.
Date Thu, 07 Dec 2017 09:00:24 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java b/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
deleted file mode 100644
index 99cccbf..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.rop;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * ROP serialization service
- *
- * @since 4.0
- */
-public interface ROPSerializationService {
-
-    byte[] serialize(Object object) throws IOException;
-
-    void serialize(Object object, OutputStream outputStream) throws IOException;
-
-    <T> T deserialize(InputStream inputStream, Class<T> objectClass) throws IOException;
-
-    <T> T deserialize(byte[] serializedObject, Class<T> objectClass) throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPServlet.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPServlet.java b/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPServlet.java
deleted file mode 100644
index e7a0001..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPServlet.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.rop;
-
-import org.apache.cayenne.configuration.CayenneRuntime;
-import org.apache.cayenne.configuration.rop.server.ROPServerModule;
-import org.apache.cayenne.configuration.server.ServerRuntime;
-import org.apache.cayenne.configuration.web.WebConfiguration;
-import org.apache.cayenne.configuration.web.WebUtil;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.remote.ClientMessage;
-import org.apache.cayenne.remote.RemoteService;
-import org.apache.cayenne.remote.RemoteSession;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-
-public class ROPServlet extends HttpServlet {
-
-    protected ServletContext servletContext;
-	protected RemoteService remoteService;
-    protected ROPSerializationService serializationService;
-
-    @Override
-    public void init(ServletConfig configuration) throws ServletException {
-
-        checkAlreadyConfigured(configuration.getServletContext());
-
-        this.servletContext = configuration.getServletContext();
-
-        WebConfiguration configAdapter = new WebConfiguration(configuration);
-
-        String configurationLocation = configAdapter.getConfigurationLocation();
-        Map<String, String> eventBridgeParameters = configAdapter.getOtherParameters();
-
-        Collection<Module> modules = configAdapter.createModules(new ROPServerModule(
-                eventBridgeParameters));
-
-        ServerRuntime runtime = ServerRuntime.builder()
-                .addConfig(configurationLocation)
-                .addModules(modules)
-                .build();
-
-        this.remoteService = runtime.getInjector().getInstance(RemoteService.class);
-        this.serializationService = runtime.getInjector().getInstance(ROPSerializationService.class);
-
-        WebUtil.setCayenneRuntime(servletContext, runtime);
-        super.init(configuration);
-    }
-
-    protected void checkAlreadyConfigured(ServletContext context) throws ServletException {
-        // sanity check
-        if (WebUtil.getCayenneRuntime(context) != null) {
-            throw new ServletException(
-                    "CayenneRuntime is already configured in the servlet environment");
-        }
-    }
-
-    @Override
-    public void destroy() {
-        super.destroy();
-
-        CayenneRuntime runtime = WebUtil.getCayenneRuntime(servletContext);
-        if (runtime != null) {
-            runtime.shutdown();
-        }
-    }
-
-    @Override
-    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-		try {
-            String serviceId = req.getPathInfo();
-            String objectId = req.getParameter("id");
-
-            if (objectId == null) {
-                objectId = req.getParameter("ejbid");
-            }
-
-            ROPRequestContext.start(serviceId, objectId, req, resp);
-
-            String operation = req.getParameter(ROPConstants.OPERATION_PARAMETER);
-
-            if (operation != null) {
-                switch (operation) {
-                    case ROPConstants.ESTABLISH_SESSION_OPERATION:
-                        RemoteSession session = remoteService.establishSession();
-                        serializationService.serialize(session, resp.getOutputStream());
-                        break;
-                    case ROPConstants.ESTABLISH_SHARED_SESSION_OPERATION:
-                        String sessionName = req.getParameter(ROPConstants.SESSION_NAME_PARAMETER);
-                        RemoteSession sharedSession = remoteService.establishSharedSession(sessionName);
-
-                        serializationService.serialize(sharedSession, resp.getOutputStream());
-                        break;
-                    default:
-                        throw new ServletException("Unknown operation: " + operation);
-                }
-            } else {
-                Object response = remoteService.processMessage(
-                        serializationService.deserialize(req.getInputStream(), ClientMessage.class));
-
-                serializationService.serialize(response, resp.getOutputStream());
-            }
-        } catch (RuntimeException | ServletException e) {
-            throw e;
-        } catch (Throwable e) {
-            throw new ServletException(e);
-        } finally {
-            ROPRequestContext.end();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHessianSerializationServiceProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHessianSerializationServiceProvider.java b/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHessianSerializationServiceProvider.java
deleted file mode 100644
index ec0c21c..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHessianSerializationServiceProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.rop;
-
-import org.apache.cayenne.di.DIRuntimeException;
-import org.apache.cayenne.di.Provider;
-import org.apache.cayenne.remote.hessian.HessianConfig;
-import org.apache.cayenne.remote.hessian.service.ServerSerializerFactory;
-
-public class ServerHessianSerializationServiceProvider implements Provider<ROPSerializationService> {
-
-    public static final String[] SERVER_SERIALIZER_FACTORIES = new String[] {
-            ServerSerializerFactory.class.getName()
-    };
-
-    @Override
-    public ROPSerializationService get() throws DIRuntimeException {
-        return new HessianROPSerializationService(
-                HessianConfig.createFactory(SERVER_SERIALIZER_FACTORIES, null));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHttpRemoteService.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHttpRemoteService.java b/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHttpRemoteService.java
deleted file mode 100644
index 9099b04..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/rop/ServerHttpRemoteService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.rop;
-
-import org.apache.cayenne.configuration.Constants;
-import org.apache.cayenne.configuration.ObjectContextFactory;
-import org.apache.cayenne.di.Inject;
-import org.apache.cayenne.remote.service.HttpRemoteService;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.Map;
-
-public class ServerHttpRemoteService extends HttpRemoteService {
-	
-	public ServerHttpRemoteService(@Inject ObjectContextFactory contextFactory,
-								   @Inject(Constants.SERVER_ROP_EVENT_BRIDGE_PROPERTIES_MAP) Map<String, String> eventBridgeProperties) {
-		super(contextFactory, eventBridgeProperties);
-	}
-
-	@Override
-	protected HttpSession getSession(boolean create) {
-		HttpServletRequest request = (HttpServletRequest) ROPRequestContext.getContextRequest();
-		if (request == null) {
-			throw new IllegalStateException(
-					"Attempt to access HttpSession outside the request scope.");
-		}
-
-		return request.getSession(create);
-	}
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPHessianServlet_ConfigModule.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPHessianServlet_ConfigModule.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPHessianServlet_ConfigModule.java
deleted file mode 100644
index ed78c7c..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPHessianServlet_ConfigModule.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.rop.server;
-
-import org.apache.cayenne.DataChannel;
-import org.apache.cayenne.access.DataDomain;
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.remote.MockRemoteService;
-import org.apache.cayenne.remote.RemoteService;
-
-public class ROPHessianServlet_ConfigModule implements Module {
-
-    public void configure(Binder binder) {
-        
-        DataDomain domain = new DataDomain("x");
-        binder.bind(DataChannel.class).toInstance(domain);
-        binder.bind(DataDomain.class).toInstance(domain);
-        binder.bind(RemoteService.class).to(MockRemoteService.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
deleted file mode 100644
index caee53d..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.rop.server;
-
-import com.mockrunner.mock.web.MockServletConfig;
-import com.mockrunner.mock.web.MockServletContext;
-import org.apache.cayenne.configuration.CayenneRuntime;
-import org.apache.cayenne.configuration.Constants;
-import org.apache.cayenne.configuration.server.ServerModule;
-import org.apache.cayenne.configuration.web.MockModule1;
-import org.apache.cayenne.configuration.web.MockModule2;
-import org.apache.cayenne.configuration.web.MockRequestHandler;
-import org.apache.cayenne.configuration.web.RequestHandler;
-import org.apache.cayenne.configuration.web.WebUtil;
-import org.apache.cayenne.di.Key;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.rop.ROPServlet;
-import org.junit.After;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import static org.junit.Assert.*;
-
-public class ROPServletTest {
-
-	private CayenneRuntime runtime;
-
-	@After
-	public void shutdownRuntime() {
-		if(runtime != null) {
-			runtime.shutdown();
-		}
-	}
-
-	@Test
-	public void testInitWithServletName() throws Exception {
-
-		MockServletConfig config = new MockServletConfig();
-		config.setServletName("cayenne-org.apache.cayenne.configuration.rop.server.test-config");
-
-		MockServletContext context = new MockServletContext();
-		config.setServletContext(context);
-
-		ROPServlet servlet = new ROPServlet();
-
-		assertNull(WebUtil.getCayenneRuntime(context));
-		servlet.init(config);
-
-		runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-		assertEquals(Arrays.asList("cayenne-org.apache.cayenne.configuration.rop.server.test-config.xml"), locations);
-	}
-
-	@Test
-	public void testInitWithLocation() throws Exception {
-
-		String location = "cayenne-org.apache.cayenne.configuration.rop.server.test-config.xml";
-		MockServletConfig config = new MockServletConfig();
-		config.setServletName("abc");
-		config.setInitParameter("configuration-location", location);
-
-		MockServletContext context = new MockServletContext();
-		config.setServletContext(context);
-
-		ROPServlet servlet = new ROPServlet();
-		servlet.init(config);
-
-		runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-
-		assertEquals(Arrays.asList(location), locations);
-	}
-
-	@Test
-	public void testInitWithStandardModules() throws Exception {
-
-		String name = "cayenne-org.apache.cayenne.configuration.rop.server.test-config";
-
-		MockServletConfig config = new MockServletConfig();
-		config.setServletName(name);
-
-		MockServletContext context = new MockServletContext();
-		config.setServletContext(context);
-
-		ROPServlet servlet = new ROPServlet();
-		servlet.init(config);
-
-		runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-
-		assertEquals(Arrays.asList(name + ".xml"), locations);
-		
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(3, modules.size());
-		Object[] marray = modules.toArray();
-
-		assertTrue(marray[0] instanceof ServerModule);
-		// [2] is an inner class
-		assertTrue(marray[1] instanceof ROPServerModule);
-	}
-
-	@Test
-	public void testInitWithExtraModules() throws Exception {
-
-		String name = "cayenne-org.apache.cayenne.configuration.rop.server.test-config";
-
-		MockServletConfig config = new MockServletConfig();
-		config.setServletName(name);
-		config.setInitParameter("extra-modules", MockModule1.class.getName() + "," + MockModule2.class.getName());
-
-		MockServletContext context = new MockServletContext();
-		config.setServletContext(context);
-
-		ROPServlet servlet = new ROPServlet();
-		servlet.init(config);
-
-		runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(5, modules.size());
-
-		Object[] marray = modules.toArray();
-
-		assertTrue(marray[0] instanceof ServerModule);
-		// [1] is an inner class
-		assertTrue(marray[1] instanceof ROPServerModule);
-		assertTrue(marray[2] instanceof MockModule1);
-		assertTrue(marray[3] instanceof MockModule2);
-
-		RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
-		assertTrue(handler instanceof MockRequestHandler);
-	}
-
-	@Test
-	public void testInitHessianService() throws Exception {
-
-		MockServletConfig config = new MockServletConfig();
-		config.setServletName("abc");
-
-		MockServletContext context = new MockServletContext();
-		config.setServletContext(context);
-		config.setInitParameter("extra-modules", ROPHessianServlet_ConfigModule.class.getName());
-
-		ROPServlet servlet = new ROPServlet();
-
-		servlet.init(config);
-		runtime = WebUtil.getCayenneRuntime(context);
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(4, modules.size());
-
-		Object[] marray = modules.toArray();
-
-		assertTrue(marray[2] instanceof ROPHessianServlet_ConfigModule);
-
-		// TODO: mock servlet request to check that the right service instance
-		// is invoked
-	}
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
deleted file mode 100644
index a2b037b..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import com.mockrunner.mock.web.MockFilterChain;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockServletContext;
-import org.apache.cayenne.configuration.CayenneRuntime;
-import org.apache.cayenne.configuration.Constants;
-import org.apache.cayenne.configuration.server.ServerModule;
-import org.apache.cayenne.di.Key;
-import org.apache.cayenne.di.Module;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-public class CayenneFilterTest {
-
-    @Test
-	public void testInitWithFilterName() throws Exception {
-
-		MockFilterConfig config = new MockFilterConfig();
-		config.setFilterName("abc");
-
-		MockServletContext context = new MockServletContext();
-		config.setupServletContext(context);
-
-		CayenneFilter filter = new CayenneFilter();
-
-		assertNull(WebUtil.getCayenneRuntime(context));
-		filter.init(config);
-
-		CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-
-		assertEquals(Arrays.asList("abc.xml"), locations);
-	}
-
-    @Test
-	public void testInitWithLocation() throws Exception {
-
-		MockFilterConfig config = new MockFilterConfig();
-		config.setFilterName("abc");
-		config.setInitParameter(WebConfiguration.CONFIGURATION_LOCATION_PARAMETER, "xyz");
-
-		MockServletContext context = new MockServletContext();
-		config.setupServletContext(context);
-
-		CayenneFilter filter = new CayenneFilter();
-		filter.init(config);
-
-		CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-
-		assertEquals(Arrays.asList("xyz"), locations);
-	}
-
-    @Test
-	public void testInitWithStandardModules() throws Exception {
-
-		MockFilterConfig config = new MockFilterConfig();
-		config.setFilterName("cayenne-abc");
-
-		MockServletContext context = new MockServletContext();
-		config.setupServletContext(context);
-
-		CayenneFilter filter = new CayenneFilter();
-
-		assertNull(WebUtil.getCayenneRuntime(context));
-		filter.init(config);
-
-		CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-		List<String> locations = runtime.getInjector().getInstance(
-				Key.getListOf(String.class, Constants.SERVER_PROJECT_LOCATIONS_LIST));
-
-		assertEquals(Arrays.asList("cayenne-abc.xml"), locations);
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(3, modules.size());
-
-		Object[] marray = modules.toArray();
-
-		assertTrue(marray[0] instanceof ServerModule);
-		// [2] is an inner class
-		assertTrue(marray[1] instanceof WebModule);
-
-		RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
-		assertTrue(handler instanceof SessionContextRequestHandler);
-	}
-
-    @Test
-	public void testInitWithExtraModules() throws Exception {
-
-		MockFilterConfig config = new MockFilterConfig();
-		config.setFilterName("abc");
-		config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, MockModule1.class.getName() + ","
-				+ MockModule2.class.getName());
-
-		MockServletContext context = new MockServletContext();
-		config.setupServletContext(context);
-
-		CayenneFilter filter = new CayenneFilter();
-		filter.init(config);
-
-		CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
-		assertNotNull(runtime);
-
-		Collection<Module> modules = runtime.getModules();
-		assertEquals(5, modules.size());
-
-		Object[] marray = modules.toArray();
-		assertTrue(marray[0] instanceof ServerModule);
-		// [4] is an inner class
-		assertTrue(marray[1] instanceof WebModule);
-		assertTrue(marray[2] instanceof MockModule1);
-		assertTrue(marray[3] instanceof MockModule2);
-
-		RequestHandler handler = runtime.getInjector().getInstance(RequestHandler.class);
-		assertTrue(handler instanceof MockRequestHandler);
-	}
-
-    @Test
-	public void testDoFilter() throws Exception {
-		MockFilterConfig config = new MockFilterConfig();
-		config.setFilterName("abc");
-		config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, CayenneFilter_DispatchModule.class.getName());
-
-		MockServletContext context = new MockServletContext();
-		config.setupServletContext(context);
-
-		CayenneFilter filter = new CayenneFilter();
-		filter.init(config);
-
-		CayenneRuntime runtime = WebUtil.getCayenneRuntime(context);
-		CayenneFilter_DispatchRequestHandler handler = (CayenneFilter_DispatchRequestHandler) runtime.getInjector()
-				.getInstance(RequestHandler.class);
-
-		assertEquals(0, handler.getStarted());
-		assertEquals(0, handler.getEnded());
-
-		filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain());
-		assertEquals(1, handler.getStarted());
-		assertEquals(1, handler.getEnded());
-
-		filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain());
-		assertEquals(2, handler.getStarted());
-		assertEquals(2, handler.getEnded());
-	}
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchModule.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchModule.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchModule.java
deleted file mode 100644
index 8842e27..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchModule.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-
-public class CayenneFilter_DispatchModule implements Module {
-
-    public void configure(Binder binder) {
-        binder.bind(RequestHandler.class).to(CayenneFilter_DispatchRequestHandler.class);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchRequestHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchRequestHandler.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchRequestHandler.java
deleted file mode 100644
index 12006e6..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/CayenneFilter_DispatchRequestHandler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-public class CayenneFilter_DispatchRequestHandler implements RequestHandler {
-
-    private int started;
-    private int ended;
-
-    public void requestEnd(ServletRequest request, ServletResponse response) {
-        ended++;
-    }
-
-    public void requestStart(ServletRequest request, ServletResponse response) {
-        started++;
-    }
-
-    public int getStarted() {
-        return started;
-    }
-
-    public int getEnded() {
-        return ended;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule1.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule1.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule1.java
deleted file mode 100644
index 52fcb06..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule1.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-
-
-public class MockModule1 implements Module {
-
-    public void configure(Binder binder) {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule2.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule2.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule2.java
deleted file mode 100644
index 59a4a56..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockModule2.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-
-public class MockModule2 implements Module {
-
-    public void configure(Binder binder) {
-        binder.bind(RequestHandler.class).to(MockRequestHandler.class);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockRequestHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockRequestHandler.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockRequestHandler.java
deleted file mode 100644
index 1da4710..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/MockRequestHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-
-public class MockRequestHandler implements RequestHandler {
-
-    public void requestEnd(ServletRequest request, ServletResponse response) {
-    }
-
-    public void requestStart(ServletRequest request, ServletResponse response) {
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
deleted file mode 100644
index 2c3905a..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/ServletContextHandlerTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import org.apache.cayenne.BaseContext;
-import org.apache.cayenne.DataChannel;
-import org.apache.cayenne.MockDataChannel;
-import org.apache.cayenne.ObjectContext;
-import org.apache.cayenne.configuration.ObjectContextFactory;
-import org.apache.cayenne.di.DIBootstrap;
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.di.Module;
-import org.junit.Test;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.mock;
-
-public class ServletContextHandlerTest {
-
-    @Test
-    public void testRequestStart_bindContext() {
-
-        Module module = binder -> {
-
-            binder.bind(DataChannel.class).to(MockDataChannel.class);
-            binder.bind(ObjectContextFactory.class).toInstance(
-                    new ObjectContextFactory() {
-
-                        public ObjectContext createContext(DataChannel parent) {
-                            return mock(ObjectContext.class);
-                        }
-
-                        public ObjectContext createContext() {
-                            return mock(ObjectContext.class);
-                        }
-                    });
-        };
-        Injector injector = DIBootstrap.createInjector(module);
-        SessionContextRequestHandler handler = new SessionContextRequestHandler();
-        injector.injectMembers(handler);
-
-        MockHttpSession session = new MockHttpSession();
-
-        BaseContext.bindThreadObjectContext(null);
-
-        try {
-
-            MockHttpServletRequest request1 = new MockHttpServletRequest();
-            MockHttpServletResponse response1 = new MockHttpServletResponse();
-            request1.setSession(session);
-            handler.requestStart(request1, response1);
-
-            ObjectContext c1 = BaseContext.getThreadObjectContext();
-            assertNotNull(c1);
-
-            handler.requestEnd(request1, response1);
-
-            try {
-                BaseContext.getThreadObjectContext();
-                fail("thread context not null");
-            }
-            catch (IllegalStateException e) {
-                // expected
-            }
-
-            MockHttpServletRequest request2 = new MockHttpServletRequest();
-            MockHttpServletResponse response2 = new MockHttpServletResponse();
-            request2.setSession(session);
-            handler.requestStart(request2, response2);
-
-            ObjectContext c2 = BaseContext.getThreadObjectContext();
-            assertSame(c1, c2);
-
-            handler.requestEnd(request2, response2);
-            try {
-                BaseContext.getThreadObjectContext();
-                fail("thread context not null");
-            }
-            catch (IllegalStateException e) {
-                // expected
-            }
-
-            MockHttpServletRequest request3 = new MockHttpServletRequest();
-            MockHttpServletResponse response3 = new MockHttpServletResponse();
-            request3.setSession(new MockHttpSession());
-            handler.requestStart(request3, response3);
-
-            ObjectContext c3 = BaseContext.getThreadObjectContext();
-            assertNotNull(c3);
-            assertNotSame(c1, c3);
-
-            handler.requestEnd(request3, response3);
-            try {
-                BaseContext.getThreadObjectContext();
-                fail("thread context not null");
-            }
-            catch (IllegalStateException e) {
-                // expected
-            }
-        }
-        finally {
-            BaseContext.bindThreadObjectContext(null);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
deleted file mode 100644
index 95c9fc3..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebConfigurationTest.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockServletConfig;
-import org.apache.cayenne.di.Module;
-import org.junit.Test;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.junit.Assert.*;
-
-public class WebConfigurationTest {
-
-    @Test
-    public void testFilterCreateModules_Standard() throws Exception {
-
-        MockFilterConfig config = new MockFilterConfig();
-        WebConfiguration configuration = new WebConfiguration(config);
-
-        Module m1 = binder -> {
-        };
-
-        Module m2 = binder -> {
-        };
-
-        Collection<Module> modules = configuration.createModules(m1, m2);
-        assertEquals(2, modules.size());
-
-        Iterator<Module> it = modules.iterator();
-        assertSame(m1, it.next());
-        assertSame(m2, it.next());
-    }
-
-    @Test
-    public void testFilterCreateModules_Extra() throws Exception {
-
-        MockFilterConfig config = new MockFilterConfig();
-        String exra = String.format(
-                "%s, \n%s",
-                MockModule1.class.getName(),
-                MockModule2.class.getName());
-        config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, exra);
-
-        WebConfiguration configuration = new WebConfiguration(config);
-
-        Module m1 = binder -> {
-        };
-
-        Module m2 = binder -> {
-        };
-
-        Collection<Module> modules = configuration.createModules(m1, m2);
-        assertEquals(4, modules.size());
-
-        Iterator<Module> it = modules.iterator();
-        assertSame(m1, it.next());
-        assertSame(m2, it.next());
-        assertTrue(it.next() instanceof MockModule1);
-        assertTrue(it.next() instanceof MockModule2);
-    }
-
-    @Test
-    public void testServletCreateModules_Extra() throws Exception {
-
-        MockServletConfig config = new MockServletConfig();
-        String exra = String.format(
-                "%s, \n%s",
-                MockModule1.class.getName(),
-                MockModule2.class.getName());
-        config.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, exra);
-
-        WebConfiguration configuration = new WebConfiguration(config);
-
-        Module m1 = binder -> {
-        };
-
-        Module m2 = binder -> {
-        };
-
-        Collection<Module> modules = configuration.createModules(m1, m2);
-        assertEquals(4, modules.size());
-
-        Iterator<Module> it = modules.iterator();
-        assertSame(m1, it.next());
-        assertSame(m2, it.next());
-        assertTrue(it.next() instanceof MockModule1);
-        assertTrue(it.next() instanceof MockModule2);
-    }
-
-    @Test
-    public void testFilterConfigurationLocation_Name() {
-        MockFilterConfig config1 = new MockFilterConfig();
-        config1.setFilterName("cayenne-x");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        assertEquals("cayenne-x.xml", configuration1.getConfigurationLocation());
-
-        MockFilterConfig config2 = new MockFilterConfig();
-        config2.setFilterName("cayenne-y.xml");
-
-        WebConfiguration configuration2 = new WebConfiguration(config2);
-        assertEquals("cayenne-y.xml", configuration2.getConfigurationLocation());
-
-        MockFilterConfig config3 = new MockFilterConfig();
-        config3.setFilterName("a/b/c/cayenne-z.xml");
-
-        WebConfiguration configuration3 = new WebConfiguration(config3);
-        assertEquals("a/b/c/cayenne-z.xml", configuration3.getConfigurationLocation());
-    }
-
-    @Test
-    public void testServletConfigurationLocation_Name() {
-        MockServletConfig config1 = new MockServletConfig();
-        config1.setServletName("cayenne-x");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        assertEquals("cayenne-x.xml", configuration1.getConfigurationLocation());
-
-        MockServletConfig config2 = new MockServletConfig();
-        config2.setServletName("cayenne-y.xml");
-
-        WebConfiguration configuration2 = new WebConfiguration(config2);
-        assertEquals("cayenne-y.xml", configuration2.getConfigurationLocation());
-
-        MockServletConfig config3 = new MockServletConfig();
-        config3.setServletName("a/b/c/cayenne-z.xml");
-
-        WebConfiguration configuration3 = new WebConfiguration(config3);
-        assertEquals("a/b/c/cayenne-z.xml", configuration3.getConfigurationLocation());
-    }
-
-    @Test
-    public void testFilterConfigurationLocation_Parameter() {
-        MockFilterConfig config1 = new MockFilterConfig();
-        config1.setFilterName("cayenne-x");
-        config1.setInitParameter(
-                WebConfiguration.CONFIGURATION_LOCATION_PARAMETER,
-                "cayenne-y.xml");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        assertEquals("cayenne-y.xml", configuration1.getConfigurationLocation());
-    }
-
-    @Test
-    public void testServletConfigurationLocation_Parameter() {
-        MockServletConfig config1 = new MockServletConfig();
-        config1.setServletName("cayenne-x");
-        config1.setInitParameter(
-                WebConfiguration.CONFIGURATION_LOCATION_PARAMETER,
-                "cayenne-y.xml");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        assertEquals("cayenne-y.xml", configuration1.getConfigurationLocation());
-    }
-
-    @Test
-    public void testFilterParameters() {
-        MockFilterConfig config1 = new MockFilterConfig();
-        config1.setFilterName("cayenne-x");
-        config1.setInitParameter(
-                WebConfiguration.CONFIGURATION_LOCATION_PARAMETER,
-                "cayenne-y.xml");
-        config1.setInitParameter("test", "xxx");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        Map<String, String> parameters = configuration1.getParameters();
-        assertNotSame(parameters, configuration1.getParameters());
-        assertEquals(parameters, configuration1.getParameters());
-
-        assertEquals(2, parameters.size());
-        assertEquals("cayenne-y.xml", parameters
-                .get(WebConfiguration.CONFIGURATION_LOCATION_PARAMETER));
-        assertEquals("xxx", parameters.get("test"));
-    }
-
-    @Test
-    public void testFilterOtherParameters() {
-        MockFilterConfig config1 = new MockFilterConfig();
-        config1.setFilterName("cayenne-x");
-        config1.setInitParameter(
-                WebConfiguration.CONFIGURATION_LOCATION_PARAMETER,
-                "cayenne-y.xml");
-        config1.setInitParameter(WebConfiguration.EXTRA_MODULES_PARAMETER, "M1,M2");
-        config1.setInitParameter("test", "xxx");
-
-        WebConfiguration configuration1 = new WebConfiguration(config1);
-        Map<String, String> parameters = configuration1.getOtherParameters();
-        assertNotSame(parameters, configuration1.getOtherParameters());
-        assertEquals(parameters, configuration1.getOtherParameters());
-
-        assertEquals(1, parameters.size());
-        assertEquals("xxx", parameters.get("test"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
deleted file mode 100644
index 0fd2ff2..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebModuleTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import org.apache.cayenne.di.Injector;
-import org.apache.cayenne.di.spi.DefaultInjector;
-import org.junit.Test;
-
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
-
-public class WebModuleTest {
-
-    @Test
-    public void testBind_Scopes() {
-
-        Injector injector = new DefaultInjector(new WebModule());
-        RequestHandler handler = injector.getInstance(RequestHandler.class);
-        assertTrue(handler instanceof SessionContextRequestHandler);
-
-        RequestHandler handler1 = injector.getInstance(RequestHandler.class);
-        assertNotSame("Incorrect singleton scope for request handler", handler, handler1);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/24b45fd4/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java b/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
deleted file mode 100644
index 5db0f43..0000000
--- a/cayenne-server/src/test/java/org/apache/cayenne/configuration/web/WebUtilTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.configuration.web;
-
-import com.mockrunner.mock.web.MockServletContext;
-import org.apache.cayenne.configuration.CayenneRuntime;
-import org.junit.Test;
-
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.mockito.Mockito.mock;
-
-public class WebUtilTest {
-
-    @Test
-	public void testGetCayenneRuntime() {
-		MockServletContext context = new MockServletContext();
-
-		assertNull(WebUtil.getCayenneRuntime(context));
-
-		CayenneRuntime runtime = mock(CayenneRuntime.class);
-
-		WebUtil.setCayenneRuntime(context, runtime);
-		assertSame(runtime, WebUtil.getCayenneRuntime(context));
-
-		CayenneRuntime runtime1 = mock(CayenneRuntime.class);
-
-		WebUtil.setCayenneRuntime(context, runtime1);
-		assertSame(runtime1, WebUtil.getCayenneRuntime(context));
-
-		WebUtil.setCayenneRuntime(context, null);
-		assertNull(WebUtil.getCayenneRuntime(context));
-	}
-}


Mime
View raw message