Author: veithen
Date: Sun Jan 6 18:06:23 2019
New Revision: 1850580
URL: http://svn.apache.org/viewvc?rev=1850580&view=rev
Log:
Merge r1819304 to the 1.7 branch.
Added:
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractConfigurationContextRule.java
- copied unchanged from r1819304,
axis/axis2/java/core/trunk/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractConfigurationContextRule.java
Modified:
axis/axis2/java/core/branches/1_7/ (props changed)
axis/axis2/java/core/branches/1_7/modules/testutils/ (props changed)
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractAxis2Server.java
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/ClientHelper.java
Propchange: axis/axis2/java/core/branches/1_7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 6 18:06:23 2019
@@ -1,4 +1,4 @@
/axis/axis2/java/core/branches/1_6:1295540
/axis/axis2/java/core/branches/AXIOM-420:1334386-1336397
/axis/axis2/java/core/branches/AXIS2-4318:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733225,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1735801,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188,1765192-1765193,1775081,1775102,1776253,1776585,1776594,1778204,1779069,1779074,1779816,1780290,1780684,1780714,1780723,1780726,1780733,1787632,1787676,1789029,1792353,1792376,1792650,1792655,1792802,1792804,1793723-1
793724,1793728,1794114,1794192,1797821,1797823,1799068,1800495,1803414,1805563,1806088,1806288,1806292,1806303-1806305,1806309,1806319,1806344,1806349-1806350,1806577,1806581,1806719,1807643,1807837,1807941,1807943,1808789,1809384-1809385,1809411,1809504,1809507,1809514,1809517,1810596,1810600,1810603,1815035,1815137,1815139,1817866,1817872,1819246,1819265,1820601,1821801,1821809,1823604,1823614,1823712,1826036,1831475,1831477,1831917,1832205,1835900,1836506,1837506-1837507,1837540,1838336,1843339,1843344,1844184,1844999,1845031,1845035,1845166,1845183,1848535,1848643-1848644,1848708,1848721,1848799,1849034,1849255,1849801,1850485
+/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733225,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1735801,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188,1765192-1765193,1775081,1775102,1776253,1776585,1776594,1778204,1779069,1779074,1779816,1780290,1780684,1780714,1780723,1780726,1780733,1787632,1787676,1789029,1792353,1792376,1792650,1792655,1792802,1792804,1793723-1
793724,1793728,1794114,1794192,1797821,1797823,1799068,1800495,1803414,1805563,1806088,1806288,1806292,1806303-1806305,1806309,1806319,1806344,1806349-1806350,1806577,1806581,1806719,1807643,1807837,1807941,1807943,1808789,1809384-1809385,1809411,1809504,1809507,1809514,1809517,1810596,1810600,1810603,1815035,1815137,1815139,1817866,1817872,1819246,1819265,1819304,1820601,1821801,1821809,1823604,1823614,1823712,1826036,1831475,1831477,1831917,1832205,1835900,1836506,1837506-1837507,1837540,1838336,1843339,1843344,1844184,1844999,1845031,1845035,1845166,1845183,1848535,1848643-1848644,1848708,1848721,1848799,1849034,1849255,1849801,1850485
Propchange: axis/axis2/java/core/branches/1_7/modules/testutils/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 6 18:06:23 2019
@@ -1,4 +1,4 @@
/axis/axis2/java/core/branches/1_6/modules/testutils:1295540
/axis/axis2/java/core/branches/AXIOM-420/modules/testutils:1334386-1336397
/axis/axis2/java/core/branches/AXIS2-4318/modules/testutils:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk/modules/testutils:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733225,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1735801,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976-1741977,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188,1765192-1765193,1775081,1775102,1776253,1776585,1776594,1778204,1779069,1779074,1779816,1780290,1780684,1780714,1780723-1780724,1780726,1780733,1780738,1787632,1787676,1789029,1792353,1792376
,1792650,1792655,1792802,1792804,1793723-1793724,1793728,1794114,1794192,1797821,1797823,1799068,1800495,1803414,1805563,1806088,1806288,1806292,1806303-1806305,1806309,1806319,1806344,1806349-1806350,1806577,1806581,1806719,1807643,1807837,1807941,1807943,1808789,1809384-1809385,1809411,1809504,1809507,1809514,1809517,1810596,1810600,1810603,1815035,1815137,1815139,1817866,1817872,1819246,1819265,1820601,1821801,1821809,1823604,1823614,1823712,1826036,1831475,1831477,1831917,1832205,1835900,1836506,1837506-1837507,1837540,1838336,1843339,1843344,1844999,1845031,1845035,1845166,1845183,1848535,1848643-1848644,1848708,1848721,1848799,1849034,1849255,1849801,1850485
+/axis/axis2/java/core/trunk/modules/testutils:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733225,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1735801,1736512,1736543,1737030,1737567,1739001,1739186,1739343,1739346,1739348,1739493,1739592,1739594-1739595,1739815,1739826,1740693-1740694,1741976-1741977,1742201,1743824,1745826,1745860,1745869,1745875,1745912,1745924,1745929,1745941,1746001,1746028,1746109,1746782,1746784,1746787,1746813,1746842,1746880,1746883,1746889,1746894,1747448,1747466,1747503,1747575,1747578,1747601,1747773,1747920,1751057,1752039,1765132,1765183,1765188,1765192-1765193,1775081,1775102,1776253,1776585,1776594,1778204,1779069,1779074,1779816,1780290,1780684,1780714,1780723-1780724,1780726,1780733,1780738,1787632,1787676,1789029,1792353,1792376
,1792650,1792655,1792802,1792804,1793723-1793724,1793728,1794114,1794192,1797821,1797823,1799068,1800495,1803414,1805563,1806088,1806288,1806292,1806303-1806305,1806309,1806319,1806344,1806349-1806350,1806577,1806581,1806719,1807643,1807837,1807941,1807943,1808789,1809384-1809385,1809411,1809504,1809507,1809514,1809517,1810596,1810600,1810603,1815035,1815137,1815139,1817866,1817872,1819246,1819265,1819304,1820601,1821801,1821809,1823604,1823614,1823712,1826036,1831475,1831477,1831917,1832205,1835900,1836506,1837506-1837507,1837540,1838336,1843339,1843344,1844999,1845031,1845035,1845166,1845183,1848535,1848643-1848644,1848708,1848721,1848799,1849034,1849255,1849801,1850485
Modified:
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractAxis2Server.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractAxis2Server.java?rev=1850580&r1=1850579&r2=1850580&view=diff
==============================================================================
---
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractAxis2Server.java
(original)
+++
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/AbstractAxis2Server.java
Sun Jan 6 18:06:23 2019
@@ -23,35 +23,20 @@ import javax.net.ssl.SSLContext;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.engine.AxisConfiguration;
-import org.junit.rules.ExternalResource;
-public abstract class AbstractAxis2Server extends ExternalResource {
- private final String repositoryPath;
+public abstract class AbstractAxis2Server extends
AbstractConfigurationContextRule {
private final AxisServiceFactory[] serviceFactories;
- private ConfigurationContext configurationContext;
public AbstractAxis2Server(String repositoryPath, AxisServiceFactory...
serviceFactories) {
- this.repositoryPath = repositoryPath;
+ super(repositoryPath);
this.serviceFactories = serviceFactories;
}
- final String getRepositoryPath() {
- return repositoryPath;
- }
-
- public final ConfigurationContext getConfigurationContext() {
- if (configurationContext == null) {
- throw new IllegalStateException();
- }
- return configurationContext;
- }
-
@Override
protected void before() throws Throwable {
- configurationContext =
-
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryPath);
+ super.before();
+ ConfigurationContext configurationContext = getConfigurationContext();
AxisConfiguration axisConfiguration =
configurationContext.getAxisConfiguration();
for (AxisServiceFactory serviceFactory : serviceFactories) {
axisConfiguration.addService(serviceFactory.createService(axisConfiguration));
@@ -62,7 +47,7 @@ public abstract class AbstractAxis2Serve
@Override
protected void after() {
stopServer();
- configurationContext = null;
+ super.after();
}
protected abstract void startServer(ConfigurationContext
configurationContext) throws Throwable;
Modified:
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/ClientHelper.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/ClientHelper.java?rev=1850580&r1=1850579&r2=1850580&view=diff
==============================================================================
---
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/ClientHelper.java
(original)
+++
axis/axis2/java/core/branches/1_7/modules/testutils/src/main/java/org/apache/axis2/testutils/ClientHelper.java
Sun Jan 6 18:06:23 2019
@@ -30,17 +30,13 @@ import javax.xml.namespace.QName;
import org.apache.axis2.client.ServiceClient;
import org.apache.axis2.client.Stub;
import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.junit.rules.ExternalResource;
-public class ClientHelper extends ExternalResource {
+public class ClientHelper extends AbstractConfigurationContextRule {
private final AbstractAxis2Server server;
- private final String repositoryPath;
- private ConfigurationContext configurationContext;
public ClientHelper(AbstractAxis2Server server, String repositoryPath) {
+ super(repositoryPath);
this.server = server;
- this.repositoryPath = repositoryPath;
}
public ClientHelper(AbstractAxis2Server server) {
@@ -49,21 +45,15 @@ public class ClientHelper extends Extern
@Override
protected final void before() throws Throwable {
- configurationContext =
-
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryPath);
+ super.before();
SSLContext sslContext = server.getClientSSLContext();
if (sslContext != null) {
- configurationContext.setProperty(SSLContext.class.getName(),
sslContext);
+ getConfigurationContext().setProperty(SSLContext.class.getName(),
sslContext);
}
}
- @Override
- protected final void after() {
- configurationContext = null;
- }
-
public final ServiceClient createServiceClient(String serviceName) throws
Exception {
- ServiceClient serviceClient = new ServiceClient(configurationContext,
null);
+ ServiceClient serviceClient = new
ServiceClient(getConfigurationContext(), null);
serviceClient.getOptions().setTo(server.getEndpointReference(serviceName));
configureServiceClient(serviceClient);
return serviceClient;
@@ -84,7 +74,7 @@ public class ClientHelper extends Extern
} else {
handler = null;
}
- ServiceClient serviceClient = new ServiceClient(configurationContext,
+ ServiceClient serviceClient = new
ServiceClient(getConfigurationContext(),
new URL(null, server.getEndpoint(serviceName) + "?wsdl",
handler), wsdlServiceName, portName);
configureServiceClient(serviceClient);
return serviceClient;
@@ -93,7 +83,7 @@ public class ClientHelper extends Extern
public final <T extends Stub> T createStub(Class<T> type, String
serviceName) throws Exception {
T stub = type
.getConstructor(ConfigurationContext.class, String.class)
- .newInstance(configurationContext,
server.getEndpoint(serviceName));
+ .newInstance(getConfigurationContext(),
server.getEndpoint(serviceName));
configureServiceClient(stub._getServiceClient());
return stub;
}