cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [22/24] cayenne git commit: CAY-2372 import fix and cayenne-rop-server pom changes
Date Thu, 07 Dec 2017 09:00:37 GMT
CAY-2372 import fix and cayenne-rop-server pom changes


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/e2e2684f
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/e2e2684f
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/e2e2684f

Branch: refs/heads/master
Commit: e2e2684f960ae0224ab65b70cc92276e92299347
Parents: 01da0e4
Author: Arseni Bulatski <ancarseni@gmail.com>
Authored: Wed Dec 6 13:03:01 2017 +0300
Committer: Arseni Bulatski <ancarseni@gmail.com>
Committed: Wed Dec 6 13:03:01 2017 +0300

----------------------------------------------------------------------
 .../osgi/OsgiClassLoaderManager.java            |  5 ++--
 .../cayenne/configuration/osgi/OsgiModule.java  |  7 +++---
 .../configuration/osgi/OsgiModuleBuilder.java   |  5 ++--
 .../osgi/OsgiClassLoaderManagerTest.java        | 26 ++++++++++----------
 cayenne-rop-server/pom.xml                      |  2 +-
 .../rop/server/ROPServletTest.java              |  4 ++-
 .../configuration/web/CayenneFilter.java        |  8 +++++-
 .../web/SessionContextRequestHandler.java       | 10 ++++----
 .../web/StatelessContextRequestHandler.java     |  7 +++---
 .../configuration/web/WebConfiguration.java     | 10 +++++++-
 .../cayenne/configuration/web/WebUtil.java      |  4 +--
 .../configuration/web/CayenneFilterTest.java    | 11 +++++++--
 .../tutorial/src/main/webapp/WEB-INF/web.xml    |  2 +-
 13 files changed, 61 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManager.java
----------------------------------------------------------------------
diff --git a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManager.java
b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManager.java
index 2c3e438..a1b9714 100644
--- a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManager.java
+++ b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManager.java
@@ -16,14 +16,13 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
 package org.apache.cayenne.configuration.osgi;
 
+import java.util.Map;
+
 import org.apache.cayenne.di.ClassLoaderManager;
 import org.apache.cayenne.di.Injector;
 
-import java.util.Map;
-
 /**
  * @since 4.0
  */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModule.java
----------------------------------------------------------------------
diff --git a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModule.java
b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModule.java
index 99dbf2f..7b1a602 100644
--- a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModule.java
+++ b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModule.java
@@ -16,17 +16,16 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
 package org.apache.cayenne.configuration.osgi;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.ClassLoaderManager;
 import org.apache.cayenne.di.Module;
 
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * A DI module that helps to bootstrap Cayenne in OSGi environment.
  * 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
----------------------------------------------------------------------
diff --git a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
index 4854461..481f220 100644
--- a/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
+++ b/cayenne-osgi/src/main/java/org/apache/cayenne/configuration/osgi/OsgiModuleBuilder.java
@@ -16,13 +16,12 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
 package org.apache.cayenne.configuration.osgi;
 
-import org.apache.cayenne.di.Module;
-
 import java.sql.Driver;
 
