You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2018/12/27 18:42:36 UTC

svn commit: r1849802 [2/11] - in /axis/axis2/java/core/branches/hermetic-tests: ./ apidocs/ databinding-tests/jaxbri-tests/ databinding-tests/jaxbri-tests/src/test/java/org/apache/axis2/jaxbri/ databinding-tests/jaxbri-tests/src/test/java/org/apache/ax...

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5750/ServiceTest.java Thu Dec 27 18:42:33 2018
@@ -20,30 +20,29 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5750.client.FixedValue;
 import org.apache.axis2.databinding.axis2_5750.client.FixedValueServiceStub;
 import org.apache.axis2.databinding.axis2_5750.client.NonFixedValue_type1;
 import org.apache.axis2.databinding.axis2_5750.service.FixedValueServiceImpl;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
+import org.junit.ClassRule;
 import org.junit.Test;
 
 public class ServiceTest {
+    @ClassRule
+    public static final ClientHelper clientHelper = new ClientHelper("target/repo/client");
+
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new FixedValueServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:" + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new FixedValueServiceImpl());
-        try {
-            FixedValue fixedValue = new FixedValue();
-            NonFixedValue_type1 nonFixedValue_type1 = new NonFixedValue_type1();
-            nonFixedValue_type1.setNonFixedValue_type0("SomeId");
-            fixedValue.setNonFixedValue(nonFixedValue_type1);
-            FixedValueServiceStub stub = new FixedValueServiceStub(address);
-            assertThat(stub.test(fixedValue).getOut()).isEqualTo("OK");
-        } finally {
-            endpoint.stop();
-        }
+        FixedValue fixedValue = new FixedValue();
+        NonFixedValue_type1 nonFixedValue_type1 = new NonFixedValue_type1();
+        nonFixedValue_type1.setNonFixedValue_type0("SomeId");
+        fixedValue.setNonFixedValue(nonFixedValue_type1);
+        FixedValueServiceStub stub = clientHelper.createStub(FixedValueServiceStub.class, endpoint.getAddress());
+        assertThat(stub.test(fixedValue).getOut()).isEqualTo("OK");
     }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5758/ServiceTest.java Thu Dec 27 18:42:33 2018
@@ -20,29 +20,28 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5758.client.StockQuoteServiceStub;
 import org.apache.axis2.databinding.axis2_5758.client.TradePriceRequest;
 import org.apache.axis2.databinding.axis2_5758.service.StockQuoteServiceImpl;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
+import org.junit.ClassRule;
 import org.junit.Test;
 
 public class ServiceTest {
+    @ClassRule
+    public static final ClientHelper clientHelper = new ClientHelper("target/repo/client");
+
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new StockQuoteServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:" + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new StockQuoteServiceImpl());
-        try {
-            StockQuoteServiceStub stub = new StockQuoteServiceStub(address);
-            TradePriceRequest request = new TradePriceRequest();
-            request.setTickerSymbol(null);
-            assertThat(stub.getLastTradePrice(request).getPrice()).isNaN();
-            request.setTickerSymbol("GOOG");
-            assertThat(stub.getLastTradePrice(request).getPrice()).isWithin(0.001f).of(100.0f);
-        } finally {
-            endpoint.stop();
-        }
+        StockQuoteServiceStub stub = clientHelper.createStub(StockQuoteServiceStub.class, endpoint.getAddress());
+        TradePriceRequest request = new TradePriceRequest();
+        request.setTickerSymbol(null);
+        assertThat(stub.getLastTradePrice(request).getPrice()).isNaN();
+        request.setTickerSymbol("GOOG");
+        assertThat(stub.getLastTradePrice(request).getPrice()).isWithin(0.001f).of(100.0f);
     }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/axis2_5799/ServiceTest.java Thu Dec 27 18:42:33 2018
@@ -20,27 +20,26 @@ package org.apache.axis2.databinding.axi
 
 import static com.google.common.truth.Truth.assertThat;
 
-import javax.xml.ws.Endpoint;
-
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axis2.databinding.axis2_5799.client.ComplexTypeWithAttribute;
 import org.apache.axis2.databinding.axis2_5799.client.EchoServiceStub;
 import org.apache.axis2.databinding.axis2_5799.service.EchoImpl;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
+import org.junit.ClassRule;
 import org.junit.Test;
 
 public class ServiceTest {
+    @ClassRule
+    public static final ClientHelper clientHelper = new ClientHelper("target/repo/client");
+
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new EchoImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:" + port + "/service";
-        Endpoint endpoint = Endpoint.publish(address, new EchoImpl());
-        try {
-            EchoServiceStub stub = new EchoServiceStub(address);
-            ComplexTypeWithAttribute request = new ComplexTypeWithAttribute();
-            request.setAttr("value");
-            assertThat(stub.echo(request).getAttr()).isEqualTo("value");
-        } finally {
-            endpoint.stop();
-        }
+        EchoServiceStub stub = clientHelper.createStub(EchoServiceStub.class, endpoint.getAddress());
+        ComplexTypeWithAttribute request = new ComplexTypeWithAttribute();
+        request.setAttr("value");
+        assertThat(stub.echo(request).getAttr()).isEqualTo("value");
     }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/databinding/mtom/MTOMTest.java Thu Dec 27 18:42:33 2018
@@ -19,33 +19,33 @@
 package org.apache.axis2.databinding.mtom;
 
 import javax.activation.DataHandler;
-import javax.xml.ws.Endpoint;
 
-import org.apache.axiom.testutils.PortAllocator;
 import org.apache.axiom.testutils.activation.RandomDataSource;
 import org.apache.axiom.testutils.io.IOTestUtils;
 import org.apache.axis2.Constants;
 import org.apache.axis2.databinding.mtom.client.MTOMServiceStub;
 import org.apache.axis2.databinding.mtom.client.MTOMServiceStub.GetContent;
 import org.apache.axis2.databinding.mtom.service.MTOMServiceImpl;
