cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6132] Getting the tests ignored if Java 6 is used
Date Wed, 11 Feb 2015 12:47:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes c15bc1bba -> 5fffe1882


[CXF-6132] Getting the tests ignored if Java 6 is used


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

Branch: refs/heads/3.0.x-fixes
Commit: 5fffe18823f05d62287857dc3cb8202df4a10e7f
Parents: c15bc1b
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Feb 11 12:46:48 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Feb 11 12:46:48 2015 +0000

----------------------------------------------------------------------
 .../cxf/jaxrs/servlet/AbstractSciTest.java       | 19 +++++++++++++++++++
 .../servlet/jetty/JettyEmptyApplicationTest.java |  6 ++----
 .../jetty/JettyEmptyPathApplicationTest.java     |  6 ++----
 .../servlet/jetty/JettyNoApplicationTest.java    |  6 ++----
 .../JettySingleApplicationOnlyClassesTest.java   |  6 ++----
 ...JettySingleApplicationOnlySingletonsTest.java |  6 ++----
 .../jetty/JettySingleApplicationTest.java        |  6 ++----
 7 files changed, 31 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/AbstractSciTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/AbstractSciTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/AbstractSciTest.java
index e67f933..2faba61 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/AbstractSciTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/AbstractSciTest.java
@@ -28,14 +28,33 @@ import javax.ws.rs.core.Response.Status;
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
 import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.demo.resources.Book;
+
 import org.junit.Test;
 
 
 public abstract class AbstractSciTest extends AbstractBusClientServerTestBase {
+    public static final Boolean JAVA6_ACTIVE = isJava6();
+    
+    private static boolean isJava6() {
+        String version = System.getProperty("java.version");
+        return 1.6D == Double.parseDouble(version.substring(0, 3));    
+    }
+    protected static void startServers(Class<?> serverClass) throws Exception {
+        if (AbstractSciTest.JAVA6_ACTIVE) {
+            return;
+        }
+        AbstractResourceInfo.clearAllMaps();
+        assertTrue("server did not launch correctly", launchServer(serverClass, true));
+        createStaticBus();
+    }
     @Test
     public void testResponseHasBeenReceivedWhenQueringBook() {
+        if (AbstractSciTest.JAVA6_ACTIVE) {
+            return;
+        }
         Response r = createWebClient("/bookstore/books").path("1").get();
         assertEquals(Status.OK.getStatusCode(), r.getStatus());
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java
index af8a5be..aa4702d 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java
@@ -21,9 +21,9 @@ package org.apache.cxf.jaxrs.servlet.jetty;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -47,9 +47,7 @@ public class JettyEmptyApplicationTest extends AbstractSciTest {
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyPathApplicationTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyPathApplicationTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyPathApplicationTest.java
index 0318bd8..de8dbc6 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyPathApplicationTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyPathApplicationTest.java
@@ -21,10 +21,10 @@ package org.apache.cxf.jaxrs.servlet.jetty;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
 import org.eclipse.jetty.webapp.WebAppContext;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -54,9 +54,7 @@ public class JettyEmptyPathApplicationTest extends AbstractSciTest {
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyNoApplicationTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyNoApplicationTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyNoApplicationTest.java
index 129f7ce..b07c47b 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyNoApplicationTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyNoApplicationTest.java
@@ -21,10 +21,10 @@ package org.apache.cxf.jaxrs.servlet.jetty;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
 import org.eclipse.jetty.webapp.WebAppContext;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -51,9 +51,7 @@ public class JettyNoApplicationTest extends AbstractSciTest {
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlyClassesTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlyClassesTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlyClassesTest.java
index 6953de6..dd35e06 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlyClassesTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlyClassesTest.java
@@ -19,9 +19,9 @@
 
 package org.apache.cxf.jaxrs.servlet.jetty;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -43,9 +43,7 @@ public class JettySingleApplicationOnlyClassesTest extends AbstractSciTest
{
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlySingletonsTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlySingletonsTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlySingletonsTest.java
index cdffd3a..e4f4fba 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlySingletonsTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationOnlySingletonsTest.java
@@ -19,9 +19,9 @@
 
 package org.apache.cxf.jaxrs.servlet.jetty;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -43,9 +43,7 @@ public class JettySingleApplicationOnlySingletonsTest extends AbstractSciTest
{
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/5fffe188/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationTest.java
----------------------------------------------------------------------
diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationTest.java
b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationTest.java
index 2bc02e3..bc22673 100644
--- a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationTest.java
+++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettySingleApplicationTest.java
@@ -19,9 +19,9 @@
 
 package org.apache.cxf.jaxrs.servlet.jetty;
 
-import org.apache.cxf.jaxrs.model.AbstractResourceInfo;
 import org.apache.cxf.jaxrs.servlet.AbstractSciTest;
 import org.eclipse.jetty.util.resource.Resource;
+
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 
@@ -43,9 +43,7 @@ public class JettySingleApplicationTest extends AbstractSciTest {
     
     @BeforeClass
     public static void startServers() throws Exception {
-        AbstractResourceInfo.clearAllMaps();
-        assertTrue("server did not launch correctly", launchServer(EmbeddedJettyServer.class,
true));
-        createStaticBus();
+        startServers(EmbeddedJettyServer.class);
     }
     
     @Override


Mime
View raw message