JBossWS SVN: r13781 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/management and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-02-22 06:54:56 -0500 (Tue, 22 Feb 2011)
New Revision: 13781
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/management/CXFManagementTestCase.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3234] excluding test because JNDI over RMI not available in AS7 yet, [JBWS-3221] enabling all JMX tests
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/management/CXFManagementTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/management/CXFManagementTestCase.java 2011-02-21 20:01:40 UTC (rev 13780)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/management/CXFManagementTestCase.java 2011-02-22 11:54:56 UTC (rev 13781)
@@ -13,14 +13,14 @@
public class CXFManagementTestCase extends JBossWSTest
{
+
public static Test suite()
{
return new JBossWSCXFTestSetup(CXFManagementTestCase.class, "jaxws-cxf-management.war");
}
-
+
public void testJMXBean() throws Exception {
- InitialContext context = new InitialContext();
- MBeanServerConnection server = (MBeanServerConnection)context.lookup("jmx/invoker/RMIAdaptor");
+ MBeanServerConnection server = getServer();
ObjectName name = new ObjectName("org.apache.cxf:*");
Set cxfBeans = server.queryMBeans(name, null);
assertTrue(cxfBeans.size() > 0);
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-02-21 20:01:40 UTC (rev 13780)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-02-22 11:54:56 UTC (rev 13781)
@@ -872,7 +872,6 @@
<exclude>org/jboss/test/ws/jaxws/samples/advanced/retail/**</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/securityDomain/**</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/swaref/**</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/serviceref/**/*EJBTestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/webservice/**/*EJB3TestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/webserviceref/**/*EJB3TestCase*</exclude>
<exclude>org/jboss/test/ws/management/recording/**</exclude>
@@ -888,13 +887,6 @@
<exclude>org/jboss/test/ws/jaxws/jbws2527/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws1702/**</exclude>
- <!-- # [JBWS-3221] JMX dependent tests -->
- <exclude>org/jboss/test/ws/jaxws/cxf/management/**</exclude>
- <exclude>org/jboss/test/ws/jaxws/jbws1178/**</exclude>
- <exclude>org/jboss/test/ws/jaxws/jbws1190/**</exclude>
- <exclude>org/jboss/test/ws/jaxws/jbws2150/**</exclude>
- <exclude>org/jboss/test/ws/jaxws/samples/serviceref/**</exclude>
-
<!-- # [JBWS-3222] Script tests -->
<exclude>org/jboss/test/ws/jaxws/jbws2528/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws2529/**</exclude>
@@ -932,6 +924,9 @@
<!-- # [JBWS-3232] javax.naming.NameNotFoundException: Name 'service' not found in context 'env' -->
<exclude>org/jboss/test/ws/jaxws/jbws3140/**</exclude>
+ <!-- # [JBWS-3234] JNDI over RMI not available on AS7 -->
+ <exclude>org/jboss/test/ws/jaxws/samples/serviceref/**</exclude>
+
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
13 years, 11 months
JBossWS SVN: r13780 - stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-02-21 15:01:40 -0500 (Mon, 21 Feb 2011)
New Revision: 13780
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
Log:
[JBAS-8838] fixing ws common dependencies
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-02-21 14:29:00 UTC (rev 13779)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/common/main/module.xml 2011-02-21 20:01:40 UTC (rev 13780)
@@ -37,6 +37,8 @@
<module name="org.jboss.ws.api"/>
<module name="org.jboss.ws.spi"/>
<module name="org.jboss.logging"/>
+ <module name="org.jboss.common-core"/>
+ <module name="org.apache.xerces" services="import"/>
<module name="wsdl4j.wsdl4j" />
</dependencies>
</module>
13 years, 11 months
JBossWS SVN: r13779 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-21 09:29:00 -0500 (Mon, 21 Feb 2011)
New Revision: 13779
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3223] Setup TCCL also when building EndpointImpl directly through Provider JAXWS API
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-21 14:27:53 UTC (rev 13778)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-21 14:29:00 UTC (rev 13779)
@@ -32,6 +32,7 @@
import java.util.NoSuchElementException;
import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.spi.ServiceDelegate;
@@ -78,6 +79,38 @@
}
}
+ @Override
+ public Endpoint createEndpoint(String bindingId, Object implementor) {
+ ClassLoader origClassLoader = null;
+ try
+ {
+ origClassLoader = checkAndFixContextClassLoader();
+ return super.createEndpoint(bindingId, implementor);
+ }
+ finally
+ {
+ if (origClassLoader != null)
+ setContextClassLoader(origClassLoader);
+ }
+ }
+
+ @Override
+ public Endpoint createEndpoint(String bindingId,
+ Object implementor,
+ WebServiceFeature ... features) {
+ ClassLoader origClassLoader = null;
+ try
+ {
+ origClassLoader = checkAndFixContextClassLoader();
+ return super.createEndpoint(bindingId, implementor, features);
+ }
+ finally
+ {
+ if (origClassLoader != null)
+ setContextClassLoader(origClassLoader);
+ }
+ }
+
@SuppressWarnings("rawtypes")
@Override
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls)
13 years, 11 months
JBossWS SVN: r13778 - stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-transports-httpserver/main.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-21 09:27:53 -0500 (Mon, 21 Feb 2011)
New Revision: 13778
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-transports-httpserver/main/module.xml
Log:
[JBAS-8838] Setting proper dependencies on jbossws-cxf-transports-httpserver
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-transports-httpserver/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-transports-httpserver/main/module.xml 2011-02-21 10:00:29 UTC (rev 13777)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-transports-httpserver/main/module.xml 2011-02-21 14:27:53 UTC (rev 13778)
@@ -31,5 +31,15 @@
<dependencies>
<module name="org.jboss.ws.spi" />
<module name="org.jboss.ws.common" />
+ <module name="javax.annotation.api" />
+ <module name="javax.xml.ws.api" />
+ <module name="org.jboss.ws.jaxws-httpserver-httpspi" />
+ <module name="org.apache.cxf" services="import">
+ <imports>
+ <include path="META-INF/cxf"/> <!-- required to also pull in the bus extensions from META-INF -->
+ <include path="META-INF/spring.*"/>
+ </imports>
+ </module>
+ <module name="com.sun.httpserver"/>
</dependencies>
</module>
13 years, 11 months
JBossWS SVN: r13777 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-02-21 05:00:29 -0500 (Mon, 21 Feb 2011)
New Revision: 13777
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBAS-8891][JBAS-8871][JBWS-3232] updating excludes
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-02-21 08:07:15 UTC (rev 13776)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-02-21 10:00:29 UTC (rev 13777)
@@ -175,15 +175,15 @@
</goals>
<configuration>
<outputDirectory>${project.build.directory}/endorsed</outputDirectory>
- <resources>
+ <resources>
<resource>
<directory>${basedir}/../endorsed/target/</directory>
<includes>
<include>jbossws-cxf-factories-${project.version}.jar</include>
</includes>
</resource>
- </resources>
- </configuration>
+ </resources>
+ </configuration>
</execution>
</executions>
</plugin>
@@ -894,7 +894,7 @@
<exclude>org/jboss/test/ws/jaxws/jbws1190/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws2150/**</exclude>
<exclude>org/jboss/test/ws/jaxws/samples/serviceref/**</exclude>
-
+
<!-- # [JBWS-3222] Script tests -->
<exclude>org/jboss/test/ws/jaxws/jbws2528/**</exclude>
<exclude>org/jboss/test/ws/jaxws/jbws2529/**</exclude>
@@ -902,14 +902,14 @@
<exclude>org/jboss/test/ws/jaxws/jbws2593/**</exclude>
<exclude>org/jboss/test/ws/jaxws/smoke/tools/*ScriptTestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase*</exclude>
-
+
<!-- # [JBWS-3223] proper CL for WEB & EJBs to include WS functionality -->
<exclude>org/jboss/test/ws/jaxws/endpoint/EndpointTestCase*</exclude>
<exclude>org/jboss/test/ws/jaxws/cxf/endorse/**</exclude>
<!-- # [JBWS-3225] jbossws console not yet available -->
<exclude>org/jboss/test/ws/console/**</exclude>
-
+
<!-- # [JBWS-3226] jboss-service.xml not matching AS7 format -->
<exclude>org/jboss/test/ws/jaxws/jbws1854/**</exclude>
@@ -929,15 +929,12 @@
<!-- # [JBWS-3231] not satisfied policy alternatives -->
<exclude>org/jboss/test/ws/jaxws/samples/mtom/MtomTestCase*</exclude>
- <!-- # [JBAS-8871] AS7 undeployment issue -->
- <exclude>org/jboss/test/ws/saaj/jbws3084/**</exclude>
-
- <!-- # [JBAS-8891] Parse issue on web.xml -->
+ <!-- # [JBWS-3232] javax.naming.NameNotFoundException: Name 'service' not found in context 'env' -->
<exclude>org/jboss/test/ws/jaxws/jbws3140/**</exclude>
-
+
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
-
+
<!-- JAXRPC deployments -->
<exclude>org/jboss/test/ws/jaxrpc/**</exclude>
</excludes>
13 years, 11 months
JBossWS SVN: r13776 - hudson/trunk/hudson-home/jobs/MAVEN-REPOSITORY-CLEAN.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-21 03:07:15 -0500 (Mon, 21 Feb 2011)
New Revision: 13776
Modified:
hudson/trunk/hudson-home/jobs/MAVEN-REPOSITORY-CLEAN/config.xml
Log:
Just delete m2 repository contents, not the repository directory
Modified: hudson/trunk/hudson-home/jobs/MAVEN-REPOSITORY-CLEAN/config.xml
===================================================================
--- hudson/trunk/hudson-home/jobs/MAVEN-REPOSITORY-CLEAN/config.xml 2011-02-21 02:40:38 UTC (rev 13775)
+++ hudson/trunk/hudson-home/jobs/MAVEN-REPOSITORY-CLEAN/config.xml 2011-02-21 08:07:15 UTC (rev 13776)
@@ -11,7 +11,7 @@
USER=`whoami`
if [ -d /home/$USER/.m2/repository ]; then
- rm -rf /home/$USER/.m2/repository
+ rm -rf /home/$USER/.m2/repository/*
fi
if [ -d /data/maven-repos/hudson/repository ]; then
rm -rf /data/maven-repos/hudson/repository
13 years, 11 months
JBossWS SVN: r13775 - stack/native/trunk/modules/dist/src/main/scripts.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2011-02-20 21:40:38 -0500 (Sun, 20 Feb 2011)
New Revision: 13775
Modified:
stack/native/trunk/modules/dist/src/main/scripts/assembly-src-dist.xml
Log:
[JBWS-3080]:Fix the source assembly script
Modified: stack/native/trunk/modules/dist/src/main/scripts/assembly-src-dist.xml
===================================================================
--- stack/native/trunk/modules/dist/src/main/scripts/assembly-src-dist.xml 2011-02-20 13:33:17 UTC (rev 13774)
+++ stack/native/trunk/modules/dist/src/main/scripts/assembly-src-dist.xml 2011-02-21 02:40:38 UTC (rev 13775)
@@ -36,7 +36,7 @@
</includes>
</fileSet>
<fileSet>
- <directory>./../</directory>
+ <directory>../../</directory>
<outputDirectory>jbossws-native-src-dist/</outputDirectory>
<includes>
<include>.classpath</include>
13 years, 11 months
JBossWS SVN: r13774 - stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-client/main.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-20 08:33:17 -0500 (Sun, 20 Feb 2011)
New Revision: 13774
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml
Log:
[JBAS-8838] Adding missing dependencies on jbossws-cxf-client module
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml 2011-02-20 13:30:05 UTC (rev 13773)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/org/jboss/ws/cxf/jbossws-cxf-client/main/module.xml 2011-02-20 13:33:17 UTC (rev 13774)
@@ -31,6 +31,7 @@
<dependencies>
<module name="javax.api" />
<module name="javax.xml.bind.api" />
+ <module name="javax.xml.ws.api" />
<module name="org.jboss.ws.spi" />
<module name="org.jboss.ws.common" />
<module name="org.jboss.ws.cxf.jbossws-cxf-factories" services="import"/>
@@ -41,5 +42,6 @@
</imports>
</module>
<module name="org.apache.neethi" />
+ <module name="org.jboss.logging" />
</dependencies>
</module>
13 years, 11 months
JBossWS SVN: r13773 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-20 08:30:05 -0500 (Sun, 20 Feb 2011)
New Revision: 13773
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3223] Modify TCCL to ensure it can see the javax.xml.ws.spi.Provider implementation (as well as the rest of the integration implementation classes)
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-18 13:48:46 UTC (rev 13772)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2011-02-20 13:30:05 UTC (rev 13773)
@@ -21,7 +21,15 @@
*/
package org.jboss.wsf.stack.cxf.client;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.SecureClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceFeature;
@@ -34,8 +42,12 @@
/**
* A custom javax.xml.ws.spi.Provider implementation
- * extending the CXF one while adding few customizations
+ * extending the CXF one while adding few customizations.
*
+ * This also ensures a proper context classloader is set
+ * (required on JBoss AS 7, as the TCCL does not include
+ * implementation classes by default)
+ *
* @author alessio.soldano(a)jboss.com
* @since 27-Aug-2010
*
@@ -46,29 +58,49 @@
protected org.apache.cxf.jaxws.EndpointImpl createEndpointImpl(Bus bus, String bindingId, Object implementor,
WebServiceFeature... features)
{
- Boolean db = (Boolean)bus.getProperty(Constants.DEPLOYMENT_BUS);
- if (db != null && db)
+ ClassLoader origClassLoader = null;
+ try
{
- Logger.getLogger(ProviderImpl.class).info(
- "Cannot use the bus associated to the current deployment for starting a new endpoint, creating a new bus...");
- bus = BusFactory.newInstance().createBus();
+ origClassLoader = checkAndFixContextClassLoader();
+ Boolean db = (Boolean)bus.getProperty(Constants.DEPLOYMENT_BUS);
+ if (db != null && db)
+ {
+ Logger.getLogger(ProviderImpl.class).info(
+ "Cannot use the bus associated to the current deployment for starting a new endpoint, creating a new bus...");
+ bus = BusFactory.newInstance().createBus();
+ }
+ return super.createEndpointImpl(bus, bindingId, implementor, features);
}
- return super.createEndpointImpl(bus, bindingId, implementor, features);
+ finally
+ {
+ if (origClassLoader != null)
+ setContextClassLoader(origClassLoader);
+ }
}
@SuppressWarnings("rawtypes")
@Override
public ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls)
{
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
+ ClassLoader origClassLoader = null;
+ try
{
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ origClassLoader = checkAndFixContextClassLoader();
+ //we override this method to prevent using the default bus when the current
+ //thread is not already associated to a bus. In those situations we create
+ //a new bus from scratch instead and link that to the thread.
+ Bus bus = BusFactory.getThreadDefaultBus(false);
+ if (bus == null)
+ {
+ bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ }
+ return new ServiceImpl(bus, url, qname, cls);
}
- return new ServiceImpl(bus, url, qname, cls);
+ finally
+ {
+ if (origClassLoader != null)
+ setContextClassLoader(origClassLoader);
+ }
}
@SuppressWarnings("rawtypes")
@@ -76,14 +108,198 @@
public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
WebServiceFeature... features)
{
- //we override this method to prevent using the default bus when the current
- //thread is not already associated to a bus. In those situations we create
- //a new bus from scratch instead and link that to the thread.
- Bus bus = BusFactory.getThreadDefaultBus(false);
- if (bus == null)
+ ClassLoader origClassLoader = null;
+ try
{
- bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ origClassLoader = checkAndFixContextClassLoader();
+ //we override this method to prevent using the default bus when the current
+ //thread is not already associated to a bus. In those situations we create
+ //a new bus from scratch instead and link that to the thread.
+ Bus bus = BusFactory.getThreadDefaultBus(false);
+ if (bus == null)
+ {
+ bus = BusFactory.newInstance().createBus(); //this also set thread local bus internally as it's not set yet
+ }
+ return super.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass, features);
}
- return super.createServiceDelegate(wsdlDocumentLocation, serviceName, serviceClass, features);
+ finally
+ {
+ if (origClassLoader != null)
+ setContextClassLoader(origClassLoader);
+ }
}
+
+ /**
+ * Ensure the current context classloader can load this ProviderImpl class.
+ *
+ * @return The original classloader or null if it's not been changed
+ */
+ private static ClassLoader checkAndFixContextClassLoader()
+ {
+ ClassLoader origClassLoader = getContextClassLoader();
+ try
+ {
+ origClassLoader.loadClass(ProviderImpl.class.getName());
+ }
+ catch (Exception e)
+ {
+ setContextClassLoader(new DelegateClassLoader(ProviderImpl.class.getClassLoader(), origClassLoader));
+ return origClassLoader;
+ }
+ return null;
+ }
+
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Set context classloader.
+ *
+ * @param classLoader the classloader
+ */
+ static void setContextClassLoader(final ClassLoader classLoader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+ else
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ return null;
+ }
+ });
+ }
+ }
+
+ private static final class DelegateClassLoader extends SecureClassLoader
+ {
+ private ClassLoader delegate;
+
+ private ClassLoader parent;
+
+ public DelegateClassLoader(final ClassLoader delegate, final ClassLoader parent)
+ {
+ super(parent);
+ this.delegate = delegate;
+ this.parent = parent;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Class<?> loadClass(final String className) throws ClassNotFoundException
+ {
+ if (parent != null)
+ {
+ try
+ {
+ return parent.loadClass(className);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ //NOOP, use delegate
+ }
+ }
+ return delegate.loadClass(className);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public URL getResource(final String name)
+ {
+ URL url = null;
+ if (parent != null)
+ {
+ url = parent.getResource(name);
+ }
+ return (url == null) ? delegate.getResource(name) : url;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public Enumeration<URL> getResources(final String name) throws IOException
+ {
+ final ArrayList<Enumeration<URL>> foundResources = new ArrayList<Enumeration<URL>>();
+
+ foundResources.add(delegate.getResources(name));
+ foundResources.add(parent.getResources(name));
+
+ return new Enumeration<URL>()
+ {
+ private int position = foundResources.size() - 1;
+
+ public boolean hasMoreElements()
+ {
+ while (position >= 0)
+ {
+ if (foundResources.get(position).hasMoreElements())
+ {
+ return true;
+ }
+ position--;
+ }
+ return false;
+ }
+
+ public URL nextElement()
+ {
+ while (position >= 0)
+ {
+ try
+ {
+ return (foundResources.get(position)).nextElement();
+ }
+ catch (NoSuchElementException e)
+ {
+ }
+ position--;
+ }
+ throw new NoSuchElementException();
+ }
+ };
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public InputStream getResourceAsStream(final String name)
+ {
+ URL foundResource = getResource(name);
+ if (foundResource != null)
+ {
+ try
+ {
+ return foundResource.openStream();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ return null;
+ }
+ };
}
13 years, 11 months
JBossWS SVN: r13772 - in shared-testsuite/trunk/src/test: java/org/jboss/test/ws/jaxws and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-02-18 08:48:46 -0500 (Fri, 18 Feb 2011)
New Revision: 13772
Added:
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointBean.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java
shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web-ws.xml
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web.xml
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/wsdl/
shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl
Modified:
shared-testsuite/trunk/src/test/ant-import/build-jars-jaxws.xml
Log:
[JBWS-3223] Adding initial testcase
Modified: shared-testsuite/trunk/src/test/ant-import/build-jars-jaxws.xml
===================================================================
--- shared-testsuite/trunk/src/test/ant-import/build-jars-jaxws.xml 2011-02-18 12:21:35 UTC (rev 13771)
+++ shared-testsuite/trunk/src/test/ant-import/build-jars-jaxws.xml 2011-02-18 13:48:46 UTC (rev 13772)
@@ -1013,6 +1013,26 @@
</webinf>
</war>
+ <!-- jaxws-jbws3223 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3223.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3223/WEB-INF/web-ws.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3223/EndpointBean.class" />
+ <include name="org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.class" />
+ </classes>
+ </war>
+
+ <!-- jaxws-jbws3223-servlet -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-jbws3223-servlet.war" webxml="${tests.output.dir}/test-resources/jaxws/jbws3223/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/jbws3223/TestServlet.class" />
+ <include name="org/jboss/test/ws/jaxws/jbws3223/Client.class" />
+ <include name="org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.class" />
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/jbws3223/WEB-INF">
+ <include name="wsdl/**" />
+ </webinf>
+ </war>
+
<!-- jaxws-endpoint-servlet -->
<war warfile="${tests.output.dir}/test-libs/jaxws-endpoint-servlet.war" webxml="${tests.output.dir}/test-resources/jaxws/endpoint/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
Added: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java (rev 0)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/Client.java 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3223;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+
+public class Client
+{
+ public String run(String param, URL wsdlURL)
+ {
+ // Create the port
+ QName qname = new QName("http://org.jboss.ws/jaxws/jbws3223", "EndpointService");
+ Service service = Service.create(wsdlURL, qname);
+ EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
+
+ return port.echo(param);
+ }
+}
Added: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointBean.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointBean.java (rev 0)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointBean.java 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3223;
+
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws3223.EndpointInterface", targetNamespace = "http://org.jboss.ws/jaxws/jbws3223", serviceName = "EndpointService")
+public class EndpointBean implements EndpointInterface
+{
+ public String echo(String input)
+ {
+ return input;
+ }
+}
Added: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.java (rev 0)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointInterface.java 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3223;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(targetNamespace = "http://org.jboss.ws/jaxws/jbws3223")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointInterface
+{
+ @WebResult(partName = "result")
+ String echo(@WebParam(partName = "String_1") String input);
+}
Added: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java (rev 0)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/EndpointTestCase.java 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3223;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * [JBWS-3223] Runtime ws client classloader setup (on AS 7)
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 18-Feb-2011
+ */
+public class EndpointTestCase extends JBossWSTest
+{
+
+ public static Test suite()
+ {
+ return new TestSetup(new JBossWSTestSetup(EndpointTestCase.class, "jaxws-jbws3223-servlet.war jaxws-jbws3223.war"));
+ }
+
+ public void testWSDLAccess() throws Exception
+ {
+ readWSDL(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3223?wsdl"));
+ }
+
+ public void testClientAccess() throws Exception
+ {
+ String helloWorld = "Hello world!";
+ Client client = new Client();
+ Object retObj = client.run(helloWorld, getResourceURL("jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl"));
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testServletAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3223-servlet?param=hello-world");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("hello-world", br.readLine());
+ }
+
+ private void readWSDL(URL wsdlURL) throws Exception
+ {
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ Definition wsdlDefinition = wsdlReader.readWSDL(wsdlURL.toString());
+ assertNotNull(wsdlDefinition);
+ }
+
+}
Added: shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java
===================================================================
--- shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java (rev 0)
+++ shared-testsuite/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws3223/TestServlet.java 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws3223;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import java.net.URL;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@SuppressWarnings("serial")
+public class TestServlet extends HttpServlet
+{
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ // Invoke the endpoint
+ String param = req.getParameter("param");
+ Client client = new Client();
+ //URL wsdlURL = getServletContext().getResource("/WEB-INF/wsdl/TestService.wsdl");
+ URL wsdlURL = new URL("http://localhost:8080/jaxws-jbws3223?wsdl");
+ String retStr = client.run(param, wsdlURL);
+
+ // Return the result
+ PrintWriter pw = new PrintWriter(res.getWriter());
+ pw.print(retStr);
+ pw.close();
+ }
+}
Added: shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web-ws.xml
===================================================================
--- shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web-ws.xml (rev 0)
+++ shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web-ws.xml 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>EpService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3223.EndpointBean</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>EpService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web.xml
===================================================================
--- shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web.xml (rev 0)
+++ shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/web.xml 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3223.TestServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Added: shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl (rev 0)
+++ shared-testsuite/trunk/src/test/resources/jaxws/jbws3223/WEB-INF/wsdl/TestService.wsdl 2011-02-18 13:48:46 UTC (rev 13772)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="EndpointService" targetNamespace="http://org.jboss.ws/jaxws/jbws3223" xmlns:tns="http://org.jboss.ws/jaxws/jbws3223"
+ xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types/>
+ <message name="EndpointInterface_echo">
+ <part name="String_1" type="xsd:string"/>
+ </message>
+ <message name="EndpointInterface_echoResponse">
+ <part name="result" type="xsd:string"/>
+ </message>
+ <portType name="EndpointInterface">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:EndpointInterface_echo"/>
+ <output message="tns:EndpointInterface_echoResponse"/>
+ </operation>
+ </portType>
+ <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/jbws3223"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/jbws3223"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="EndpointService">
+ <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-jbws3223"/>
+ </port>
+ </service>
+</definitions>
13 years, 11 months