+import org.apache.axis2.testutils.ClientHelper;
+import org.apache.axis2.testutils.jaxws.JAXWSEndpoint;
+import org.junit.ClassRule;
 import org.junit.Test;
 
 public class MTOMTest {
+    @ClassRule
+    public static final ClientHelper clientHelper = new ClientHelper("target/repo/client");
+
+    @ClassRule
+    public static final JAXWSEndpoint endpoint = new JAXWSEndpoint(new MTOMServiceImpl());
+
     @Test
     public void test() throws Exception {
-        int port = PortAllocator.allocatePort();
-        String address = "http://localhost:" + port + "/mtom";
-        Endpoint endpoint = Endpoint.publish(address, new MTOMServiceImpl());
-        try {
-            MTOMServiceStub stub = new MTOMServiceStub(address);
-            // JAX-WS only produces an MTOM response if the request uses MTOM
-            stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
-            DataHandler content = stub.getContent(new GetContent()).getContent();
-            IOTestUtils.compareStreams(
-                    new RandomDataSource(654321L, 1000000).getInputStream(), "expected",
-                    content.getInputStream(), "actual");
-        } finally {
-            endpoint.stop();
-        }
+        MTOMServiceStub stub = clientHelper.createStub(MTOMServiceStub.class, endpoint.getAddress());
+        // JAX-WS only produces an MTOM response if the request uses MTOM
+        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
+        DataHandler content = stub.getContent(new GetContent()).getContent();
+        IOTestUtils.compareStreams(
+                new RandomDataSource(654321L, 1000000).getInputStream(), "expected",
+                content.getInputStream(), "actual");
     }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/union2/Union2Test.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/union2/Union2Test.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/union2/Union2Test.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb-tests/src/test/java/org/apache/axis2/schema/union2/Union2Test.java Thu Dec 27 18:42:33 2018
@@ -57,15 +57,17 @@ public class Union2Test extends Abstract
     }
 
     public void testFuzzDateType() throws Exception {
+        Date date = new Date(1539684442000L);
         TestFuzzyDateType testFuzzyDateType = new TestFuzzyDateType();
         FuzzyDateType fuzzyDateType = new FuzzyDateType();
-        fuzzyDateType.setObject(new Date());
+        fuzzyDateType.setObject(date);
         testFuzzyDateType.setTestFuzzyDateType(fuzzyDateType);
 
         // java.util.Date maps to xs:date, so we expect to loose the time information
         TestFuzzyDateType expectedResult = new TestFuzzyDateType();
         FuzzyDateType expectedFuzzyDateType = new FuzzyDateType();
         Calendar cal = new GregorianCalendar();
+        cal.setTime(date);
         cal.set(Calendar.HOUR_OF_DAY, 0);
         cal.set(Calendar.MINUTE, 0);
         cal.set(Calendar.SECOND, 0);

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/pom.xml Thu Dec 27 18:42:33 2018
@@ -49,6 +49,12 @@
             <scope>runtime</scope>
         </dependency>
         <dependency>
+            <groupId>org.jboss.spec.javax.rmi</groupId>
+            <artifactId>jboss-rmi-api_1.0_spec</artifactId>
+            <version>1.0.6.Final</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>
@@ -64,6 +70,11 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>com.sun.activation</groupId>
+            <artifactId>javax.activation</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>com.sun.mail</groupId>
             <artifactId>javax.mail</artifactId>
             <scope>test</scope>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/ADBException.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/ADBException.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/ADBException.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/ADBException.java Thu Dec 27 18:42:33 2018
@@ -19,8 +19,6 @@
 
 package org.apache.axis2.databinding;
 
-import javax.xml.stream.Location;
-
 /**
  * uses to handle ADB exceptions
  */
@@ -41,12 +39,4 @@ public class ADBException extends DataBi
     public ADBException(String string, Throwable throwable) {
         super(string, throwable);
     }
-
-    public ADBException(String string, Location location, Throwable throwable) {
-        super(string, location, throwable);
-    }
-
-    public ADBException(String string, Location location) {
-        super(string, location);
-    }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/DataBindException.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/DataBindException.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/DataBindException.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/DataBindException.java Thu Dec 27 18:42:33 2018
@@ -19,14 +19,11 @@
 
 package org.apache.axis2.databinding;
 
-import javax.xml.stream.Location;
-import javax.xml.stream.XMLStreamException;
-
 /**
  * handles databinding exceptions
  */
 
-public class DataBindException extends XMLStreamException {
+public class DataBindException extends RuntimeException {
 
     public DataBindException() {
     }
@@ -42,13 +39,4 @@ public class DataBindException extends X
     public DataBindException(String string, Throwable throwable) {
         super(string, throwable);
     }
-
-    public DataBindException(String string, Location location, Throwable throwable) {
-        super(string, location, throwable);
-    }
-
-    public DataBindException(String string, Location location) {
-        super(string, location);
-    }
-
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Thu Dec 27 18:42:33 2018
@@ -1286,7 +1286,9 @@ public class ConverterUtil {
      * @return 0 if equal , + value if greater than , - value if less than
      */
     public static int compare(int intValue, String value) {
-        return intValue - Integer.parseInt(value);
+        int other = Integer.parseInt(value);
+        return intValue < other ? -1 : (intValue == other ? 0 : 1);
+
     }
 
     /**

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/adb/test/org/apache/axis2/databinding/utils/ConverterUtilTest.java Thu Dec 27 18:42:33 2018
@@ -21,6 +21,8 @@ package org.apache.axis2.databinding.uti
 
 import junit.framework.TestCase;
 
+import static com.google.common.truth.Truth.assertThat;
+
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.text.SimpleDateFormat;
@@ -158,8 +160,8 @@ public class ConverterUtilTest extends T
             this.internalTestConvertToDateTime();
             
             // run tests with time zone "Africa/Windhoek"
-            System.out.println( "setting time zone to Africa/Windhoek" );
-            TimeZone.setDefault(TimeZone.getTimeZone("Africa/Windhoek"));
+            System.out.println( "setting time zone to Africa/Tunis" );
+            TimeZone.setDefault(TimeZone.getTimeZone("Africa/Tunis"));
             this.internalTestConvertToDateTime();
 
             // run tests with time zone "Australia/Darwin"
@@ -560,5 +562,8 @@ public class ConverterUtilTest extends T
 
     }
 
-
+    public void testCompareInt() {
+        // https://stackoverflow.com/questions/46372764/axis2-adb-and-mininclusive-2147483648
+        assertThat(ConverterUtil.compare(3, "-2147483648")).isGreaterThan(0);
+    }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java Thu Dec 27 18:42:33 2018
@@ -22,8 +22,6 @@ package org.apache.axis2.handlers.addres
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.util.AttributeHelper;
-import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPFault;
@@ -333,14 +331,14 @@ public class AddressingOutHandler extend
                     if (!isAddressingHeaderAlreadyAvailable(Final.FAULT_HEADER_DETAIL, false)) {
                         SOAPHeaderBlock faultDetail = header.addHeaderBlock(
                                 Final.FAULT_HEADER_DETAIL, addressingNamespaceObject);
-                        faultDetail.addChild(ElementHelper.importOMElement(detailElement, factory));
+                        faultDetail.addChild((OMElement)factory.importInformationItem(detailElement));
                     }
                 } else if (!messageContext.isSOAP11()) {
                     // Add detail to the Fault in the SOAP Body
                     SOAPFault fault = envelope.getBody().getFault();
                     if (fault != null && fault.getDetail() != null) {
                         fault.getDetail().addDetailEntry(
-                                ElementHelper.importOMElement(detailElement, factory));
+                                (OMElement)factory.importInformationItem(detailElement));
                     }
                 }
             }
@@ -428,7 +426,7 @@ public class AddressingOutHandler extend
             }
         }
 
-        private OMElement createSOAPHeaderBlock(String value, String headerName, ArrayList attributes) {
+        private OMElement createSOAPHeaderBlock(String value, String headerName, ArrayList<OMAttribute> attributes) {
             if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
                 log.trace("createSOAPHeaderBlock: value=" + value + " headerName=" + headerName);
             }
@@ -437,10 +435,10 @@ public class AddressingOutHandler extend
                         header.addHeaderBlock(headerName, addressingNamespaceObject);
                 soapHeaderBlock.addChild(factory.createOMText(value));
                 if (attributes != null && !attributes.isEmpty()) {
-                    Iterator attrIterator = attributes.iterator();
+                    Iterator<OMAttribute> attrIterator = attributes.iterator();
                     while (attrIterator.hasNext()) {
-                        AttributeHelper
-                                .importOMAttribute((OMAttribute)attrIterator.next(), soapHeaderBlock);
+                        soapHeaderBlock.addAttribute(
+                                (OMAttribute)soapHeaderBlock.getOMFactory().importInformationItem(attrIterator.next()));
                     }
                 }
                 addRoleToHeader(soapHeaderBlock);
@@ -503,7 +501,7 @@ public class AddressingOutHandler extend
                 Iterator iterator = referenceInformation.values().iterator();
                 while (iterator.hasNext()) {
                     OMElement omElement = (OMElement)iterator.next();
-                    SOAPHeaderBlock newElement = ElementHelper.toSOAPHeaderBlock(omElement, factory);
+                    SOAPHeaderBlock newElement = factory.createSOAPHeaderBlock(omElement);
                     if (isFinalAddressingNamespace) {
                         newElement.addAttribute(Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE,
                                                Final.WSA_TYPE_ATTRIBUTE_VALUE,
@@ -529,7 +527,7 @@ public class AddressingOutHandler extend
                             // Only add the reference parameter from the WSDL if it does not already exist.
                             // This allows clients to override the values before invoking the service.
                             if (referenceInformation == null || !referenceInformation.containsKey(omElement.getQName())) {
-                                SOAPHeaderBlock newElement = ElementHelper.toSOAPHeaderBlock(omElement, factory);
+                                SOAPHeaderBlock newElement = factory.createSOAPHeaderBlock(omElement);
                                 if (isFinalAddressingNamespace) {
                                     newElement.addAttribute(Final.WSA_IS_REFERENCE_PARAMETER_ATTRIBUTE,
                                                             Final.WSA_TYPE_ATTRIBUTE_VALUE,

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/clustering/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/clustering/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/clustering/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/clustering/pom.xml Thu Dec 27 18:42:33 2018
@@ -30,6 +30,9 @@
     <artifactId>axis2-clustering</artifactId>
     <name>Apache Axis2 - Clustering</name>
     <description>Axis2 Clustering module</description>
+    <properties>
+        <tomcat.version>6.0.53</tomcat.version>
+    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -62,10 +65,12 @@
         <dependency>
             <groupId>org.apache.tomcat</groupId>
             <artifactId>tribes</artifactId>
+            <version>${tomcat.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.tomcat</groupId>
             <artifactId>juli</artifactId>
+            <version>${tomcat.version}</version>
         </dependency>
     </dependencies>
     <url>http://axis.apache.org/axis2/java/core/</url>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/codegen/src/org/apache/axis2/wsdl/codegen/jaxws/JAXWSCodeGenerationEngine.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/codegen/src/org/apache/axis2/wsdl/codegen/jaxws/JAXWSCodeGenerationEngine.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/codegen/src/org/apache/axis2/wsdl/codegen/jaxws/JAXWSCodeGenerationEngine.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/codegen/src/org/apache/axis2/wsdl/codegen/jaxws/JAXWSCodeGenerationEngine.java Thu Dec 27 18:42:33 2018
@@ -26,12 +26,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.axiom.om.util.LogOutputStream;
 import org.apache.axis2.util.CommandLineOption;
 import org.apache.axis2.util.CommandLineOptionConstants;
 import org.apache.axis2.util.CommandLineOptionParser;
+import org.apache.axis2.util.LogWriter;
 import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
 import org.apache.axis2.wsdl.codegen.CodeGenerationException;
+import org.apache.commons.io.output.WriterOutputStream;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -89,10 +90,7 @@ public class JAXWSCodeGenerationEngine {
      *             the code generation exception
      */
     public void generate() throws CodeGenerationException {
-
-        LogOutputStream logOutputStream = new LogOutputStream(log,
-                Integer.MAX_VALUE);
-        WsimportTool importTool = new WsimportTool(logOutputStream);
+        WsimportTool importTool = new WsimportTool(new WriterOutputStream(new LogWriter(log)));
         ArrayList<String> args = new ArrayList<String>();
         configurImportToolOptions(args);
         mergeOriginalArgs(args);

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/corba/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/corba/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/corba/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/corba/pom.xml Thu Dec 27 18:42:33 2018
@@ -52,6 +52,12 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.jacorb</groupId>
+            <artifactId>jacorb-omgapi</artifactId>
+            <version>3.9</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
         </dependency>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/corba/src/org/apache/axis2/corba/deployer/CorbaDeployer.java Thu Dec 27 18:42:33 2018
@@ -95,7 +95,7 @@ public class CorbaDeployer extends Abstr
             AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
             serviceGroup.setServiceGroupClassLoader(deploymentFileData.getClassLoader());
             ArrayList serviceList = processService(deploymentFileData, serviceGroup, configCtx);
-            DeploymentEngine.addServiceGroup(serviceGroup, serviceList, deploymentFileData.getFile().toURL(), deploymentFileData, axisConfig);
+            DeploymentEngine.addServiceGroup(serviceGroup, serviceList, deploymentFileData.getFile().toURI().toURL(), deploymentFileData, axisConfig);
             name = deploymentFileData.getName();
             super.deploy(deploymentFileData);
             log.info("Deploying " + name);

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/distribution/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/distribution/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/distribution/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/distribution/pom.xml Thu Dec 27 18:42:33 2018
@@ -99,7 +99,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-jaxbri</artifactId>
+            <artifactId>axis2-jaxbri-codegen</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
@@ -157,9 +157,18 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http-hc3</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-transport-local</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-jaxb</artifactId>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -191,6 +200,12 @@
             <version>${project.version}</version>
             <type>mar</type>
         </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-jaxws-mar</artifactId>
+            <version>${project.version}</version>
+            <type>mar</type>
+        </dependency>
         
         <dependency>
             <groupId>org.apache.axis2</groupId>
@@ -209,10 +224,6 @@
                     <groupId>org.apache.geronimo.specs</groupId>
                     <artifactId>geronimo-jms_1.1_spec</artifactId>
                 </exclusion>
-                <exclusion>
-                    <groupId>org.apache.geronimo.specs</groupId>
-                    <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
-                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
@@ -320,6 +331,28 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>com.github.veithen.alta</groupId>
+                <artifactId>alta-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>war-location</id>
+                        <goals>
+                            <goal>generate-properties</goal>
+                        </goals>
+                        <configuration>
+                            <name>webapp</name>
+                            <value>%file%</value>
+                            <dependencySet>
+                                <scope>test</scope>
+                                <includes>
+                                    <include>*:axis2-webapp:war:*</include>
+                                </includes>
+                            </dependencySet>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.codehaus.gmavenplus</groupId>
                 <artifactId>gmavenplus-plugin</artifactId>
                 <executions>
@@ -340,6 +373,41 @@
                             </scripts>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>check-webapp-content</id>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>execute</goal>
+                        </goals>
+                        <configuration>
+                            <scripts>
+                                <script><![CDATA[
+                                    import java.util.jar.*
+                                    
+                                    def jar = new JarInputStream(new FileInputStream(project.properties['webapp']))
+                                    def expected = new HashSet()
+                                    def entry
+                                    while(entry = jar.nextJarEntry) {
+                                        if (entry.name != 'META-INF/') {
+                                            expected.add(entry.name)
+                                        }
+                                    }
+                                    jar.close()
+                                    
+                                    jar = new JarInputStream(new FileInputStream(new File(project.build.directory, "axis2-" + project.version + "/dist/axis2.war")))
+                                    while(entry = jar.nextJarEntry) {
+                                        if (entry.name != 'META-INF/' && !expected.remove(entry.name)) {
+                                            throw new Error("Unexpected entry in Web app: " + entry.name)
+                                        }
+                                    }
+                                    if (!expected.empty) {
+                                        throw new Error("Missing entries in Web app: " + expected)
+                                    }
+                                    jar.close()
+                                ]]></script>
+                            </scripts>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
             <plugin>
@@ -352,6 +420,7 @@
                         </goals>
                         <configuration>
                             <outputDirectory>${project.build.directory}/tmp-repository</outputDirectory>
+                            <stripServiceVersion>false</stripServiceVersion>
                             <generateFileLists>true</generateFileLists>
                         </configuration>
                     </execution>
@@ -379,6 +448,27 @@
                 </executions>
             </plugin>
             
+            <!-- Always remove files from a previous run of the integration tests. -->
+            <plugin>
+                <artifactId>maven-clean-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>clean-test-files</id>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>clean</goal>
+                        </goals>
+                        <configuration>
+                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
+                            <filesets>
+                                <fileset>
+                                    <directory>${project.build.directory}/axis2-${project.version}</directory>
+                                </fileset>
+                            </filesets>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
             <!-- Prepare some additional dependencies required by specific samples. We could
                  also do this by invoking the relevant download.jars targets in the provided
                  ant scripts, but this may cause issues with HTTP proxies and has the disadvantage
@@ -426,6 +516,9 @@
                             <tasks>
                                 <unzip src="${project.build.directory}/axis2-${project.version}-bin.zip" dest="${project.build.directory}" />
                                 
+                                <!-- Build the web app -->
+                                <ant dir="${project.build.directory}/axis2-${project.version}/webapp" useNativeBasedir="true" />
+                                
                                 <!-- Test of the databinding sample -->
                                 <ant dir="${project.build.directory}/axis2-${project.version}/samples/databinding" />
                                 
@@ -435,12 +528,28 @@
                                 
                                 <!-- Test of the faulthandling sample -->
                                 <ant dir="${project.build.directory}/axis2-${project.version}/samples/faulthandling" target="generate.service" />
+                                
+                                <!-- Test of the json sample -->
+                                <ant dir="${project.build.directory}/axis2-${project.version}/samples/json" target="generate.service" />
+                                <ant dir="${project.build.directory}/axis2-${project.version}/samples/json" target="client.jar" />
                             </tasks>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
+                <groupId>com.github.veithen.invoker</groupId>
+                <artifactId>resolver-proxy-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>start</goal>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <artifactId>maven-invoker-plugin</artifactId>
                 <executions>
                     <execution>
@@ -480,7 +589,7 @@
             <build>
                 <plugins>
                     <plugin>
-                        <groupId>net.ju-n.maven.plugins</groupId>
+                        <groupId>net.nicoulaj.maven.plugins</groupId>
                         <artifactId>checksum-maven-plugin</artifactId>
                         <executions>
                             <execution>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/distribution/src/main/assembly/bin-assembly.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/distribution/src/main/assembly/bin-assembly.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/distribution/src/main/assembly/bin-assembly.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/distribution/src/main/assembly/bin-assembly.xml Thu Dec 27 18:42:33 2018
@@ -170,6 +170,9 @@
         <dependencySet>
             <useProjectArtifact>false</useProjectArtifact>
             <outputDirectory>lib</outputDirectory>
+            <!-- Use artifact.baseVersion instead of artifact.version to avoid inconsistency with
+                 the Web app built by Maven. This only affects snapshot builds. -->
+            <outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>*:*:jar</include>
             </includes>
@@ -185,12 +188,10 @@
                  <exclude>com.sun.xml.fastinfoset:FastInfoset:jar</exclude>
                  <exclude>rhino:js:jar</exclude>
                  <exclude>javax.servlet:servlet-api</exclude>
-                 <exclude>javax.xml.ws:jaxws-api:jar</exclude>
                  <exclude>com.sun.xml.messaging.saaj:saaj-impl:jar</exclude>
                  <exclude>com.sun.xml.stream:sjsxp:jar</exclude>
                  <exclude>com.sun.org.apache.xml.internal:resolver:jar</exclude>
                  <exclude>javax.xml.stream:stax-api:jar</exclude>
-                 <exclude>javax.xml.soap:saaj-api:jar</exclude>
                  <exclude>org.jvnet:mimepull:jar</exclude>
             </excludes>
         </dependencySet>
@@ -213,15 +214,17 @@
             <outputDirectory>webapp</outputDirectory>
             <unpackOptions>
                 <includes>
-                    <include>WEB-INF/**/*</include>
+                    <include>org/apache/axis2/soapmonitor/applet/**/*</include>
+                    <include>WEB-INF/classes/**/*</include>
+                    <include>WEB-INF/include/**/*</include>
+                    <include>WEB-INF/lib/taglibs-standard-impl-*.jar</include>
+                    <include>WEB-INF/lib/taglibs-standard-spec-*.jar</include>
+                    <include>WEB-INF/lib/axis2-soapmonitor-servlet-*.jar</include>
+                    <include>WEB-INF/tags/**/*</include>
+                    <include>WEB-INF/views/**/*</include>
+                    <include>WEB-INF/web.xml</include>
                     <include>axis2-web/**/*</include>
                 </includes>
-                <excludes>
-                    <exclude>WEB-INF/conf/**/*</exclude>
-                    <exclude>WEB-INF/lib/**/*</exclude>
-                    <exclude>WEB-INF/services/**/*</exclude>
-                    <exclude>WEB-INF/modules/**/*</exclude>
-                </excludes>
             </unpackOptions>
         </dependencySet>
     </dependencySets>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/pom.xml Thu Dec 27 18:42:33 2018
@@ -65,16 +65,13 @@
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-java2wsdl</artifactId>
             <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-adb-codegen</artifactId>
             <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-codegen</artifactId>
-            <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.neethi</groupId>
@@ -192,7 +189,7 @@
                                 <!-- make the dirs -->
                                 <mkdir dir="${wsdl.output.base.dir}" />
                                 <echo>Compiling Service class</echo>
-                                <javac fork="true" destdir="target/test-classes" debug="on">
+                                <javac fork="true" destdir="target/test-classes" debug="on" source="1.7" target="1.7">
                                     <classpath refid="maven.dependency.classpath" />
                                     <classpath location="${compiled.classes.dir}" />
                                     <include name="**/*SimpleAddService.java" />
@@ -201,7 +198,7 @@
                                 <echo>Generating the WSDL</echo>
                                 <java classname="org.apache.ws.java2wsdl.Java2WSDL" fork="true">
                                     <classpath>
-                                        <path refid="maven.dependency.classpath" />
+                                        <path refid="maven.test.classpath" />
                                         <pathelement location="target/test-classes" />
                                     </classpath>
                                     <arg line="-o target/test-classes -of SimpleAddService.wsdl -efd unqualified -cn org.apache.axis2.fastinfoset.SimpleAddService" />
@@ -211,7 +208,7 @@
                                 <mkdir dir="${wsdl.output.base.dir}/simpleAddService" />
 
                                 <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
-                                    <classpath refid="maven.runtime.classpath" />
+                                    <classpath refid="maven.test.classpath" />
                                     <classpath location="${compiled.classes.dir}" />
                                     <arg line="-uri target/test-classes/SimpleAddService.wsdl -o target/wsdl/simpleAddService -S . -or" />
                                 </java>
@@ -249,7 +246,7 @@
                          because the test server doesn't shut down properly :-(
                          Should be removed if possible -->
                     <forkMode>pertest</forkMode>
-                    <argLine>-Xms256m -Xmx512m</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m</argLine>
                     <!-- Enable the next 2 lines if you want to attach a debugger
                    <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetMessageFormatter.java Thu Dec 27 18:42:33 2018
@@ -31,7 +31,6 @@ import org.apache.commons.logging.LogFac
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -53,32 +52,6 @@ public class FastInfosetMessageFormatter
     }
 
     /**
-     * Retrieves the raw bytes from the SOAP envelop.
-     * 
-     * @see org.apache.axis2.transport.MessageFormatter#getBytes(org.apache.axis2.context.MessageContext, org.apache.axiom.om.OMOutputFormat)
-     */
-    public byte[] getBytes(MessageContext messageContext, OMOutputFormat format)
-            throws AxisFault {
-        OMElement element = messageContext.getEnvelope();
-        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-        
-        try {
-            //Creates StAX document serializer which actually implements the XMLStreamWriter
-            XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
-            streamWriter.writeStartDocument();
-            element.serializeAndConsume(streamWriter);
-            //TODO Looks like the SOAP envelop doesn't have an end document tag. Find out why?
-            streamWriter.writeEndDocument();
-            
-            return outStream.toByteArray();
-            
-        } catch (XMLStreamException xmlse) {
-            logger.error(xmlse.getMessage());
-            throw new AxisFault(xmlse.getMessage(), xmlse);
-        }
-    }
-
-    /**
      * Returns the content type
      * 
      * @see org.apache.axis2.transport.MessageFormatter#getContentType(org.apache.axis2.context.MessageContext, org.apache.axiom.om.OMOutputFormat, java.lang.String)
@@ -145,11 +118,7 @@ public class FastInfosetMessageFormatter
             //Create the StAX document serializer
             XMLStreamWriter streamWriter = new StAXDocumentSerializer(outputStream);
             streamWriter.writeStartDocument();
-            if (preserve) {
-                element.serialize(streamWriter);
-            } else {
-                element.serializeAndConsume(streamWriter);
-            }
+            element.serialize(streamWriter, preserve);
 //            TODO Looks like the SOAP envelop doesn't have a end document tag. Find out why?
             streamWriter.writeEndDocument();
         } catch (XMLStreamException xmlse) {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetPOXMessageFormatter.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetPOXMessageFormatter.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetPOXMessageFormatter.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/fastinfoset/src/org/apache/axis2/fastinfoset/FastInfosetPOXMessageFormatter.java Thu Dec 27 18:42:33 2018
@@ -31,7 +31,6 @@ import org.apache.commons.logging.LogFac
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -53,33 +52,6 @@ public class FastInfosetPOXMessageFormat
     }
 
     /**
-     * Retrieves the raw bytes from the SOAP envelop.
-     * 
-     * @see org.apache.axis2.transport.MessageFormatter#getBytes(org.apache.axis2.context.MessageContext, org.apache.axiom.om.OMOutputFormat)
-     */
-    public byte[] getBytes(MessageContext messageContext, OMOutputFormat format)
-            throws AxisFault {
-        //For POX drop the SOAP envelope and use the message body
-        OMElement element = messageContext.getEnvelope().getBody().getFirstElement();
-        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-        
-        try {
-            //Creates StAX document serializer which actually implements the XMLStreamWriter
-            XMLStreamWriter streamWriter = new StAXDocumentSerializer(outStream);
-            //Since we drop the SOAP envelop we have to manually write the start document and the end document events
-            streamWriter.writeStartDocument();
-            element.serializeAndConsume(streamWriter);
-            streamWriter.writeEndDocument();
-            
-            return outStream.toByteArray();
-            
-        } catch (XMLStreamException xmlse) {
-            logger.error(xmlse.getMessage());
-            throw new AxisFault(xmlse.getMessage(), xmlse);
-        }
-    }
-
-    /**
      * Returns the content type
      * 
      * @see org.apache.axis2.transport.MessageFormatter#getContentType(org.apache.axis2.context.MessageContext, org.apache.axiom.om.OMOutputFormat, java.lang.String)
@@ -148,11 +120,7 @@ public class FastInfosetPOXMessageFormat
             XMLStreamWriter streamWriter = new StAXDocumentSerializer(outputStream);
             //Since we drop the SOAP envelop we have to manually write the start document and the end document events            
             streamWriter.writeStartDocument();
-            if (preserve) {
-                element.serialize(streamWriter);
-            } else {
-                element.serializeAndConsume(streamWriter);
-            }
+            element.serialize(streamWriter, preserve);
             streamWriter.writeEndDocument();
         } catch (XMLStreamException xmlse) {
             logger.error(xmlse.getMessage());

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/itest-build.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/itest-build.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/itest-build.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/itest-build.xml Thu Dec 27 18:42:33 2018
@@ -75,19 +75,8 @@
 		</java>
 		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/complexdatatypebare" />
 
-		<!-- compile the schema for XMLbeans -->
-		<java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" fork="true">
-			<classpath refid="maven.runtime.classpath" />
-			<arg line="-src target/xmlbeans/java -d target/xmlbeans/resources -srconly test-resources/xsd/type-test.xsd" />
-		</java>
-
 		<ant antfile="itest-build.xml" inheritall="true" inheritrefs="true" dir="." target="rpc-wsdl-codegen" />
 		<ant antfile="itest-build.xml" inheritall="true" inheritrefs="true" dir="." target="wsdl20-codegen" />
-
-		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestModuleB" />
-		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestModuleC" />
-		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestServiceB" />
-		<ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="test-resources/SOAP12Testing/SOAP12TestServiceC" />
 	</target>
 
 	<target name="rpc-wsdl-codegen">

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/pom.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/pom.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/pom.xml Thu Dec 27 18:42:33 2018
@@ -33,11 +33,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-clustering</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-transport-http</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -48,12 +43,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>scripting</artifactId>
-            <type>mar</type>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-adb-codegen</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -79,11 +68,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-metadata</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-mtompolicy</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -99,16 +83,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.axis2</groupId>
-            <artifactId>org.apache.axis2.osgi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-xmlbeans</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
             <artifactId>addressing</artifactId>
             <version>${project.version}</version>
             <type>mar</type>
@@ -129,6 +103,17 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>com.google.truth</groupId>
+            <artifactId>truth</artifactId>
+            <scope>test</scope>
+        </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>
@@ -138,6 +123,39 @@
             <artifactId>commons-httpclient</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.sun.activation</groupId>
+            <artifactId>javax.activation</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>SOAP12TestModuleB</artifactId>
+            <version>${project.version}</version>
+            <type>mar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>SOAP12TestModuleC</artifactId>
+            <version>${project.version}</version>
+            <type>mar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>SOAP12TestServiceB</artifactId>
+            <version>${project.version}</version>
+            <type>aar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>SOAP12TestServiceC</artifactId>
+            <version>${project.version}</version>
+            <type>aar</type>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <url>http://axis.apache.org/axis2/java/core/</url>
     <scm>
@@ -215,7 +233,19 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/test-resources/samples</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                                <handlers>
+                                    <handler>
+                                        <flow>InFlow</flow>
+                                        <phase>Transport</phase>
+                                        <name>RequestURIOperationDispatcher</name>
+                                        <className>org.apache.axis2.dispatchers.RequestURIOperationDispatcher</className>
+                                    </handler>
+                                </handlers>
+                            </generatedAxis2xml>
                             <modules>addressing</modules>
                         </configuration>
                     </execution>
@@ -227,7 +257,11 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/test-resources/repository-client</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                            </generatedAxis2xml>
                             <modules>addressing</modules>
                         </configuration>
                     </execution>
@@ -274,7 +308,11 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/test-resources/integrationRepo</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                            </generatedAxis2xml>
                             <modules>addressing</modules>
                         </configuration>
                     </execution>
@@ -358,8 +396,14 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/Repository</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
-                            <modules>addressing</modules>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                            </generatedAxis2xml>
+                            <modules>addressing,SOAP12TestModuleB,SOAP12TestModuleC</modules>
+                            <includeServices>true</includeServices>
+                            <services>SOAP12TestServiceB,SOAP12TestServiceC</services>
                         </configuration>
                     </execution>
                     <execution>
@@ -370,7 +414,11 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/perf2/build/repo</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                            </generatedAxis2xml>
                             <modules>addressing</modules>
                         </configuration>
                     </execution>
@@ -382,7 +430,11 @@
                         </goals>
                         <configuration>
                             <outputDirectory>target/perf/build/repo/conf</outputDirectory>
-                            <axis2xml>conf/axis2.xml</axis2xml>
+                            <generatedAxis2xml>
+                                <modules>
+                                    <module>addressing</module>
+                                </modules>
+                            </generatedAxis2xml>
                             <modules>addressing</modules>
                         </configuration>
                     </execution>
@@ -402,6 +454,19 @@
                 <configuration>
                     <configurationDirectory>conf</configurationDirectory>
                     <includeServices>false</includeServices>
+                    <generatedAxis2xml>
+                        <transportReceivers>
+                            <transportReceiver>
+                                <name>http</name>
+                                <parameters>
+                                    <parameter>
+                                        <name>port</name>
+                                        <value>0</value>
+                                    </parameter>
+                                </parameters>
+                            </transportReceiver>
+                        </transportReceivers>
+                    </generatedAxis2xml>
                 </configuration>
             </plugin>
             <plugin>
@@ -478,11 +543,7 @@
                 <artifactId>maven-surefire-plugin</artifactId>
                 <inherited>true</inherited>
                 <configuration>
-                    <!-- The pertest forkMode is not ideal but seems to be necessary
-                         because the test server doesn't shut down properly :-(
-                         Should be removed if possible -->
-                    <forkMode>pertest</forkMode>
-                    <argLine>-Xms256m -Xmx512m</argLine>
+                    <argLine>${argLine} -Xms256m -Xmx512m</argLine>
                     <!-- Enable the next 2 lines if you want to attach a debugger
                  <argLine>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006</argLine>-->
                     <includes>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/archiveTestModule/build.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/archiveTestModule/build.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/archiveTestModule/build.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/archiveTestModule/build.xml Thu Dec 27 18:42:33 2018
@@ -36,7 +36,7 @@
 
     <target name="compile" depends="init" unless="jars.uptodate">
         <mkdir dir="${build.classes}"/>
-        <javac fork="true" destdir="${build.classes}" debug="on">
+        <javac fork="true" destdir="${build.classes}" debug="on" source="1.7" target="1.7">
             <classpath refid="axis.test.classpath"/>
             <src path="${src}"/>
         </javac>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/pojoTestModule/build.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/pojoTestModule/build.xml?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/pojoTestModule/build.xml (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test-resources/jaxrs/pojoTestModule/build.xml Thu Dec 27 18:42:33 2018
@@ -32,7 +32,7 @@
 
     <target name="compile" depends="init" unless="pojo.uptodate">
         <mkdir dir="${pojo.dir}"/>
-        <javac fork="true" destdir="${pojo.dir}" debug="on">
+        <javac fork="true" destdir="${pojo.dir}" debug="on" source="1.7" target="1.7">
             <classpath refid="axis.test.classpath"/>
             <src path="${src}"/>
         </javac>

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/EchoRawRuntimeProxyTest.java Thu Dec 27 18:42:33 2018
@@ -40,7 +40,7 @@ import javax.xml.namespace.QName;
 
 public class EchoRawRuntimeProxyTest extends UtilServerBasedTestCase {
     public static final EndpointReference targetEPR = new EndpointReference(
-            "http://localhost:5555"
+            "http://localhost:" + UtilServer.TESTING_PORT
                     + "/axis2/services/EchoXMLService/echoOMElement");
 
     public static final QName serviceName = new QName("EchoXMLService");
@@ -84,7 +84,7 @@ public class EchoRawRuntimeProxyTest ext
         HttpTransportProperties.ProxyProperties proxyproperties =
                 new HttpTransportProperties.ProxyProperties();
         proxyproperties.setProxyName("localhost");
-        proxyproperties.setProxyPort(5555);
+        proxyproperties.setProxyPort(UtilServer.TESTING_PORT);
         proxyproperties.setDomain("anonymous");
         proxyproperties.setPassWord("anonymous");
         proxyproperties.setUserName("anonymous");

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/LongRunningServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/LongRunningServiceTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/LongRunningServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/LongRunningServiceTest.java Thu Dec 27 18:42:33 2018
@@ -65,7 +65,6 @@ public class LongRunningServiceTest exte
     }
 
     protected void setUp() throws Exception {
-        UtilServer.start();
         UtilServer.engageAddressingModule();
         AxisService service =
                 Utils.createSimpleService(serviceName,

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ServiceClientTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ServiceClientTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ServiceClientTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ServiceClientTest.java Thu Dec 27 18:42:33 2018
@@ -72,6 +72,7 @@ public class ServiceClientTest extends U
     protected void tearDown() throws Exception {
         UtilServer.unDeployService(new QName("Echo"));
         UtilServer.unDeployClientService();
+        UtilServer.stop();
     }
 
     public static OMElement createDummyOMElement() {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThirdPartyResponseRawXMLTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThirdPartyResponseRawXMLTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThirdPartyResponseRawXMLTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/ThirdPartyResponseRawXMLTest.java Thu Dec 27 18:42:33 2018
@@ -21,6 +21,8 @@ package org.apache.axis2.engine;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
+
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
@@ -35,9 +37,16 @@ import org.apache.axis2.engine.util.Test
 import org.apache.axis2.integration.TestingUtils;
 import org.apache.axis2.integration.UtilServer;
 import org.apache.axis2.integration.UtilServerBasedTestCase;
+import org.apache.axis2.testutils.PortAllocator;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
 import org.apache.axis2.util.Utils;
 
+import static com.google.common.truth.Truth.assertThat;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+
 import javax.xml.namespace.QName;
 
 public class ThirdPartyResponseRawXMLTest extends UtilServerBasedTestCase implements TestConstants {
@@ -45,12 +54,12 @@ public class ThirdPartyResponseRawXMLTes
         return getTestSetup(new TestSuite(ThirdPartyResponseRawXMLTest.class));
     }
     
-	private boolean received;
+    private final BlockingQueue<OMElement> received = new ArrayBlockingQueue<>(1);
     protected AxisService service;
     private SimpleHTTPServer receiver;
     private String callbackOperation;
     private String callbackServiceName = "CallbackService";
-    private int callbackserverPort = 17458;
+    private int callbackserverPort = PortAllocator.allocatePort();
     
     protected void setUp() throws Exception {
         service = Utils.createSimpleService(serviceName,
@@ -62,8 +71,13 @@ public class ThirdPartyResponseRawXMLTes
     	AxisService callbackService  = Utils.createSimpleInOnlyService(new QName(callbackServiceName),new MessageReceiver(){
             public void receive(MessageContext messageCtx) throws AxisFault {
                 SOAPEnvelope envelope = messageCtx.getEnvelope();
-                TestingUtils.compareWithCreatedOMElement(envelope.getBody().getFirstElement());
-                received = true;
+                OMElement bodyContent = envelope.getBody().getFirstElement();
+                bodyContent.build();
+                try {
+                    received.put(bodyContent);
+                } catch (InterruptedException ex) {
+                    // Do nothing
+                }
             }
         },new QName(callbackOperation));
         UtilServer.deployService(callbackService);
@@ -85,14 +99,9 @@ public class ThirdPartyResponseRawXMLTes
         sender.setOptions(op);
         sender.engageModule(Constants.MODULE_ADDRESSING);
         sender.fireAndForget(TestingUtils.createDummyOMElement());
-        int index = 0;
-        while (!received) {
-            Thread.sleep(1000);
-            index++;
-            if (index == 20) {
-                throw new AxisFault("error Occured");
-            }
-        }
+        OMElement bodyContent = received.poll(20, TimeUnit.SECONDS);
+        assertThat(bodyContent).isNotNull();
+        TestingUtils.compareWithCreatedOMElement(bodyContent);
     }
 
     protected void tearDown() throws Exception {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/map/MapServiceTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/map/MapServiceTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/map/MapServiceTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/engine/map/MapServiceTest.java Thu Dec 27 18:42:33 2018
@@ -19,8 +19,10 @@
 
 package org.apache.axis2.engine.map;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import javax.xml.stream.XMLStreamException;
-import junit.framework.TestCase;
 
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
@@ -31,33 +33,19 @@ import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.Options;
 import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.AxisServer;
+import org.apache.axis2.testutils.Axis2Server;
+import org.apache.axis2.testutils.SimpleAxisServiceFactory;
+import org.junit.ClassRule;
+import org.junit.Test;
 
 /**
  * The Class MapServiceTest.
  */
-public class MapServiceTest extends TestCase {
-    private AxisServer server;
+public class MapServiceTest {
+    @ClassRule
+    public static Axis2Server server = new Axis2Server(null,
+            new SimpleAxisServiceFactory(MapService.class));
     
-    /** The service. */
-    protected AxisService service;
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see junit.framework.TestCase#setUp()
-     */
-    protected void setUp() throws Exception {
-        server = new AxisServer();
-        server.deployService(MapService.class.getName());
-    }   
-
-    @Override
-    protected void tearDown() throws Exception {
-        server.stop();
-    }
-
     /**
      * Test string generics map service.
      * 
@@ -66,9 +54,10 @@ public class MapServiceTest extends Test
      * @throws AxisFault
      *             the axis fault
      */
+    @Test
     public void testStringGenericsMapService() throws XMLStreamException,
             AxisFault {
-        String epr = "http://localhost:6060/axis2/services/MapService/stringGenericsMapService";
+        String epr = server.getEndpoint("MapService") + "/stringGenericsMapService";
         Options options = new Options();
         options.setTo(new EndpointReference(epr));
         ServiceClient sender = new ServiceClient();
@@ -94,10 +83,11 @@ public class MapServiceTest extends Test
      * @throws AxisFault
      *             the axis fault
      */
+    @Test
     public void testStringGenericsTreeMapService() throws XMLStreamException,
             AxisFault {
 
-        String epr = "http://localhost:6060/axis2/services/MapService/stringGenericsTreeMapService";
+        String epr = server.getEndpoint("MapService") + "/stringGenericsTreeMapService";
         Options options = new Options();
         options.setTo(new EndpointReference(epr));
         ServiceClient sender = new ServiceClient();

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/TestingUtils.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/TestingUtils.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/TestingUtils.java Thu Dec 27 18:42:33 2018
@@ -25,6 +25,8 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 
+import static com.google.common.truth.Truth.assertThat;
+
 import java.io.File;
 import java.io.IOException;
 
@@ -56,7 +58,7 @@ public class TestingUtils {
         OMElement firstChild = element.getFirstElement();
         TestCase.assertNotNull(firstChild);
         String textValue = firstChild.getText();
-        TestCase.assertEquals(textValue, "Isaac Asimov, The Foundation Trilogy");
+        assertThat(textValue).isEqualTo("Isaac Asimov, The Foundation Trilogy");
     }
 
     public static String prefixBaseDirectory(String path) {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServer.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServer.java Thu Dec 27 18:42:33 2018
@@ -31,6 +31,7 @@ import org.apache.axis2.description.Axis
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.engine.ListenerManager;
+import org.apache.axis2.testutils.PortAllocator;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
 
 import javax.xml.namespace.QName;
@@ -38,11 +39,9 @@ import java.io.File;
 import java.io.FilenameFilter;
 
 public class UtilServer {
-    private static int count = 0;
-
     private static SimpleHTTPServer receiver;
 
-    public static final int TESTING_PORT = 5555;
+    public static final int TESTING_PORT = PortAllocator.allocatePort();
 
     public static final String FAILURE_MESSAGE = "Intentional Failure";
 
@@ -72,60 +71,29 @@ public class UtilServer {
 
 
     public static synchronized void start(String repository) throws Exception {
-        if (count == 0) {
-            ConfigurationContext er = getNewConfigurationContext(repository);
-
-            receiver = new SimpleHTTPServer(er, TESTING_PORT);
-
-            try {
-                receiver.start();
-                ListenerManager listenerManager = er.getListenerManager();
-                TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
-                trsIn.setReceiver(receiver);
-                if (listenerManager == null) {
-                    listenerManager = new ListenerManager();
-                    listenerManager.init(er);
-                }
-                listenerManager.addListener(trsIn, true);
-                System.out.print("Server started on port "
-                        + TESTING_PORT + ".....");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e1) {
-            throw new AxisFault("Thread interuptted", e1);
+        if (receiver != null) {
+            throw new IllegalStateException("Server already running");
         }
 
+        ConfigurationContext er = getNewConfigurationContext(repository);
 
-        count++;
-    }
-
-    public static synchronized void start(String repository, String axis2xml) throws Exception {
-        if (count == 0) {
-            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
-
-            receiver = new SimpleHTTPServer(er, TESTING_PORT);
-
-            try {
-                receiver.start();
-                System.out.print("Server started on port "
-                        + TESTING_PORT + ".....");
-            } catch (Exception e) {
-                throw AxisFault.makeFault(e);
-            }
+        receiver = new SimpleHTTPServer(er, TESTING_PORT);
 
-            try {
-                Thread.sleep(2000);
-            } catch (InterruptedException e1) {
-                throw new AxisFault("Thread interuptted", e1);
+        try {
+            receiver.start();
+            ListenerManager listenerManager = er.getListenerManager();
+            TransportInDescription trsIn = new TransportInDescription(Constants.TRANSPORT_HTTP);
+            trsIn.setReceiver(receiver);
+            if (listenerManager == null) {
+                listenerManager = new ListenerManager();
+                listenerManager.init(er);
             }
-
+            listenerManager.addListener(trsIn, true);
+            System.out.print("Server started on port "
+                    + TESTING_PORT + ".....");
+        } catch (Exception e) {
+            e.printStackTrace();
         }
-        count++;
     }
 
     public static ConfigurationContext getNewConfigurationContext(
@@ -154,22 +122,22 @@ public class UtilServer {
     }
 
     public static synchronized void stop() throws AxisFault {
-        if (count == 1) {
-            receiver.stop();
-            while (receiver.isRunning()) {
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e1) {
-                    //nothing to do here
-                }
+        if (receiver == null) {
+            throw new IllegalStateException();
+        }
+
+        receiver.stop();
+        while (receiver.isRunning()) {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e1) {
+                //nothing to do here
             }
-            count = 0;
-// tp.doStop();
-            System.out.print("Server stopped .....");
-        } else {
-            count--;
         }
+// tp.doStop();
+        System.out.print("Server stopped .....");
         receiver.getConfigurationContext().terminate();
+        receiver = null;
     }
 
     public static ConfigurationContext getConfigurationContext() {

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServerBasedTestCase.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServerBasedTestCase.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServerBasedTestCase.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/integration/UtilServerBasedTestCase.java Thu Dec 27 18:42:33 2018
@@ -56,16 +56,4 @@ public class UtilServerBasedTestCase ext
             }
         };
     }
-
-    protected static Test getTestSetup3(Test test, final String param1, final String param2) {
-        return new TestSetup(test) {
-            public void setUp() throws Exception {
-                UtilServer.start(param1, param2);
-            }
-
-            public void tearDown() throws Exception {
-                UtilServer.stop();
-            }
-        };
-    }
 }

Modified: axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=1849802&r1=1849801&r2=1849802&view=diff
==============================================================================
--- axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java (original)
+++ axis/axis2/java/core/branches/hermetic-tests/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java Thu Dec 27 18:42:33 2018
@@ -203,7 +203,8 @@ public class EchoRawMTOMTest extends Uti
         options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         ConfigurationContext configContext =
                 ConfigurationContextFactory.createConfigurationContextFromFileSystem(
-                        TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
+                        TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
+                        TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo/conf/axis2.xml"));
 
         ServiceClient sender = new ServiceClient(configContext, null);
         sender.engageModule("addressing");