Author: richard.opalka(a)jboss.com
Date: 2008-05-15 11:34:55 -0400 (Thu, 15 May 2008)
New Revision: 7046
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/AbstractWSSEBase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/Encrypt3DESTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/AbstractWSSEBase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/EncryptTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/SignTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
Log:
always restore to original class loader
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsaSoap12/AddressingTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -21,7 +21,6 @@
*/
package org.jboss.test.ws.interop.nov2007.wsaSoap12;
-import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
@@ -81,16 +80,21 @@
private Element extraStuff;
private Element wsdl1Param;
private Element wsdl2Param;
+ private ClassLoader origCL;
public static Test suite()
{
-
addClientConfToClasspath("jbossws-interop-nov2007-wsaSoap12-client.jar");
return new JBossWSTestSetup(AddressingTestCase.class,
"jbossws-interop-nov2007-wsaSoap12.war");
}
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
protected void setUp() throws Exception
{
-
+ origCL =
addClientConfToClasspath("jbossws-interop-nov2007-wsaSoap12-client.jar");
if (echoPort==null || notifyPort==null)
{
wsdlLocation =
getResourceURL("interop/nov2007/wsaSoap12/WEB-INF/wsdl/service.wsdl");
@@ -113,7 +117,7 @@
extraStuff = DOMUtils.parse("<customer:extraStuff
xmlns:customer=\"http://example.org/customer\">This should be
ignored</customer:extraStuff>");
}
- protected static void addClientConfToClasspath(String s)
+ protected static ClassLoader addClientConfToClasspath(String s)
{
try
{
@@ -122,7 +126,7 @@
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URLClassLoader replacement = new URLClassLoader(new URL[] {
helper.getArchiveURL(s) }, parent);
Thread.currentThread().setContextClassLoader(replacement);
-
+ return parent;
}
catch (MalformedURLException e)
{
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/AbstractWSSEBase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/AbstractWSSEBase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/AbstractWSSEBase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -58,7 +58,6 @@
protected void setUp() throws Exception
{
super.setUp();
-
if (port == null)
{
URL wsdlLocation =
getResourceURL("interop/nov2007/wsse/shared/WEB-INF/wsdl/WsSecurity10.wsdl");
@@ -117,7 +116,7 @@
}
- protected static void addClientConfToClasspath(String s)
+ protected static ClassLoader addClientConfToClasspath(String s)
{
try
{
@@ -126,7 +125,7 @@
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URLClassLoader replacement = new URLClassLoader(new URL[] {
helper.getArchiveURL(s) }, parent);
Thread.currentThread().setContextClassLoader(replacement);
-
+ return parent;
}
catch (MalformedURLException e)
{
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/Encrypt3DESTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/Encrypt3DESTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/Encrypt3DESTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -60,12 +60,22 @@
*/
public class Encrypt3DESTestCase extends AbstractWSSEBase
{
-
+ private ClassLoader origCL;
+
public static Test suite()
{
-
addClientConfToClasspath("jbossws-interop-nov2007-wsseEncrypt3DES-client.jar");
return new JBossWSTestSetup(Encrypt3DESTestCase.class,
"jbossws-interop-nov2007-wsseEncrypt3DES.war");
}
+
+ protected void setUp() throws Exception
+ {
+ origCL =
addClientConfToClasspath("jbossws-interop-nov2007-wsseEncrypt3DES-client.jar");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
@Override
protected void scenarioSetup(IPingService port)
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -61,12 +61,22 @@
*/
public class EncryptTestCase extends AbstractWSSEBase
{
-
+ private ClassLoader origCL;
+
public static Test suite()
{
-
addClientConfToClasspath("jbossws-interop-nov2007-wsseEncrypt-client.jar");
return new JBossWSTestSetup(EncryptTestCase.class,
"jbossws-interop-nov2007-wsseEncrypt.war");
}
+
+ protected void setUp() throws Exception
+ {
+ origCL =
addClientConfToClasspath("jbossws-interop-nov2007-wsseEncrypt-client.jar");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
public void testEcho() throws Exception
{
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -51,13 +51,22 @@
*/
public class UsernameTokenHTTPSTestCase extends AbstractWSSEBase
{
+ private ClassLoader origCL;
public static Test suite()
{
-
addClientConfToClasspath("jbossws-interop-nov2007-wsseUsernameTokenHTTPS-client.jar");
return new JBossWSTestSetup(UsernameTokenHTTPSTestCase.class,
"jbossws-interop-nov2007-wsseUsernameTokenHTTPS.war");
}
+ protected void setUp() throws Exception
+ {
+ origCL =
addClientConfToClasspath("jbossws-interop-nov2007-wsseUsernameTokenHTTPS-client.jar");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
@Override
protected void scenarioSetup(IPingService port)
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/AbstractWSSEBase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/AbstractWSSEBase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/AbstractWSSEBase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -118,7 +118,7 @@
*/
}
- protected static void addClientConfToClasspath(String s)
+ protected static ClassLoader addClientConfToClasspath(String s)
{
try
{
@@ -127,7 +127,7 @@
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URLClassLoader replacement = new URLClassLoader(new URL[] {
helper.getArchiveURL(s) }, parent);
Thread.currentThread().setContextClassLoader(replacement);
-
+ return parent;
}
catch (MalformedURLException e)
{
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/EncryptTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/EncryptTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/EncryptTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -31,12 +31,22 @@
* @since Aug 23, 2006
*/
public class EncryptTestCase extends AbstractWSSEBase {
-
+ private ClassLoader origCL;
+
public static Test suite()
{
- addClientConfToClasspath("jbossws-interop-wsse10Encrypt-client.jar");
return new JBossWSTestSetup(EncryptTestCase.class,
"jbossws-interop-wsse10Encrypt.war");
}
+
+ protected void setUp() throws Exception
+ {
+ origCL =
addClientConfToClasspath("jbossws-interop-wsse10Encrypt-client.jar");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
String getEndpointURL() {
return
"http://"+getServerHost()+":8080/wsse10Encrypt/endpoint";
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/SignTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/SignTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/interop/wsse/SignTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -30,13 +30,23 @@
* @since 07-Mar-2006
*/
public class SignTestCase extends AbstractWSSEBase {
+ private ClassLoader origCL;
public static Test suite()
{
- addClientConfToClasspath("jbossws-interop-wsse10Sign-client.jar");
return new JBossWSTestSetup(SignTestCase.class,
"jbossws-interop-wsse10Sign.war");
}
+ protected void setUp() throws Exception
+ {
+ origCL =
addClientConfToClasspath("jbossws-interop-wsse10Sign-client.jar");
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
+
String getEndpointURL() {
return "http://"+getServerHost()+":8080/wsse10Sign/endpoint";
}
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1653/JBWS1653TestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -135,15 +135,15 @@
};
Thread.currentThread().setContextClassLoader(urlLoader);
- URL configURL =
urlLoader.findResource("META-INF/standard-jaxrpc-client-config.xml");
- assertTrue("Invalid config url: " + configURL,
configURL.toExternalForm().indexOf("jbws1653") > 0);
+ try
+ {
+ URL configURL =
urlLoader.findResource("META-INF/standard-jaxrpc-client-config.xml");
+ assertTrue("Invalid config url: " + configURL,
configURL.toExternalForm().indexOf("jbws1653") > 0);
- InitialContext iniCtx = getInitialContext();
- Service service =
(Service)iniCtx.lookup("java:comp/env/service/TestService");
- TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ InitialContext iniCtx = getInitialContext();
+ Service service =
(Service)iniCtx.lookup("java:comp/env/service/TestService");
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
- try
- {
String retStr = port.echoString("kermit");
assertEquals("kermit", retStr);
assertEquals("kermit", ClientHandler.message);
@@ -181,20 +181,20 @@
};
Thread.currentThread().setContextClassLoader(urlLoader);
- ServiceFactoryImpl factory = new ServiceFactoryImpl();
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
- QName qname = new QName("http://org.jboss.test.ws/jbws1653",
"TestService");
- Service service = factory.createService(wsdlURL, qname);
+ try
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653",
"TestService");
+ Service service = factory.createService(wsdlURL, qname);
- Call call = service.createCall();
- call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653",
"echoString"));
+ Call call = service.createCall();
+ call.setOperationName(new QName("http://org.jboss.test.ws/jbws1653",
"echoString"));
- call.setTargetEndpointAddress("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint");
+ call.setTargetEndpointAddress("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint");
- String hello = "Hello";
+ String hello = "Hello";
- try
- {
Object retObj = call.invoke(new Object[] { hello });
assertEquals(hello, retObj);
assertEquals(hello, ClientHandler.message);
@@ -226,15 +226,15 @@
};
Thread.currentThread().setContextClassLoader(urlLoader);
- ServiceFactoryImpl factory = new ServiceFactoryImpl();
- URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
- URL mappingURL =
getResourceURL("jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml");
- QName qname = new QName("http://org.jboss.test.ws/jbws1653",
"TestService");
- Service service = factory.createService(wsdlURL, qname, mappingURL);
- TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
-
try
{
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxrpc-jbws1653/TestEndpoint?wsdl");
+ URL mappingURL =
getResourceURL("jaxrpc/jbws1653/WEB-INF/jaxrpc-mapping.xml");
+ QName qname = new QName("http://org.jboss.test.ws/jbws1653",
"TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
+
String retStr = port.echoString("thefrog");
assertEquals("thefrog", retStr);
assertEquals("thefrog", ClientHandler.message);
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java
===================================================================
---
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java 2008-05-15
14:24:04 UTC (rev 7045)
+++
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/samples/news/SecureNewsTestCase.java 2008-05-15
15:34:55 UTC (rev 7046)
@@ -43,12 +43,23 @@
*/
public class SecureNewsTestCase extends JBossWSTest
{
+ private ClassLoader origCL;
+
public static Test suite()
{
- addClientConfToClasspath("jaxws-samples-news-step2-agency.jar"); //this
way the ws-security conf is available
return new JBossWSTestSetup(SecureNewsTestCase.class,
"jaxws-samples-news-step2-newspaper.jar");
}
+ protected void setUp() throws Exception
+ {
+ origCL = addClientConfToClasspath("jaxws-samples-news-step2-agency.jar");
//this way the ws-security conf is available
+ }
+
+ protected void tearDown() throws Exception
+ {
+ Thread.currentThread().setContextClassLoader(origCL);
+ }
+
public void testAgency() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() +
":8080/news/pressRelease?wsdl");
@@ -56,8 +67,7 @@
agency.run("Press release title", "Press release body");
}
-
- protected static void addClientConfToClasspath(String s)
+ protected static ClassLoader addClientConfToClasspath(String s)
{
try
{
@@ -66,7 +76,7 @@
ClassLoader parent = Thread.currentThread().getContextClassLoader();
URLClassLoader replacement = new URLClassLoader(new URL[] {
helper.getArchiveFile(s).toURL() }, parent);
Thread.currentThread().setContextClassLoader(replacement);
-
+ return parent;
}
catch (MalformedURLException e)
{