You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2017/08/04 16:07:33 UTC
[10/12] cxf git commit: Fix warnings in testutils
Fix warnings in testutils
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8f1d4751
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8f1d4751
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8f1d4751
Branch: refs/heads/master
Commit: 8f1d4751b3ed127584b4112b3bcd6d6096b4b012
Parents: aaa4010
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Aug 4 10:40:19 2017 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Aug 4 10:40:44 2017 -0400
----------------------------------------------------------------------
.../greeter_control/AbstractGreeterImpl.java | 3 +--
.../jaxb_element_test/JaxbElementTestImpl.java | 3 +--
.../java/org/apache/cxf/test/XPathAssert.java | 28 +++++++++-----------
.../cxf/testutil/common/ServerLauncher.java | 19 +++++++------
.../AnnotatedGreeterImpl.java | 5 ++--
.../AnnotatedGreeterNoOverloadImpl.java | 5 ++--
.../AnotherDerivedGreeterImpl.java | 5 ++--
.../DerivedGreeterImpl.java | 5 ++--
.../RPCLitGreeterImpl.java | 3 +--
9 files changed, 33 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java b/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
index f8b8085..e311449 100644
--- a/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/greeter_control/AbstractGreeterImpl.java
@@ -110,9 +110,8 @@ public class AbstractGreeterImpl implements Greeter {
fd.setMajor((short)2);
fd.setMinor((short)1);
throw new PingMeFault("Pings succeed only every other time.", fd);
- } else {
- LOG.fine("Executing operation pingMe");
}
+ LOG.fine("Executing operation pingMe");
}
public Response<PingMeResponse> pingMeAsync() {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java b/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java
index 2bc0e39..b840df0 100644
--- a/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java
+++ b/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java
@@ -31,8 +31,7 @@ public class JaxbElementTestImpl implements JaxbElementTest {
public String newOperation(String in) {
if (in == null) {
return "in=null";
- } else {
- return "in=" + in;
}
+ return "in=" + in;
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java b/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
index 5284c3e..0d448f1 100644
--- a/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
+++ b/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
@@ -137,13 +137,12 @@ public final class XPathAssert {
String value2 = DOMUtils.getContent(result);
Assert.assertEquals(value, value2);
return;
- } else {
- o = createXPath(namespaces).compile(xpath)
- .evaluate(node, XPathConstants.STRING);
- if (o instanceof String) {
- Assert.assertEquals(value, (String)o);
- return;
- }
+ }
+ o = createXPath(namespaces).compile(xpath)
+ .evaluate(node, XPathConstants.STRING);
+ if (o instanceof String) {
+ Assert.assertEquals(value, o);
+ return;
}
throw new AssertionFailedError("No nodes were found for expression: "
+ xpath
@@ -172,14 +171,13 @@ public final class XPathAssert {
QName q2 = DOMUtils.createQName(value2, result);
Assert.assertEquals(value, q2);
return;
- } else {
- o = createXPath(namespaces).compile(xpath)
- .evaluate(node, XPathConstants.STRING);
- if (o instanceof String) {
- QName q2 = DOMUtils.createQName(o.toString(), node);
- Assert.assertEquals(value, q2);
- return;
- }
+ }
+ o = createXPath(namespaces).compile(xpath)
+ .evaluate(node, XPathConstants.STRING);
+ if (o instanceof String) {
+ QName q2 = DOMUtils.createQName(o.toString(), node);
+ Assert.assertEquals(value, q2);
+ return;
}
throw new AssertionFailedError("No nodes were found for expression: "
+ xpath
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java b/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
index 6996432..ed2f0bf 100644
--- a/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
+++ b/testutils/src/main/java/org/apache/cxf/testutil/common/ServerLauncher.java
@@ -147,18 +147,17 @@ public class ServerLauncher {
ex.printStackTrace();
throw new IOException(ex.getMessage());
}
- } else {
- if (process != null) {
- if (!serverIsStopped) {
- try {
- signalStop();
- } catch (IOException ex) {
- //ignore
- }
+ }
+ if (process != null) {
+ if (!serverIsStopped) {
+ try {
+ signalStop();
+ } catch (IOException ex) {
+ //ignore
}
- waitForServerToStop();
- process.destroy();
}
+ waitForServerToStop();
+ process.destroy();
}
return serverPassed;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterImpl.java b/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterImpl.java
index 0c8e175..a992f25 100644
--- a/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterImpl.java
+++ b/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterImpl.java
@@ -56,10 +56,9 @@ public class AnnotatedGreeterImpl {
public int getInvocationCount(String method) {
if (invocationCount.containsKey(method)) {
return invocationCount.get(method).intValue();
- } else {
- System.out.println("No invocation count for method: " + method);
- return 0;
}
+ System.out.println("No invocation count for method: " + method);
+ return 0;
}
/**
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterNoOverloadImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterNoOverloadImpl.java b/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterNoOverloadImpl.java
index 3687388..8df14b3 100644
--- a/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterNoOverloadImpl.java
+++ b/testutils/src/main/java/org/apache/hello_world_soap_http/AnnotatedGreeterNoOverloadImpl.java
@@ -56,10 +56,9 @@ public class AnnotatedGreeterNoOverloadImpl {
public int getInvocationCount(String method) {
if (invocationCount.containsKey(method)) {
return invocationCount.get(method).intValue();
- } else {
- System.out.println("No invocation count for method: " + method);
- return 0;
}
+ System.out.println("No invocation count for method: " + method);
+ return 0;
}
@WebMethod
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java b/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
index 1e25685..0c97383 100644
--- a/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
+++ b/testutils/src/main/java/org/apache/hello_world_soap_http/AnotherDerivedGreeterImpl.java
@@ -56,10 +56,9 @@ public class AnotherDerivedGreeterImpl implements GreeterEndpointInterface {
public int getInvocationCount(String method) {
if (invocationCount.containsKey(method)) {
return invocationCount.get(method).intValue();
- } else {
- System.out.println("No invocation count for method: " + method);
- return 0;
}
+ System.out.println("No invocation count for method: " + method);
+ return 0;
}
/**
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java b/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
index 32e3fc9..b5ff92c 100644
--- a/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
+++ b/testutils/src/main/java/org/apache/hello_world_soap_http/DerivedGreeterImpl.java
@@ -56,10 +56,9 @@ public class DerivedGreeterImpl implements Greeter {
public int getInvocationCount(String method) {
if (invocationCount.containsKey(method)) {
return invocationCount.get(method).intValue();
- } else {
- System.out.println("No invocation count for method: " + method);
- return 0;
}
+ System.out.println("No invocation count for method: " + method);
+ return 0;
}
/**
http://git-wip-us.apache.org/repos/asf/cxf/blob/8f1d4751/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
----------------------------------------------------------------------
diff --git a/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java b/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
index 7f0e7de..2fb81a1 100644
--- a/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
+++ b/testutils/src/main/java/org/apache/hello_world_soap_http/RPCLitGreeterImpl.java
@@ -39,9 +39,8 @@ public class RPCLitGreeterImpl implements GreeterRPCLit {
//System.out.println("Message received: " + me + "\n");
if ("return null".equals(me)) {
return null;
- } else {
- return "Hello " + me;
}
+ return "Hello " + me;
}
public String sayHi() {