File tree Expand file tree Collapse file tree
modules/jaxws-integration/src/test/java/org/apache/axis2/jaxws Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020package org .apache .axis2 .jaxws .dispatch ;
2121
2222import org .apache .axis2 .jaxws .TestLogger ;
23- import org .apache .axis2 .jaxws .framework .AbstractTestCase ;
2423import org .apache .axis2 .testutils .Axis2Server ;
2524import org .apache .axis2 .testutils .Junit4ClassRunnerWithRuntimeIgnore ;
2625import org .junit .ClassRule ;
3332import javax .xml .ws .Service ;
3433import javax .xml .ws .WebServiceException ;
3534
35+ import static org .apache .axis2 .jaxws .framework .TestUtils .checkUnknownHostURL ;
3636import static org .junit .Assert .assertNotNull ;
3737import static org .junit .Assert .assertTrue ;
3838import static org .junit .Assert .fail ;
4242import java .util .concurrent .Future ;
4343
4444@ RunWith (Junit4ClassRunnerWithRuntimeIgnore .class )
45- public class StringDispatchTests extends AbstractTestCase {
45+ public class StringDispatchTests {
4646 @ ClassRule
4747 public static final Axis2Server server = new Axis2Server ("target/repo" );
4848
Original file line number Diff line number Diff line change 2626
2727import org .apache .axis2 .testutils .RuntimeIgnoreException ;
2828
29- public class AbstractTestCase {
29+ public final class TestUtils {
30+ private TestUtils () {}
31+
3032 /**
3133 * Check that the given URL refers to an unknown host. More precisely, this method checks that
3234 * 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 {
4143 * @param url
4244 * @throws MalformedURLException
4345 */
44- protected static void checkUnknownHostURL (String url ) throws MalformedURLException {
46+ public static void checkUnknownHostURL (String url ) throws MalformedURLException {
4547 String host = new URL (url ).getHost ();
4648 InetAddress addr ;
4749 try {
@@ -52,4 +54,20 @@ protected static void checkUnknownHostURL(String url) throws MalformedURLExcepti
5254 }
5355 throw new RuntimeIgnoreException (host + " resolves to " + addr .getHostAddress () + "; skipping test case" );
5456 }
57+
58+ public static void withRetry (Runnable runnable ) throws InterruptedException {
59+ int retries = 0 ;
60+ while (true ) {
61+ try {
62+ runnable .run ();
63+ return ;
64+ } catch (AssertionError ex ) {
65+ if (retries ++ > 60 ) {
66+ throw ex ;
67+ } else {
68+ Thread .sleep (500 );
69+ }
70+ }
71+ }
72+ }
5573}
Original file line number Diff line number Diff line change 3232import javax .xml .ws .BindingProvider ;
3333import javax .xml .ws .Response ;
3434
35+ import static org .apache .axis2 .jaxws .framework .TestUtils .withRetry ;
3536import static org .junit .Assert .assertEquals ;
3637import static org .junit .Assert .assertNotNull ;
3738import static org .junit .Assert .assertNull ;
@@ -349,22 +350,6 @@ public void sendClientRequest() throws Exception {
349350 }
350351 }
351352
352- static void withRetry (Runnable runnable ) throws InterruptedException {
353- int retries = 0 ;
354- while (true ) {
355- try {
356- runnable .run ();
357- return ;
358- } catch (AssertionError ex ) {
359- if (retries ++ > 60 ) {
360- throw ex ;
361- } else {
362- Thread .sleep (500 );
363- }
364- }
365- }
366- }
367-
368353 /**
369354 * Thread that verifies the request sent by a different thread was recieved by the service and
370355 * then verify the response. Another thread will have previously sent the request. Note that
Original file line number Diff line number Diff line change 2323package org .apache .axis2 .jaxws .sample ;
2424
2525import org .apache .axis2 .jaxws .TestLogger ;
26- import org .apache .axis2 .jaxws .framework .AbstractTestCase ;
2726import org .apache .axis2 .jaxws .sample .faults .FaultyWebServiceFault_Exception ;
2827import org .apache .axis2 .jaxws .sample .faults .FaultyWebServicePortType ;
2928import org .apache .axis2 .jaxws .sample .faults .FaultyWebServiceService ;
4241import javax .xml .ws .WebServiceException ;
4342import javax .xml .ws .soap .SOAPFaultException ;
4443
44+ import static org .apache .axis2 .jaxws .framework .TestUtils .checkUnknownHostURL ;
4545import static org .junit .Assert .assertEquals ;
4646import static org .junit .Assert .assertNotNull ;
4747import static org .junit .Assert .assertTrue ;
5252import java .util .concurrent .Future ;
5353
5454@ RunWith (Junit4ClassRunnerWithRuntimeIgnore .class )
55- public class FaultyWebServiceTests extends AbstractTestCase {
55+ public class FaultyWebServiceTests {
5656 @ ClassRule
5757 public static final Axis2Server server = new Axis2Server ("target/repo" );
5858
Original file line number Diff line number Diff line change 1818 */
1919package org .apache .axis2 .jaxws .sample ;
2020
21+ import static org .apache .axis2 .jaxws .framework .TestUtils .checkUnknownHostURL ;
2122import static org .junit .Assert .assertNotNull ;
2223import static org .junit .Assert .assertTrue ;
2324import static org .junit .Assert .fail ;
3839import org .apache .axis2 .addressing .AddressingConstants ;
3940import org .apache .axis2 .deployment .FileSystemConfigurator ;
4041import org .apache .axis2 .jaxws .ClientConfigurationFactory ;
41- import org .apache .axis2 .jaxws .framework .AbstractTestCase ;
4242import org .apache .axis2 .jaxws .sample .asyncdoclit .client .AsyncClient ;
4343import org .apache .axis2 .jaxws .sample .asyncdoclit .client .AsyncPort ;
4444import org .apache .axis2 .jaxws .sample .asyncdoclit .client .AsyncService ;
5757 * Test for varios async exceptions whern AsyncMEP is enabled
5858 */
5959@ RunWith (Junit4ClassRunnerWithRuntimeIgnore .class )
60- public class RuntimeExceptionsAsyncMepTest extends AbstractTestCase {
60+ public class RuntimeExceptionsAsyncMepTest {
6161 @ ClassRule
6262 public static final Axis2Server server = new Axis2Server ("target/addressing-repo" );
6363
You can’t perform that action at this time.
0 commit comments