You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/03/03 12:03:23 UTC
cxf git commit: Adding a dedicated ClientTest
Repository: cxf
Updated Branches:
refs/heads/master 365a1fd7d -> 3770d8125
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/3770d812
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3770d812
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3770d812
Branch: refs/heads/master
Commit: 3770d812578513a3135b08a4ea44b001aa7eeb47
Parents: 365a1fd
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Thu Mar 3 11:03:06 2016 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Thu Mar 3 11:03:06 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/3770d812/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/3770d812/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"));
+ }
+ }
+}