You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/02/19 12:25:06 UTC
svn commit: r1290987 - in /webservices/commons/trunk/modules/axiom/modules:
axiom-samples/pom.xml
axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java
axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java
Author: veithen
Date: Sun Feb 19 11:25:05 2012
New Revision: 1290987
URL: http://svn.apache.org/viewvc?rev=1290987&view=rev
Log:
Make Axiom a good citizen and avoid using fixed TCP ports in unit tests.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java
- copied, changed from r1242464, axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/PortAllocator.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-samples/pom.xml
webservices/commons/trunk/modules/axiom/modules/axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-samples/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-samples/pom.xml?rev=1290987&r1=1290986&r2=1290987&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-samples/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-samples/pom.xml Sun Feb 19 11:25:05 2012
@@ -57,6 +57,12 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>axiom-testutils</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.4.4</version>
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java?rev=1290987&r1=1290986&r2=1290987&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-samples/src/test/java/org/apache/axiom/samples/MTOMSample.java Sun Feb 19 11:25:05 2012
@@ -38,6 +38,7 @@ import org.apache.axiom.om.OMText;
import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.testutils.PortAllocator;
import org.apache.cxf.helpers.IOUtils;
public class MTOMSample extends TestCase {
@@ -86,8 +87,9 @@ public class MTOMSample extends TestCase
// END SNIPPET: retrieveContent
public void test() throws Exception {
- Endpoint endpoint = Endpoint.publish("http://localhost:8080/mtom", new MTOMServiceImpl());
- retrieveContent(new URL("http://localhost:8080/mtom"), "G87ZX20047", System.out);
+ int port = PortAllocator.allocatePort();
+ Endpoint endpoint = Endpoint.publish("http://localhost:" + port + "/mtom", new MTOMServiceImpl());
+ retrieveContent(new URL("http://localhost:" + port + "/mtom"), "G87ZX20047", System.out);
endpoint.stop();
}
}
Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java (from r1242464, axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/PortAllocator.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java&p1=axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/PortAllocator.java&r1=1242464&r2=1290987&rev=1290987&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/PortAllocator.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/PortAllocator.java Sun Feb 19 11:25:05 2012
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis2.testutils;
+package org.apache.axiom.testutils;
import java.io.IOException;
import java.net.ServerSocket;