+import org.apache.cayenne.di.Module;
+
 /**
  * A builder of a DI module that helps to bootstrap Cayenne in OSGi environment.
  * 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-osgi/src/test/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManagerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-osgi/src/test/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManagerTest.java
b/cayenne-osgi/src/test/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManagerTest.java
index 27ba313..bf06086 100644
--- a/cayenne-osgi/src/test/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManagerTest.java
+++ b/cayenne-osgi/src/test/java/org/apache/cayenne/configuration/osgi/OsgiClassLoaderManagerTest.java
@@ -16,23 +16,23 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-
 package org.apache.cayenne.configuration.osgi;
 
-import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.Mockito;
 
 import java.util.Collections;
 
+import static org.junit.Assert.assertSame;
+import static org.mockito.Mockito.mock;
+
 public class OsgiClassLoaderManagerTest {
 
     @Test
     public void testGetClassLoader() {
 
-        final ClassLoader appCl = Mockito.mock(ClassLoader.class);
-        final ClassLoader diCl = Mockito.mock(ClassLoader.class);
-        final ClassLoader serverCl = Mockito.mock(ClassLoader.class);
+        final ClassLoader appCl = mock(ClassLoader.class);
+        final ClassLoader diCl = mock(ClassLoader.class);
+        final ClassLoader serverCl = mock(ClassLoader.class);
 
         OsgiClassLoaderManager manager = new OsgiClassLoaderManager(appCl, Collections.<String,
ClassLoader> emptyMap()) {
             @Override
@@ -46,13 +46,13 @@ public class OsgiClassLoaderManagerTest {
             }
         };
 
-        Assert.assertSame(appCl, manager.getClassLoader(null));
-        Assert.assertSame(appCl, manager.getClassLoader(""));
-        Assert.assertSame(appCl, manager.getClassLoader("org/example/test"));
-        Assert.assertSame(appCl, manager.getClassLoader("/org/example/test"));
-        Assert.assertSame(serverCl, manager.getClassLoader("/org/apache/cayenne/access/DataContext.class"));
-        Assert.assertSame(diCl, manager.getClassLoader("/org/apache/cayenne/di/Injector.class"));
-        Assert.assertSame(diCl, manager.getClassLoader("org/apache/cayenne/di/Injector.class"));
+        assertSame(appCl, manager.getClassLoader(null));
+        assertSame(appCl, manager.getClassLoader(""));
+        assertSame(appCl, manager.getClassLoader("org/example/test"));
+        assertSame(appCl, manager.getClassLoader("/org/example/test"));
+        assertSame(serverCl, manager.getClassLoader("/org/apache/cayenne/access/DataContext.class"));
+        assertSame(diCl, manager.getClassLoader("/org/apache/cayenne/di/Injector.class"));
+        assertSame(diCl, manager.getClassLoader("org/apache/cayenne/di/Injector.class"));
 
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-rop-server/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/pom.xml b/cayenne-rop-server/pom.xml
index a54afcb..eddbef1 100644
--- a/cayenne-rop-server/pom.xml
+++ b/cayenne-rop-server/pom.xml
@@ -28,7 +28,6 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
-            <version>RELEASE</version>
         </dependency>
         <dependency>
             <groupId>org.apache.cayenne</groupId>
@@ -68,6 +67,7 @@
         <dependency>
             <groupId>com.mockrunner</groupId>
             <artifactId>mockrunner-servlet</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-rop-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
----------------------------------------------------------------------
diff --git a/cayenne-rop-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
b/cayenne-rop-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
index b8e2d32..43d52fb 100644
--- a/cayenne-rop-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
+++ b/cayenne-rop-server/src/test/java/org/apache/cayenne/configuration/rop/server/ROPServletTest.java
@@ -23,7 +23,9 @@ 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.*;
+import org.apache.cayenne.configuration.web.RequestHandler;
+import org.apache.cayenne.configuration.web.WebModule;
+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;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/CayenneFilter.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/CayenneFilter.java
b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/CayenneFilter.java
index 3aab772..c4c3ab9 100644
--- a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/CayenneFilter.java
+++ b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/CayenneFilter.java
@@ -23,7 +23,13 @@ import org.apache.cayenne.configuration.server.ServerModule;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.di.Module;
 
-import javax.servlet.*;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/SessionContextRequestHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/SessionContextRequestHandler.java
b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/SessionContextRequestHandler.java
index ea696c6..cf26fc9 100644
--- a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/SessionContextRequestHandler.java
+++ b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/SessionContextRequestHandler.java
@@ -18,6 +18,11 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
 import org.apache.cayenne.BaseContext;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.configuration.CayenneRuntime;
@@ -25,11 +30,6 @@ import org.apache.cayenne.configuration.ObjectContextFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
 
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
 /**
  * Default implementation of the {@link RequestHandler} that stores per-user
  * {@link ObjectContext} in a web session and binds it to request thread. Note that using

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java
b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java
index ea1b33d..0e7651e 100644
--- a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java
+++ b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/StatelessContextRequestHandler.java
@@ -18,15 +18,16 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
 import org.apache.cayenne.BaseContext;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.configuration.CayenneRuntime;
 import org.apache.cayenne.configuration.ObjectContextFactory;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.di.Injector;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import org.apache.cayenne.di.Module;
 
 /**
  * <p>Stateless implementation of {@link RequestHandler} that creates a new

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebConfiguration.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebConfiguration.java
b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebConfiguration.java
index 6b2efbc..f349ac7 100644
--- a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebConfiguration.java
+++ b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebConfiguration.java
@@ -25,7 +25,15 @@ import javax.servlet.FilterConfig;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
 
 /**
  * A class that provides access to common Cayenne web configuration parameters retrieved

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebUtil.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebUtil.java b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebUtil.java
index 9dace8d..dfeb3c4 100644
--- a/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebUtil.java
+++ b/cayenne-web/src/main/java/org/apache/cayenne/configuration/web/WebUtil.java
@@ -18,10 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import org.apache.cayenne.configuration.CayenneRuntime;
-
 import javax.servlet.ServletContext;
 
+import org.apache.cayenne.configuration.CayenneRuntime;
+
 /**
  * A helper class to retrieve and store {@link CayenneRuntime} in the
  * {@link ServletContext}. All Cayenne web configuration objects, such as

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/cayenne-web/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
----------------------------------------------------------------------
diff --git a/cayenne-web/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
b/cayenne-web/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
index c4e5163..3c7df86 100644
--- a/cayenne-web/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
+++ b/cayenne-web/src/test/java/org/apache/cayenne/configuration/web/CayenneFilterTest.java
@@ -18,7 +18,11 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.web;
 
-import com.mockrunner.mock.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;
@@ -30,7 +34,10 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
-import static org.junit.Assert.*;
+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 {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/e2e2684f/tutorials/tutorial/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/tutorials/tutorial/src/main/webapp/WEB-INF/web.xml b/tutorials/tutorial/src/main/webapp/WEB-INF/web.xml
index 4a5778a..eabc196 100644
--- a/tutorials/tutorial/src/main/webapp/WEB-INF/web.xml
+++ b/tutorials/tutorial/src/main/webapp/WEB-INF/web.xml
@@ -29,7 +29,7 @@
 	-->
 	<filter>
 		<filter-name>cayenne-project</filter-name>
-		<filter-class>org.apache.cayenne.web.CayenneFilter</filter-class>
+		<filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
 	</filter>
 	<filter-mapping>
 		<filter-name>cayenne-project</filter-name>


Mime
View raw message