Author: veithen Date: Thu Dec 23 11:07:19 2010 New Revision: 1052223 URL: http://svn.apache.org/viewvc?rev=1052223&view=rev Log: Attempt to fix the build failures seen on one of the Ubuntu executors (which are caused by an unusual DNS setup).
Added: axis/axis2/java/core/trunk/modules/testutils/ axis/axis2/java/core/trunk/modules/testutils/pom.xml (with props) axis/axis2/java/core/trunk/modules/testutils/src/ axis/axis2/java/core/trunk/modules/testutils/src/main/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java (with props) axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java (with props) axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java (with props) axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java (with props) axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java (with props) Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/framework/AbstractTestCase.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java axis/axis2/java/core/trunk/pom.xml Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml Thu Dec 23 11:07:19 2010 @@ -81,6 +81,12 @@ <version>${project.version}</version> </dependency> <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-testutils</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <scope>test</scope> Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/StringDispatchTests.java Thu Dec 23 11:07:19 2010 @@ -23,6 +23,8 @@ import junit.framework.Test; import junit.framework.TestSuite; import org.apache.axis2.jaxws.TestLogger; import org.apache.axis2.jaxws.framework.AbstractTestCase; +import org.apache.axis2.testutils.AllTestsWithRuntimeIgnore; +import org.junit.runner.RunWith; import javax.xml.ws.Dispatch; import javax.xml.ws.ProtocolException; @@ -30,12 +32,11 @@ import javax.xml.ws.Response; import javax.xml.ws.Service; import javax.xml.ws.WebServiceException; -import java.net.InetAddress; -import java.net.URL; import java.net.UnknownHostException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +...@runwith(AllTestsWithRuntimeIgnore.class) public class StringDispatchTests extends AbstractTestCase { @@ -435,14 +436,7 @@ public class StringDispatchTests extends public void testSyncPayloadMode_badHostName() throws Exception { - String host = new URL(DispatchTestConstants.BADURL).getHost(); - try { - InetAddress addr = InetAddress.getByName(host); - System.out.println(host + " resolves to " + addr.getHostAddress() + "; skipping test case"); - return; - } catch (UnknownHostException ex) { - // This is what we expect - } + checkUnknownHostURL(DispatchTestConstants.BADURL); TestLogger.logger.debug("---------------------------------------"); TestLogger.logger.debug("test: " + getName()); @@ -481,6 +475,8 @@ public class StringDispatchTests extends } public void testAsyncCallbackMessageMode_badHostName() throws Exception { + checkUnknownHostURL(DispatchTestConstants.BADURL); + TestLogger.logger.debug("---------------------------------------"); TestLogger.logger.debug("test: " + getName()); @@ -549,6 +545,8 @@ public class StringDispatchTests extends } public void testAsyncPollingPayloadMode_badHostName() throws Exception { + checkUnknownHostURL(DispatchTestConstants.BADURL); + TestLogger.logger.debug("---------------------------------------"); TestLogger.logger.debug("test: " + getName()); Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/framework/AbstractTestCase.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/framework/AbstractTestCase.java?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/framework/AbstractTestCase.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/framework/AbstractTestCase.java Thu Dec 23 11:07:19 2010 @@ -19,10 +19,17 @@ package org.apache.axis2.jaxws.framework; +import java.net.InetAddress; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.UnknownHostException; + import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestCase; import org.apache.axis2.jaxws.TestLogger; +import org.apache.axis2.jaxws.dispatch.DispatchTestConstants; +import org.apache.axis2.testutils.RuntimeIgnoreException; import org.apache.log4j.BasicConfigurator; public class AbstractTestCase extends TestCase { @@ -69,4 +76,30 @@ public class AbstractTestCase extends Te } }; } + + /** + * 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, + * the method throws a {...@link RuntimeIgnoreException} so that the test will be skipped. Note + * that this will only work if the test is configured with the appropriate test runner. + * <p> + * Some systems may be configured with a search domain that has a wildcard entry. On these + * systems it is virtually impossible to have a host name that will trigger a host not found + * error. This is a problem for tests that contain assertions for {...@link UnknownHostException}. + * This method can be used to skip these tests dynamically on this kind of systems. + * + * @param url + * @throws MalformedURLException + */ + protected static void checkUnknownHostURL(String url) throws MalformedURLException { + String host = new URL(url).getHost(); + InetAddress addr; + try { + addr = InetAddress.getByName(host); + } catch (UnknownHostException ex) { + // This is what we expect + return; + } + throw new RuntimeIgnoreException(host + " resolves to " + addr.getHostAddress() + "; skipping test case"); + } } Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/FaultyWebServiceTests.java Thu Dec 23 11:07:19 2010 @@ -25,12 +25,15 @@ package org.apache.axis2.jaxws.sample; import junit.framework.Test; import junit.framework.TestSuite; import org.apache.axis2.jaxws.TestLogger; +import org.apache.axis2.jaxws.dispatch.DispatchTestConstants; 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; import org.apache.axis2.jaxws.sample.wrap.sei.DocLitWrap; import org.apache.axis2.jaxws.sample.wrap.sei.DocLitWrapService; +import org.apache.axis2.testutils.AllTestsWithRuntimeIgnore; +import org.junit.runner.RunWith; import org.test.faults.FaultyWebServiceResponse; import javax.xml.ws.AsyncHandler; @@ -42,6 +45,7 @@ import java.net.UnknownHostException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +...@runwith(AllTestsWithRuntimeIgnore.class) public class FaultyWebServiceTests extends AbstractTestCase { String axisEndpoint = "http://localhost:6060/axis2/services/FaultyWebServiceService.FaultyWebServicePortTypeImplPort"; @@ -107,16 +111,17 @@ public class FaultyWebServiceTests exten } - public void testFaultyWebService_badEndpoint(){ + public void testFaultyWebService_badEndpoint() throws Exception { + String host = "this.is.a.bad.endpoint.terrible.in.fact"; + String badEndpoint = "http://" + host; + + checkUnknownHostURL(badEndpoint); TestLogger.logger.debug("----------------------------------"); TestLogger.logger.debug("test: " + getName()); FaultyWebServiceService service = new FaultyWebServiceService(); FaultyWebServicePortType proxy = service.getFaultyWebServicePort(); - String host = "this.is.a.bad.endpoint.terrible.in.fact"; - String badEndpoint = "http://" + host; - WebServiceException exception = null; try{ @@ -173,10 +178,12 @@ public class FaultyWebServiceTests exten // we get an exception as indicated in JAXWS 6.4.2. - public void testFaultyWebService_badEndpoint_oneWay() { + public void testFaultyWebService_badEndpoint_oneWay() throws Exception { String host = "this.is.a.bad.endpoint.terrible.in.fact"; String badEndpoint = "http://" + host; + checkUnknownHostURL(badEndpoint); + DocLitWrapService service = new DocLitWrapService(); DocLitWrap proxy = service.getDocLitWrapPort(); BindingProvider p = (BindingProvider)proxy; Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/RuntimeExceptionsAsyncMepTest.java Thu Dec 23 11:07:19 2010 @@ -44,12 +44,15 @@ import org.apache.axis2.jaxws.sample.asy import org.apache.axis2.jaxws.sample.asyncdoclit.client.ThrowExceptionFault; import org.apache.axis2.jaxws.sample.asyncdoclit.common.CallbackHandler; import org.apache.axis2.metadata.registry.MetadataFactoryRegistry; +import org.apache.axis2.testutils.AllTestsWithRuntimeIgnore; +import org.junit.runner.RunWith; import org.test.asyncdoclit.ExceptionTypeEnum; import org.test.asyncdoclit.ThrowExceptionResponse; /** * Test for varios async exceptions whern AsyncMEP is enabled */ +...@runwith(AllTestsWithRuntimeIgnore.class) public class RuntimeExceptionsAsyncMepTest extends AbstractTestCase { private static final String DOCLITWR_ASYNC_ENDPOINT = "http://localhost:6060/axis2/services/AsyncService2.DocLitWrappedPortImplPort"; @@ -124,6 +127,7 @@ public class RuntimeExceptionsAsyncMepTe * EE/WSE/UnknownHostException */ public void testAsyncPolling_asyncMEP_UnknwonHost() throws Exception { + checkUnknownHostURL(HOST_NOT_FOUND_ENDPOINT); AsyncPort port = getPort(); @@ -246,6 +250,7 @@ public class RuntimeExceptionsAsyncMepTe * EE/WSE/UnknownHostException */ public void testAsyncCallback_asyncMEP_UnknownHost() throws Exception { + checkUnknownHostURL(HOST_NOT_FOUND_ENDPOINT); AsyncPort port = getPort(); Map<String, Object> rc = ((BindingProvider) port).getRequestContext(); Added: axis/axis2/java/core/trunk/modules/testutils/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/pom.xml?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/pom.xml (added) +++ axis/axis2/java/core/trunk/modules/testutils/pom.xml Thu Dec 23 11:07:19 2010 @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-parent</artifactId> + <version>SNAPSHOT</version> + <relativePath>../parent/pom.xml</relativePath> + </parent> + <artifactId>axis2-testutils</artifactId> + <name>Apache Axis2 - Test Utilities</name> + <description>Contains utility classes used by the unit tests in Axis2.</description> + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>compile</scope> + </dependency> + </dependencies> + <scm> + <connection>scm:svn:http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/testutils</connection> + <developerConnection>scm:svn:https://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/modules/testutils</developerConnection> + <url>http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils</url> + </scm> + <build> + <plugins> + <plugin> + <artifactId>maven-remote-resources-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>process</goal> + </goals> + <configuration> + <resourceBundles> + <resourceBundle>org.apache.axis2:axis2-resource-bundle:${project.version}</resourceBundle> + </resourceBundles> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Propchange: axis/axis2/java/core/trunk/modules/testutils/pom.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java (added) +++ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java Thu Dec 23 11:07:19 2010 @@ -0,0 +1,36 @@ +/* + * 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.axis2.testutils; + +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.AllTests; + +/** + * Extension of the {...@link AllTests} runner that recognizes {...@link RuntimeIgnoreException}. + */ +public class AllTestsWithRuntimeIgnore extends AllTests { + public AllTestsWithRuntimeIgnore(Class<?> klass) throws Throwable { + super(klass); + } + + @Override + public void run(RunNotifier notifier) { + super.run(new RuntimeIgnoreRunNotifier(notifier)); + } +} Propchange: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AllTestsWithRuntimeIgnore.java ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java (added) +++ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java Thu Dec 23 11:07:19 2010 @@ -0,0 +1,36 @@ +/* + * 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.axis2.testutils; + +import org.junit.internal.runners.JUnit38ClassRunner; +import org.junit.runner.notification.RunNotifier; + +/** + * Extension of the {...@link JUnit38ClassRunner} that recognizes {...@link RuntimeIgnoreException}. + */ +public class JUnit38ClassRunnerWithRuntimeIgnore extends JUnit38ClassRunner { + public JUnit38ClassRunnerWithRuntimeIgnore(Class<?> klass) { + super(klass); + } + + @Override + public void run(RunNotifier notifier) { + super.run(new RuntimeIgnoreRunNotifier(notifier)); + } +} Propchange: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/JUnit38ClassRunnerWithRuntimeIgnore.java ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java (added) +++ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java Thu Dec 23 11:07:19 2010 @@ -0,0 +1,45 @@ +/* + * 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.axis2.testutils; + +/** + * Indicates that a test case should be skipped. Throwing this exception allows to skip a test case + * dynamically at runtime. This is useful if a test case relies on some assumption that may not be + * true in all environments. Note that this only works if the appropriate test runner is configured. + * <p> + * It should also be noted that there are alternative techniques that may be more appropriate in + * some use cases: + * <ul> + * <li>Simply return from the test method if the expectation about the runtime environment is not + * met. This is simpler, but has the disadvantage that the test case is counted as successful + * instead of skipped. + * <li>Using a Maven profile to exclude tests. This is more appropriate e.g. to exclude test cases + * that apply only to some Java versions. + * </ul> + * + * @see AllTestsWithRuntimeIgnore + * @see JUnit38ClassRunnerWithRuntimeIgnore + */ +public class RuntimeIgnoreException extends Error { + private static final long serialVersionUID = -2378820905593825587L; + + public RuntimeIgnoreException(String message) { + super(message); + } +} Propchange: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreException.java ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java (added) +++ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java Thu Dec 23 11:07:19 2010 @@ -0,0 +1,93 @@ +/* + * 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.axis2.testutils; + +import org.junit.runner.Description; +import org.junit.runner.Result; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; +import org.junit.runner.notification.RunNotifier; +import org.junit.runner.notification.StoppedByUserException; + +class RuntimeIgnoreRunNotifier extends RunNotifier { + private final RunNotifier target; + + public RuntimeIgnoreRunNotifier(RunNotifier target) { + this.target = target; + } + + @Override + public void addFirstListener(RunListener listener) { + target.addFirstListener(listener); + } + + @Override + public void addListener(RunListener listener) { + target.addListener(listener); + } + + @Override + public void fireTestFailure(Failure failure) { + if (failure.getException() instanceof RuntimeIgnoreException) { + target.fireTestIgnored(failure.getDescription()); + } else { + target.fireTestFailure(failure); + } + } + + @Override + public void fireTestFinished(Description description) { + target.fireTestFinished(description); + } + + @Override + public void fireTestIgnored(Description description) { + target.fireTestIgnored(description); + } + + @Override + public void fireTestRunFinished(Result result) { + target.fireTestRunFinished(result); + } + + @Override + public void fireTestRunStarted(Description description) { + target.fireTestRunStarted(description); + } + + @Override + public void fireTestStarted(Description description) throws StoppedByUserException { + target.fireTestStarted(description); + } + + @Override + public void pleaseStop() { + target.pleaseStop(); + } + + @Override + public void removeListener(RunListener listener) { + target.removeListener(listener); + } + + @Override + public void testAborted(Description description, Throwable cause) { + target.testAborted(description, cause); + } +} \ No newline at end of file Propchange: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/RuntimeIgnoreRunNotifier.java ------------------------------------------------------------------------------ svn:eol-style = native Added: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java?rev=1052223&view=auto ============================================================================== --- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java (added) +++ axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java Thu Dec 23 11:07:19 2010 @@ -0,0 +1,22 @@ +/* + * 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. + */ +/** + * Contains utility classes used by the unit tests in Axis2. + */ +package org.apache.axis2.testutils; \ No newline at end of file Propchange: axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/package-info.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: axis/axis2/java/core/trunk/pom.xml URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/pom.xml?rev=1052223&r1=1052222&r2=1052223&view=diff ============================================================================== --- axis/axis2/java/core/trunk/pom.xml (original) +++ axis/axis2/java/core/trunk/pom.xml Thu Dec 23 11:07:19 2010 @@ -58,6 +58,7 @@ <module>modules/soapmonitor/servlet</module> <module>modules/soapmonitor/module</module> <module>modules/spring</module> + <module>modules/testutils</module> <module>modules/tool/axis2-aar-maven-plugin</module> <module>modules/tool/axis2-ant-plugin</module> <module>modules/tool/axis2-eclipse-codegen-plugin</module>