cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Adding a dedicated ClientTest
Date Thu, 03 Mar 2016 11:05:00 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes e57a1be54 -> daf19cc33


Adding a dedicated ClientTest


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

Branch: refs/heads/3.1.x-fixes
Commit: daf19cc33f77e2b4ddd2e2b583926be189b84abb
Parents: e57a1be
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Mar 3 11:03:06 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Mar 3 11:04:43 2016 +0000

----------------------------------------------------------------------
 .../cxf/jaxrs/client/cache/ClientCacheTest.java | 15 -------
 .../cxf/jaxrs/client/cache/ClientTest.java      | 46 ++++++++++++++++++++
 2 files changed, 46 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/daf19cc3/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientCacheTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientCacheTest.java
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientCacheTest.java
index bbe6f7c..3f59cc1 100644
--- a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientCacheTest.java
+++ b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientCacheTest.java
@@ -21,12 +21,10 @@ package org.apache.cxf.jaxrs.client.cache;
 
 import java.io.InputStream;
 import java.io.Serializable;
-import java.util.HashMap;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.Invocation;
 import javax.ws.rs.client.WebTarget;
@@ -160,19 +158,6 @@ public class ClientCacheTest extends Assert {
             feature.close();
         }    
     }
-
-    @Test
-    public void testClientClosed() {
-        Client client = ClientBuilder.newClient();        
-        try {
-            WebTarget target = client.target(ADDRESS);
-            client.close();
-            target.resolveTemplatesFromEncoded(new HashMap<String, Object>());
-            fail("IllegalStateException is expected");
-        } catch (java.lang.IllegalStateException e) {
-            assertTrue(e.getMessage().contains("client is closed"));
-        }
-    } 
     
     
     private static Invocation.Builder setAsLocal(final Invocation.Builder client) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/daf19cc3/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientTest.java
b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientTest.java
new file mode 100644
index 0000000..1d20da1
--- /dev/null
+++ b/rt/rs/client/src/test/java/org/apache/cxf/jaxrs/client/cache/ClientTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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.cxf.jaxrs.client.cache;
+
+
+import java.util.HashMap;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class ClientTest extends Assert {
+    public static final String ADDRESS = "local://transport";
+
+    @Test
+    public void testClientClosed() {
+        Client client = ClientBuilder.newClient();        
+        try {
+            WebTarget target = client.target(ADDRESS);
+            client.close();
+            target.resolveTemplatesFromEncoded(new HashMap<String, Object>());
+            fail("IllegalStateException is expected");
+        } catch (java.lang.IllegalStateException e) {
+            assertTrue(e.getMessage().contains("client is closed"));
+        }
+    } 
+}


Mime
View raw message