Author: alessio.soldano(a)jboss.com
Date: 2008-05-15 13:10:33 -0400 (Thu, 15 May 2008)
New Revision: 7049
Modified:
common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
Log:
[JBWS-2176] Restoring cxt classloader at the end of each test
Modified: common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2008-05-15
16:48:59 UTC (rev 7048)
+++ common/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2008-05-15
17:10:33 UTC (rev 7049)
@@ -53,6 +53,7 @@
private JBossWSTestHelper delegate = new JBossWSTestHelper();
private String[] archives = new String[0];
+ private ClassLoader originalClassLoader;
public JBossWSTestSetup(Class<?> testClass, String archiveList)
{
@@ -130,10 +131,11 @@
}
}
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ originalClassLoader = parent;
// add client jars to the class loader
if (!clientJars.isEmpty())
{
- ClassLoader parent = Thread.currentThread().getContextClassLoader();
URL[] urls = new URL[clientJars.size()];
for (int i = 0; i < clientJars.size(); i++)
{
@@ -150,6 +152,7 @@
{
String archive = archives[archives.length - i - 1];
delegate.undeploy(archive);
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
}
}
Show replies by date