JBossWS SVN: r15140 - container/jboss70/branches/jbossws-jboss700/src/main/java/org/jboss/as/webservices/tomcat.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 06:18:19 -0400 (Wed, 19 Oct 2011)
New Revision: 15140
Modified:
container/jboss70/branches/jbossws-jboss700/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
Log:
[JBAS-8363] clarifying API - endpoint can be deployed to one virtual host only
Modified: container/jboss70/branches/jbossws-jboss700/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss70/branches/jbossws-jboss700/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2011-10-19 10:14:04 UTC (rev 15139)
+++ container/jboss70/branches/jbossws-jboss700/src/main/java/org/jboss/as/webservices/tomcat/WebMetaDataCreator.java 2011-10-19 10:18:19 UTC (rev 15140)
@@ -21,6 +21,7 @@
*/
package org.jboss.as.webservices.tomcat;
+import java.util.Arrays;
import java.util.List;
import org.jboss.as.server.deployment.DeploymentUnit;
@@ -139,9 +140,12 @@
}
// Set virtual hosts
- final List<String> virtualHosts = dep.getService().getVirtualHosts();
- log.debug("Setting virtual hosts: " + virtualHosts);
- jbossWebMD.setVirtualHosts(virtualHosts);
+ final String virtualHost = dep.getService().getVirtualHost();
+ if (virtualHost != null)
+ {
+ log.debug("Setting virtual host: " + virtualHost);
+ jbossWebMD.setVirtualHosts(Arrays.asList(virtualHost));
+ }
}
/**
13 years, 4 months
JBossWS SVN: r15139 - container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/tomcat.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 06:14:04 -0400 (Wed, 19 Oct 2011)
New Revision: 15139
Modified:
container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
Log:
sync with SPI
Modified: container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-10-19 10:12:30 UTC (rev 15138)
+++ container/jboss60/branches/jbossws-jboss610/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-10-19 10:14:04 UTC (rev 15139)
@@ -21,6 +21,7 @@
*/
package org.jboss.webservices.integration.tomcat;
+import java.util.Arrays;
import java.util.List;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -136,9 +137,12 @@
}
// Set virtual hosts
- final List<String> virtualHosts = dep.getService().getVirtualHosts();
- this.log.debug("Setting virtual hosts: " + virtualHosts);
- jbossWebMD.setVirtualHosts(virtualHosts);
+ final String virtualHost = dep.getService().getVirtualHost();
+ if (virtualHost != null)
+ {
+ this.log.debug("Setting virtual host: " + virtualHost);
+ jbossWebMD.setVirtualHosts(Arrays.asList(virtualHost));
+ }
}
/**
13 years, 4 months
JBossWS SVN: r15138 - container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 06:12:30 -0400 (Wed, 19 Oct 2011)
New Revision: 15138
Modified:
container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
Log:
sync with SPI
Modified: container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java
===================================================================
--- container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-10-19 10:04:10 UTC (rev 15137)
+++ container/jboss60/branches/jbossws-jboss600/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreator.java 2011-10-19 10:12:30 UTC (rev 15138)
@@ -21,6 +21,7 @@
*/
package org.jboss.webservices.integration.tomcat;
+import java.util.Arrays;
import java.util.List;
import org.jboss.deployers.structure.spi.DeploymentUnit;
@@ -136,9 +137,12 @@
}
// Set virtual hosts
- final List<String> virtualHosts = dep.getService().getVirtualHosts();
- this.log.debug("Setting virtual hosts: " + virtualHosts);
- jbossWebMD.setVirtualHosts(virtualHosts);
+ final String virtualHost = dep.getService().getVirtualHost();
+ if (virtualHost != null)
+ {
+ this.log.debug("Setting virtual host: " + virtualHost);
+ jbossWebMD.setVirtualHosts(Arrays.asList(virtualHost));
+ }
}
/**
13 years, 4 months
JBossWS SVN: r15137 - common/trunk/src/main/java/org/jboss/ws/common/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 06:04:10 -0400 (Wed, 19 Oct 2011)
New Revision: 15137
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
Log:
[JBAS-8363] clarifying API - endpoint can be deployed to one virtual host only
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-10-19 09:59:17 UTC (rev 15136)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultService.java 2011-10-19 10:04:10 UTC (rev 15137)
@@ -45,7 +45,7 @@
private Deployment dep;
private List<Endpoint> endpoints = new LinkedList<Endpoint>();
private String contextRoot;
- private List<String> virtualHosts;
+ private String virtualHost;
DefaultService()
{
@@ -110,24 +110,14 @@
this.contextRoot = contextRoot;
}
- public List<String> getVirtualHosts()
+ public String getVirtualHost()
{
- if ( virtualHosts != null )
- {
- final List<String> retVal = new LinkedList<String>();
- for ( String virtualHost : virtualHosts )
- {
- retVal.add( virtualHost );
- }
- return retVal;
- }
-
- return null;
+ return virtualHost;
}
- public void setVirtualHosts(List<String> virtualHosts)
+ public void setVirtualHost(String virtualHost)
{
- this.virtualHosts = virtualHosts;
+ this.virtualHost = virtualHost;
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties 2011-10-19 09:59:17 UTC (rev 15136)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties 2011-10-19 10:04:10 UTC (rev 15137)
@@ -13,7 +13,7 @@
INVOCATION_HANDLER_NOT_AVAILABLE=Invocation handler not available
CANNOT_STOP_ENDPOINT_IN_STATE=Cannot stop endpoint in state: {0}
COULD_NOT_FIND_IN_THE_ADDITIONAL_METADATAFILES=Could not find {0} in the additional metadatafiles!
-VIRTUALHOSTS_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=virtualHosts must be the same for all deployed endpoints
+VIRTUALHOST_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=virtualHost must be the same for all deployed endpoints
CANNOT_OBTAIN_SERVLET_MAPPING_FOR=Cannot obtain servlet mapping for: {0}
LIFECYCLEHANDLER_NOT_INITIALISED=LifecycleHandler not initialised
CANNOT_OBTAIN_CONTEXT_ROOT=Cannot obtain context root
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-10-19 09:59:17 UTC (rev 15136)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2011-10-19 10:04:10 UTC (rev 15137)
@@ -24,8 +24,6 @@
import static org.jboss.ws.common.integration.WSHelper.isJaxwsEjbDeployment;
-import java.util.Arrays;
-import java.util.List;
import java.util.ResourceBundle;
import org.jboss.ws.api.annotation.WebContext;
@@ -35,12 +33,12 @@
import org.jboss.wsf.spi.deployment.Endpoint;
/**
- * A deployer that assigns the virtual hosts to the service
+ * A deployment aspect that assigns the virtual host to a WS service.
*
* @author darran.lofthouse(a)jboss.com
- * @since 10-Jul-2008
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public class VirtualHostDeploymentAspect extends AbstractDeploymentAspect
+public final class VirtualHostDeploymentAspect extends AbstractDeploymentAspect
{
private static final ResourceBundle bundle = BundleUtils.getBundle(VirtualHostDeploymentAspect.class);
@@ -49,48 +47,41 @@
{
if (isJaxwsEjbDeployment(dep))
{
- dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
+ dep.getService().setVirtualHost(getExplicitVirtualHost(dep));
}
}
- protected List<String> getExplicitVirtualHosts(Deployment dep)
+ protected String getExplicitVirtualHost(final Deployment dep)
{
- String[] virtualHosts = null;
+ String virtualHost = null;
- // Use the virtual hosts from @WebContext.virtualHosts
- for (Endpoint ep : dep.getService().getEndpoints())
+ for (final Endpoint ep : dep.getService().getEndpoints())
{
- Class<?> implClass = ep.getTargetBeanClass();
- WebContext anWebContext = (WebContext)implClass.getAnnotation(WebContext.class);
- if (anWebContext != null && anWebContext.virtualHosts() != null && anWebContext.virtualHosts().length > 0)
- {
- String[] anVirtualHosts = anWebContext.virtualHosts();
- // Avoid modifying the annotation values.
- String[] temp = new String[anVirtualHosts.length];
- System.arraycopy(anVirtualHosts, 0, temp, 0, anVirtualHosts.length);
- Arrays.sort(temp);
+ final Class<?> implClass = ep.getTargetBeanClass();
+ final WebContext webContext = implClass.getAnnotation(WebContext.class);
- if (virtualHosts == null)
+ if (hasVirtualHost(webContext))
+ {
+ final String currentVirtualHost = webContext.virtualHost().trim();
+ if (virtualHost == null)
{
- virtualHosts = temp;
+ virtualHost = currentVirtualHost;
}
else
{
- if (Arrays.equals(virtualHosts, temp) == false)
+ if (!currentVirtualHost.equals(virtualHost))
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "VIRTUALHOSTS_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS"));
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "VIRTUALHOST_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS"));
}
}
}
}
- if ( virtualHosts != null )
- {
- return Arrays.asList(virtualHosts);
- }
- else
- {
- return null;
- }
+ return virtualHost;
}
+
+ private static boolean hasVirtualHost(final WebContext webContext) {
+ return webContext != null && webContext.virtualHost().trim().length() > 0;
+ }
+
}
13 years, 4 months
JBossWS SVN: r15136 - in spi/trunk/src/main/java/org/jboss/wsf/spi: deployment and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 05:59:17 -0400 (Wed, 19 Oct 2011)
New Revision: 15136
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContextImpl.java
spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
Log:
[JBAS-8363] clarifying API - endpoint can be deployed to one virtual host only
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContextImpl.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContextImpl.java 2011-10-19 09:39:53 UTC (rev 15135)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/annotation/WebContextImpl.java 2011-10-19 09:59:17 UTC (rev 15136)
@@ -36,7 +36,7 @@
{
private String contextRoot = "";
private String authmethod = "";
- private String[] virtualHosts = new String[] {};
+ private String virtualHost = "";
private String urlpattern = "";
private String transportGuarantee = "";
private boolean securedWsdl = false;
@@ -59,18 +59,18 @@
}
/**
- * The virtual hosts that the web service endpoint is deployed to.
+ * The virtual host that the web service endpoint is deployed to.
*
* Applies to server side port components only.
*/
- public String[] virtualHosts(){
- return virtualHosts;
+ public String virtualHost() {
+ return virtualHost;
};
- public void setVirtualHosts(String[] virtualHosts)
+ public void setVirtualHost(String virtualHost)
{
- this.virtualHosts = virtualHosts;
+ this.virtualHost = virtualHost;
}
/**
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-10-19 09:39:53 UTC (rev 15135)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/deployment/Service.java 2011-10-19 09:59:17 UTC (rev 15136)
@@ -58,10 +58,10 @@
/** Set the context root for this service */
void setContextRoot(String contextRoot);
- /** Get the virtual hosts for this service */
- List<String> getVirtualHosts();
+ /** Get the virtual host for this service */
+ String getVirtualHost();
- /** Set the virtual hosts for this service */
- void setVirtualHosts(List<String> virtualHosts);
+ /** Set the virtual host for this service */
+ void setVirtualHost(String virtualHost);
}
13 years, 4 months
JBossWS SVN: r15135 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-19 05:39:53 -0400 (Wed, 19 Oct 2011)
New Revision: 15135
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
Enabling some jaxrpc tests
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-19 09:39:14 UTC (rev 15134)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-10-19 09:39:53 UTC (rev 15135)
@@ -1161,6 +1161,11 @@
<version>2.0.0-beta-1</version>
</dependency>
<dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.12.1.GA</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<exclusions>
@@ -1329,20 +1334,20 @@
<!-- JAXR not available -->
<exclude>org/jboss/test/ws/jaxws/samples/jaxr/**</exclude>
- <!-- appclient not available for JAXRPC clients -->
- <exclude>org/jboss/test/ws/jaxrpc/samples/docstyle/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/exception/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/handler/**</exclude>
+ <!-- TODO: JSR109 w/ jaxrpc, remote JNDI support -->
<exclude>org/jboss/test/ws/jaxrpc/samples/jsr109ejb/**</exclude>
<exclude>org/jboss/test/ws/jaxrpc/samples/jsr109pojo/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/message/**</exclude>
+ <exclude>org/jboss/test/ws/jaxrpc/samples/secureejb/**</exclude>
+ <exclude>org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefClientTestCase*</exclude>
+ <exclude>org/jboss/test/ws/jaxrpc/samples/serviceref/ServiceRefEJBTestCase*</exclude>
+
+ <!-- TODO: investigate jaxrpc attachments -->
<exclude>org/jboss/test/ws/jaxrpc/samples/mtom/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/oneway/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/rpcstyle/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/secureejb/**</exclude>
- <exclude>org/jboss/test/ws/jaxrpc/samples/serviceref/**</exclude>
<exclude>org/jboss/test/ws/jaxrpc/samples/swa/**</exclude>
+ <!-- TODO: investigate saaj impl selection -->
+ <exclude>org/jboss/test/ws/jaxrpc/samples/handler/**</exclude>
+
</excludes>
</configuration>
</plugin>
13 years, 4 months
JBossWS SVN: r15134 - in shared-testsuite/trunk/testsuite/src/test: java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-10-19 05:39:14 -0400 (Wed, 19 Oct 2011)
New Revision: 15134
Modified:
shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
Log:
Updating some jaxrpc tests to avoid relying on remote jndi lookup
Modified: shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/ant-import/build-samples-jaxrpc.xml 2011-10-19 09:39:14 UTC (rev 15134)
@@ -292,6 +292,9 @@
<include name="webservices.xml"/>
<include name="wsdl/**"/>
</webinf>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.common"/>
+ </manifest>
</war>
<jar jarfile="${tests.output.dir}/test-libs/jaxrpc-samples-message-client.jar">
<fileset dir="${tests.output.dir}/test-classes">
@@ -318,6 +321,9 @@
<include name="webservices.xml"/>
<include name="wsdl/**"/>
</webinf>
+ <manifest>
+ <attribute name="Dependencies" value="org.jboss.ws.common,javax.mail.api services export,javax.activation.api services export"/>
+ </manifest>
</war>
<jar destfile="${tests.output.dir}/test-libs/jaxrpc-samples-mtom-client.jar">
<metainf dir="${tests.output.dir}/test-resources/jaxrpc/samples/mtom/META-INF">
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/bare/TrivialServiceDocBareTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -21,8 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.samples.docstyle.bare;
+import java.net.URL;
+
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import junit.framework.Test;
@@ -37,6 +41,8 @@
*/
public class TrivialServiceDocBareTestCase extends JBossWSTest
{
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/docstyle/bare";
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-docstyle-bare";
private static TrivialService port;
public static Test suite()
@@ -50,12 +56,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Object obj = iniCtx.lookup("java:comp/env/service/TrivialService");
- Service service = (Service)obj;
- port = (TrivialService)service.getPort(TrivialService.class);
+ port = getService(TrivialService.class, "SampleService", "TrivialServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testProducPurchase() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/docstyle/wrapped/TrivialServiceDocWrappedTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -21,8 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.samples.docstyle.wrapped;
+import java.net.URL;
+
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import junit.framework.Test;
@@ -37,6 +41,8 @@
*/
public class TrivialServiceDocWrappedTestCase extends JBossWSTest
{
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/docstyle/wrapped";
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-docstyle-wrapped";
private static TrivialService port;
public static Test suite()
@@ -50,11 +56,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TrivialService");
- port = (TrivialService)service.getPort(TrivialService.class);
+ port = getService(TrivialService.class, "SampleService", "TrivialServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testProducTrivial() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/exception/ExceptionTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxrpc.samples.exception;
import java.io.ByteArrayInputStream;
+import java.net.URL;
import java.rmi.RemoteException;
import javax.naming.InitialContext;
@@ -55,6 +56,7 @@
public class ExceptionTestCase extends JBossWSTest
{
private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/exception";
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-exception";
public static Test suite() throws Exception
{
@@ -63,10 +65,9 @@
private ExceptionServiceInterface getPort() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- ExceptionService service = (ExceptionService)iniCtx.lookup("java:comp/env/service/ExceptionService");
- ExceptionServiceInterface port = service.getPort();
- return port;
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, "ExceptionService"));
+ return (ExceptionServiceInterface)service.getPort(new QName(TARGET_NAMESPACE, "ExceptionServiceInterfacePort"), ExceptionServiceInterface.class);
}
/** Test creation of a SOAPFault */
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/handler/HeaderClientTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -21,8 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.samples.handler;
+import java.net.URL;
+
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.holders.StringHolder;
import junit.framework.Test;
@@ -39,6 +43,7 @@
public class HeaderClientTestCase extends JBossWSTest
{
public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxrpc-samples-handler";
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/handler";
private static HeaderTestService port;
@@ -53,11 +58,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (HeaderTestService)service.getPort(HeaderTestService.class);
+ port = getService(HeaderTestService.class, "TestService", "HeaderTestServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testBoundInHeader() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/holder/HolderTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -23,11 +23,13 @@
import java.math.BigDecimal;
import java.math.BigInteger;
+import java.net.URL;
import java.util.GregorianCalendar;
import javax.naming.InitialContext;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.holders.BigDecimalHolder;
import javax.xml.rpc.holders.BigIntegerHolder;
import javax.xml.rpc.holders.BooleanHolder;
@@ -62,6 +64,9 @@
*/
public class HolderTestCase extends JBossWSTest
{
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-holder";
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/holder";
+
private static HolderTestService port;
public static Test suite()
@@ -75,11 +80,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (HolderTestService)service.getPort(HolderTestService.class);
+ port = getService(HolderTestService.class, "TestService", "HolderTestServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testEchoBigDecimal() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/message/MessageTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -30,6 +30,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConnection;
@@ -61,6 +62,7 @@
public class MessageTestCase extends JBossWSTest
{
private final String TARGET_ENDPOINT = "http://" + getServerHost() + ":8080/jaxrpc-samples-message";
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/message";
/** Deploy the test ear */
public static Test suite() throws Exception
@@ -129,12 +131,11 @@
private MessageTestService getPort() throws Exception
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/MessageService");
- MessageTestService port = (MessageTestService)service.getPort(MessageTestService.class);
- return port;
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT + "?wsdl"), new QName(TARGET_NAMESPACE, "MessageService"));
+ return (MessageTestService)service.getPort(new QName(TARGET_NAMESPACE, "MessageTestServicePort"), MessageTestService.class);
}
-
+
private SOAPElement convertToSOAPElement(Element reqElement) throws TransformerException, SOAPException
{
SOAPElement parent = SOAPFactory.newInstance().createElement("dummy");
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/mtom/MTOMTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -24,10 +24,13 @@
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
+import java.net.URL;
import javax.activation.DataHandler;
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Stub;
import javax.xml.transform.stream.StreamSource;
@@ -45,6 +48,9 @@
*/
public class MTOMTestCase extends JBossWSTest
{
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/mtom";
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-mtom";
+
private static EmployeeRecords port;
/** Deploy the test ear */
@@ -59,11 +65,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/XOPTestService");
- port = (EmployeeRecords)service.getPort(EmployeeRecords.class);
+ port = getService(EmployeeRecords.class, "EmployeeService", "EmployeeRecordsPort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testUpdate() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/oneway/OneWayTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -21,8 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.samples.oneway;
+import java.net.URL;
+
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import junit.framework.Test;
@@ -37,6 +41,9 @@
*/
public class OneWayTestCase extends JBossWSTest
{
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-oneway";
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/oneway";
+
private static OneWayTestService port;
public static Test suite()
@@ -50,11 +57,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (OneWayTestService)service.getPort(OneWayTestService.class);
+ port = getService(OneWayTestService.class, "TestService", "OneWayTestServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testOneWay() throws Exception
{
Modified: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2011-10-19 09:33:41 UTC (rev 15133)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxrpc/samples/rpcstyle/TrivialServiceRpcTestCase.java 2011-10-19 09:39:14 UTC (rev 15134)
@@ -21,8 +21,12 @@
*/
package org.jboss.test.ws.jaxrpc.samples.rpcstyle;
+import java.net.URL;
+
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
import junit.framework.Test;
@@ -37,6 +41,9 @@
*/
public class TrivialServiceRpcTestCase extends JBossWSTest
{
+ private static final String TARGET_ENDPOINT_URL = "http://" + getServerHost() + ":8080/jaxrpc-samples-rpcstyle";
+ private static final String TARGET_NAMESPACE = "http://org.jboss.ws/samples/rpcstyle";
+
private static TrivialService port;
public static Test suite()
@@ -50,11 +57,15 @@
if (port == null)
{
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TrivialService");
- port = (TrivialService)service.getPort(TrivialService.class);
+ port = getService(TrivialService.class, "SampleService", "TrivialServicePort");
}
}
+
+ protected <T> T getService(final Class<T> clazz, final String serviceName, final String portName) throws Exception {
+ ServiceFactory serviceFactory = ServiceFactory.newInstance();
+ Service service = serviceFactory.createService(new URL(TARGET_ENDPOINT_URL + "?wsdl"), new QName(TARGET_NAMESPACE, serviceName));
+ return (T) service.getPort(new QName(TARGET_NAMESPACE, portName), clazz);
+ }
public void testTrivialAccess() throws Exception
{
13 years, 4 months
JBossWS SVN: r15133 - api/trunk/src/main/java/org/jboss/ws/api/annotation.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-10-19 05:33:41 -0400 (Wed, 19 Oct 2011)
New Revision: 15133
Modified:
api/trunk/src/main/java/org/jboss/ws/api/annotation/WebContext.java
Log:
[JBAS-8363] clarifying API - endpoint can be deployed to one virtual host only
Modified: api/trunk/src/main/java/org/jboss/ws/api/annotation/WebContext.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/annotation/WebContext.java 2011-10-19 09:28:52 UTC (rev 15132)
+++ api/trunk/src/main/java/org/jboss/ws/api/annotation/WebContext.java 2011-10-19 09:33:41 UTC (rev 15133)
@@ -45,11 +45,11 @@
String contextRoot() default "";
/**
- * The virtual hosts that the web service endpoint is deployed to.
+ * The virtual host that the web service endpoint is deployed to.
*
* Applies to server side port components only.
*/
- String[] virtualHosts() default {};
+ String virtualHost() default "";
/**
* Relative path that is appended to the contextRoot to form fully qualified
13 years, 4 months