Author: veithen
Date: Thu Dec 28 01:10:35 2017
New Revision: 1819384
URL: http://svn.apache.org/viewvc?rev=1819384&view=rev
Log:
Some minor refactorings.
Added:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/TestUtils.java
- copied, changed from r1819383,
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/AbstractTestCase.java
Removed:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/AbstractTestCase.java
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/AsyncExecutorTests.java
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java?rev=1819384&r1=1819383&r2=1819384&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java
Thu Dec 28 01:10:35 2017
@@ -20,7 +20,6 @@
package org.apache.axis2.jaxws.dispatch;
import org.apache.axis2.jaxws.TestLogger;
-import org.apache.axis2.jaxws.framework.AbstractTestCase;
import org.apache.axis2.testutils.Axis2Server;
import org.apache.axis2.testutils.Junit4ClassRunnerWithRuntimeIgnore;
import org.junit.ClassRule;
@@ -33,6 +32,7 @@ import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
+import static org.apache.axis2.jaxws.framework.TestUtils.checkUnknownHostURL;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -42,7 +42,7 @@ import java.util.concurrent.ExecutionExc
import java.util.concurrent.Future;
@RunWith(Junit4ClassRunnerWithRuntimeIgnore.class)
-public class StringDispatchTests extends AbstractTestCase {
+public class StringDispatchTests {
@ClassRule
public static final Axis2Server server = new Axis2Server("target/repo");
Copied:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/TestUtils.java
(from r1819383,
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/AbstractTestCase.java)
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/TestUtils.java?p2=axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/TestUtils.java&p1=axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/AbstractTestCase.java&r1=1819383&r2=1819384&rev=1819384&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/AbstractTestCase.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/framework/TestUtils.java
Thu Dec 28 01:10:35 2017
@@ -26,7 +26,9 @@ import java.net.UnknownHostException;
import org.apache.axis2.testutils.RuntimeIgnoreException;
-public class AbstractTestCase {
+public final class TestUtils {
+ private TestUtils() {}
+
/**
* Check that the given URL refers to an unknown host. More precisely,
this method checks that
* the DNS resolver will not be able to resolve the host name. If the
expectation is not met,
@@ -41,7 +43,7 @@ public class AbstractTestCase {
* @param url
* @throws MalformedURLException
*/
- protected static void checkUnknownHostURL(String url) throws
MalformedURLException {
+ public static void checkUnknownHostURL(String url) throws
MalformedURLException {
String host = new URL(url).getHost();
InetAddress addr;
try {
@@ -52,4 +54,20 @@ public class AbstractTestCase {
}
throw new RuntimeIgnoreException(host + " resolves to " +
addr.getHostAddress() + "; skipping test case");
}
+
+ public static void withRetry(Runnable runnable) throws
InterruptedException {
+ int retries = 0;
+ while (true) {
+ try {
+ runnable.run();
+ return;
+ } catch (AssertionError ex) {
+ if (retries++ > 60) {
+ throw ex;
+ } else {
+ Thread.sleep(500);
+ }
+ }
+ }
+ }
}
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/AsyncExecutorTests.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/AsyncExecutorTests.java?rev=1819384&r1=1819383&r2=1819384&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/AsyncExecutorTests.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/AsyncExecutorTests.java
Thu Dec 28 01:10:35 2017
@@ -32,6 +32,7 @@ import org.test.parallelasync.SleepRespo
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Response;
+import static org.apache.axis2.jaxws.framework.TestUtils.withRetry;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -349,22 +350,6 @@ public class AsyncExecutorTests {
}
}
- static void withRetry(Runnable runnable) throws InterruptedException {
- int retries = 0;
- while (true) {
- try {
- runnable.run();
- return;
- } catch (AssertionError ex) {
- if (retries++ > 60) {
- throw ex;
- } else {
- Thread.sleep(500);
- }
- }
- }
- }
-
/**
* Thread that verifies the request sent by a different thread was
recieved by the service and
* then verify the response. Another thread will have previously sent the
request. Note that
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java?rev=1819384&r1=1819383&r2=1819384&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java
Thu Dec 28 01:10:35 2017
@@ -23,7 +23,6 @@
package org.apache.axis2.jaxws.sample;
import org.apache.axis2.jaxws.TestLogger;
-import org.apache.axis2.jaxws.framework.AbstractTestCase;
import org.apache.axis2.jaxws.sample.faults.FaultyWebServiceFault_Exception;
import org.apache.axis2.jaxws.sample.faults.FaultyWebServicePortType;
import org.apache.axis2.jaxws.sample.faults.FaultyWebServiceService;
@@ -42,6 +41,7 @@ import javax.xml.ws.Response;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.SOAPFaultException;
+import static org.apache.axis2.jaxws.framework.TestUtils.checkUnknownHostURL;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -52,7 +52,7 @@ import java.util.concurrent.ExecutionExc
import java.util.concurrent.Future;
@RunWith(Junit4ClassRunnerWithRuntimeIgnore.class)
-public class FaultyWebServiceTests extends AbstractTestCase {
+public class FaultyWebServiceTests {
@ClassRule
public static final Axis2Server server = new Axis2Server("target/repo");
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java?rev=1819384&r1=1819383&r2=1819384&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java
Thu Dec 28 01:10:35 2017
@@ -18,6 +18,7 @@
*/
package org.apache.axis2.jaxws.sample;
+import static org.apache.axis2.jaxws.framework.TestUtils.checkUnknownHostURL;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -38,7 +39,6 @@ import javax.xml.ws.soap.SOAPFaultExcept
import org.apache.axis2.addressing.AddressingConstants;
import org.apache.axis2.deployment.FileSystemConfigurator;
import org.apache.axis2.jaxws.ClientConfigurationFactory;
-import org.apache.axis2.jaxws.framework.AbstractTestCase;
import org.apache.axis2.jaxws.sample.asyncdoclit.client.AsyncClient;
import org.apache.axis2.jaxws.sample.asyncdoclit.client.AsyncPort;
import org.apache.axis2.jaxws.sample.asyncdoclit.client.AsyncService;
@@ -57,7 +57,7 @@ import org.test.asyncdoclit.ThrowExcepti
* Test for varios async exceptions whern AsyncMEP is enabled
*/
@RunWith(Junit4ClassRunnerWithRuntimeIgnore.class)
-public class RuntimeExceptionsAsyncMepTest extends AbstractTestCase {
+public class RuntimeExceptionsAsyncMepTest {
@ClassRule
public static final Axis2Server server = new
Axis2Server("target/addressing-repo");