JBossWS SVN: r10487 - in stack/cxf/trunk: src/main/scripts and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 12:58:40 -0400 (Tue, 04 Aug 2009)
New Revision: 10487
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.bat
stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.sh
stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.bat
stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.sh
stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
Log:
[JBWS-2707] Deploying plugin artifact required on Java 1.6
Modified: stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.bat
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.bat 2009-08-04 16:07:54 UTC (rev 10486)
+++ stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.bat 2009-08-04 16:58:40 UTC (rev 10487)
@@ -24,6 +24,9 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-common.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-framework.jar
+rem CXF XJC patched plugins
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/cxf-xjc-bug671.jar
+
rem shared jaxws libs
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/stax-api.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar
Modified: stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.sh
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.sh 2009-08-04 16:07:54 UTC (rev 10486)
+++ stack/cxf/trunk/modules/resources/src/main/resources/bin/wsconsume.sh 2009-08-04 16:58:40 UTC (rev 10487)
@@ -73,6 +73,9 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossws-common.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jbossws-framework.jar"
+# CXF XJC patched plugins
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/cxf-xjc-bug671.jar"
+
# shared jaxws libs
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/stax-api.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$LIBDIR/jaxb-api.jar"
Modified: stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.bat
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.bat 2009-08-04 16:07:54 UTC (rev 10486)
+++ stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.bat 2009-08-04 16:58:40 UTC (rev 10487)
@@ -23,6 +23,9 @@
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
+rem CXF XJC patched plugins
+set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/cxf-xjc-bug671.jar
+
rem shared jaxws libs
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxb-api.jar
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jaxb-impl.jar
Modified: stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.sh
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.sh 2009-08-04 16:07:54 UTC (rev 10486)
+++ stack/cxf/trunk/modules/resources/src/main/resources/bin/wsprovide.sh 2009-08-04 16:58:40 UTC (rev 10487)
@@ -74,6 +74,9 @@
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/log4j.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/mail.jar"
+# CXF XJC patched plugins
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/cxf-xjc-bug671.jar"
+
# shared jaxws libs
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxb-api.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$LIBDIR/jaxb-impl.jar"
Modified: stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2009-08-04 16:07:54 UTC (rev 10486)
+++ stack/cxf/trunk/src/main/scripts/assembly-deploy-artifacts.xml 2009-08-04 16:58:40 UTC (rev 10487)
@@ -23,6 +23,7 @@
<useStrictFiltering>true</useStrictFiltering>
<includes>
<include>org.apache.cxf:cxf-*</include>
+ <include>org.apache.cxf.xjcplugins:cxf-*</include>
<include>org.apache.geronimo.specs:geronimo-javamail*</include>
<include>org.apache.geronimo.specs:geronimo-ws-metadata*</include>
<include>javax.xml.bind:jaxb-api:jar</include>
15 years, 5 months
JBossWS SVN: r10486 - stack/metro/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 12:07:54 -0400 (Tue, 04 Aug 2009)
New Revision: 10486
Modified:
stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss520.txt
stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2247] Enabling tests
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-08-04 15:47:32 UTC (rev 10485)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-08-04 16:07:54 UTC (rev 10486)
@@ -24,9 +24,6 @@
# [JBWS-2131] NoSuchElementException during wsdl generation at deploy
org/jboss/test/ws/jaxws/jbws1702/**
-# [JBWS-2247] Write test for JBWS-1190 from scratch using MessageContext properties
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [JBWS-2308] faultCode argument for createFault was passed NULL
org/jboss/test/ws/jaxws/jbws2308/*TestCase.*
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-08-04 15:47:32 UTC (rev 10485)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-08-04 16:07:54 UTC (rev 10486)
@@ -24,9 +24,6 @@
# [JBWS-2131] NoSuchElementException during wsdl generation at deploy
org/jboss/test/ws/jaxws/jbws1702/**
-# [JBWS-2247] Write test for JBWS-1190 from scratch using MessageContext properties
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [JBWS-2308] faultCode argument for createFault was passed NULL
org/jboss/test/ws/jaxws/jbws2308/*TestCase.*
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-08-04 15:47:32 UTC (rev 10485)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-08-04 16:07:54 UTC (rev 10486)
@@ -24,9 +24,6 @@
# [JBWS-2131] NoSuchElementException during wsdl generation at deploy
org/jboss/test/ws/jaxws/jbws1702/**
-# [JBWS-2247] Write test for JBWS-1190 from scratch using MessageContext properties
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [JBWS-2308] faultCode argument for createFault was passed NULL
org/jboss/test/ws/jaxws/jbws2308/*TestCase.*
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss520.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-08-04 15:47:32 UTC (rev 10485)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-08-04 16:07:54 UTC (rev 10486)
@@ -24,9 +24,6 @@
# [JBWS-2131] NoSuchElementException during wsdl generation at deploy
org/jboss/test/ws/jaxws/jbws1702/**
-# [JBWS-2247] Write test for JBWS-1190 from scratch using MessageContext properties
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [JBWS-2308] faultCode argument for createFault was passed NULL
org/jboss/test/ws/jaxws/jbws2308/*TestCase.*
Modified: stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-08-04 15:47:32 UTC (rev 10485)
+++ stack/metro/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-08-04 16:07:54 UTC (rev 10486)
@@ -24,9 +24,6 @@
# [JBWS-2131] NoSuchElementException during wsdl generation at deploy
org/jboss/test/ws/jaxws/jbws1702/**
-# [JBWS-2247] Write test for JBWS-1190 from scratch using MessageContext properties
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [JBWS-2308] faultCode argument for createFault was passed NULL
org/jboss/test/ws/jaxws/jbws2308/*TestCase.*
15 years, 5 months
JBossWS SVN: r10485 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 11:47:32 -0400 (Tue, 04 Aug 2009)
New Revision: 10485
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
Log:
[JBWS-2247] Enabling tests
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-08-04 15:36:57 UTC (rev 10484)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss500.txt 2009-08-04 15:47:32 UTC (rev 10485)
@@ -11,9 +11,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-08-04 15:36:57 UTC (rev 10484)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2009-08-04 15:47:32 UTC (rev 10485)
@@ -11,9 +11,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-08-04 15:36:57 UTC (rev 10484)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2009-08-04 15:47:32 UTC (rev 10485)
@@ -11,9 +11,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-08-04 15:36:57 UTC (rev 10484)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss520.txt 2009-08-04 15:47:32 UTC (rev 10485)
@@ -11,9 +11,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-08-04 15:36:57 UTC (rev 10484)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2009-08-04 15:47:32 UTC (rev 10485)
@@ -11,9 +11,6 @@
# [CXF-1511] WrappedMessageContext does not implement SOAPMessageContext
org/jboss/test/ws/jaxws/binding/**
-# [CXF-1514][JBWS-2247] Generated WSDL does not take 'transport-guarantee' in web.xml into account
-org/jboss/test/ws/jaxws/jbws1190/**
-
# [CXF-1516] Type inheritance with document/literal/bare
org/jboss/test/ws/jaxws/jbws1702/**
15 years, 5 months
JBossWS SVN: r10484 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 11:36:57 -0400 (Tue, 04 Aug 2009)
New Revision: 10484
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
Log:
[JBWS-2247] Rewriting JBWS-1190 testcase leveraging address property in ManagedEndpoint to support all stacks
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2009-08-04 15:10:18 UTC (rev 10483)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2009-08-04 15:36:57 UTC (rev 10484)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -36,11 +36,9 @@
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ConfidentialEndpoint
{
-
// Intentionally no @WebMethod, see above
public String helloWorld(final String message)
{
return message;
}
-
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java 2009-08-04 15:10:18 UTC (rev 10483)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/Endpoint.java 2009-08-04 15:36:57 UTC (rev 10484)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -38,6 +38,6 @@
{
@WebMethod
- public void testAddress(final String archive, final String service, final String scheme, final String port);
+ public void test();
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java 2009-08-04 15:10:18 UTC (rev 10483)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/EndpointImpl.java 2009-08-04 15:36:57 UTC (rev 10484)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -21,25 +21,8 @@
*/
package org.jboss.test.ws.jaxws.jbws1190;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.List;
-import java.util.Map;
-
import javax.jws.WebService;
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-
/**
* [JBWS-1190] - WSDL generated for JSR-181 POJO does not take 'transport-guarantee' in web.xml into account
*
@@ -51,84 +34,8 @@
@WebService(serviceName = "EndpointService", targetNamespace = "http://org.jboss/test/ws/jbws1190", endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.Endpoint")
public class EndpointImpl implements Endpoint
{
-
- public void testAddress(final String archive, final String service, final String scheme, final String port)
+ public void test()
{
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();File tmpDir = serverConfig.getServerTempDir();
-
- File dataDir = serverConfig.getServerDataDir();
- File wsdlDir = new File(dataDir.getAbsolutePath() + File.separator + "wsdl" + File.separator + archive);
-
- if (wsdlDir.exists() == false)
- {
- throw new JBWS1190Exception(wsdlDir.getAbsolutePath() + " does not exist.");
- }
-
- File[] wsdls = wsdlDir.listFiles(new FilenameFilter() {
- public boolean accept(File dir, String name)
- {
- return name.startsWith(service);
- }
- });
-
- File wsdlFile = null;
- for (int i = 0; i < wsdls.length; i++)
- {
- if (wsdlFile == null || wsdls[i].compareTo(wsdlFile) > 0)
- {
- wsdlFile = wsdls[i];
- }
- }
- assertTrue("No WSDL files found", wsdlFile != null);
-
- Definition wsdl;
- try
- {
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdl = wsdlReader.readWSDL(wsdlFile.getAbsolutePath());
- }
- catch (WSDLException e)
- {
- throw new JBWS1190Exception("Error readin WSDL", e);
- }
-
- Map services = wsdl.getServices();
- assertEquals("No of services", 1, services.size());
-
- Service _service = (Service)services.values().iterator().next();
- Map ports = _service.getPorts();
- assertEquals("No of endpoints", 1, ports.size());
- Port _port = (Port)ports.values().iterator().next();
-
- List extElements = _port.getExtensibilityElements();
- String address = null;
- for (int i = 0; i < extElements.size(); i++)
- {
- if (extElements.get(i) instanceof SOAPAddress)
- {
- SOAPAddress soapAddrExtElement = (SOAPAddress)extElements.get(i);
- address = soapAddrExtElement.getLocationURI();
- }
- }
- assertTrue("Address is null", address != null);
- assertTrue("Expected Scheme '" + scheme + "' from address '" + address + "'", address.startsWith(scheme + "://"));
- assertTrue("Expected Port '" + port + "' from address '" + address + "'", address.indexOf(":" + port + "/") > -1);
+ System.out.println("test");
}
-
- private void assertEquals(final String message, final int expected, final int actual)
- {
- if (expected != actual)
- {
- throw new JBWS1190Exception(message + " expected=" + expected + " actual=" + actual);
- }
- }
-
- private void assertTrue(final String message, final boolean value)
- {
- if (value == false)
- {
- throw new JBWS1190Exception(message);
- }
- }
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2009-08-04 15:10:18 UTC (rev 10483)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2009-08-04 15:36:57 UTC (rev 10484)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -23,6 +23,8 @@
import java.net.URL;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
@@ -37,38 +39,30 @@
* http://jira.jboss.org/jira/browse/JBWS-1190
*
* @author darran.lofthouse(a)jboss.com
+ * @author alessio.soldano(a)jboss.com
* @since 19-October-2006
*/
public class JBWS1190TestCase extends JBossWSTest
{
- private static final String ARCHIVE_NAME = "jaxws-jbws1190.war";
-
- private static Endpoint port;
-
public static Test suite()
{
- return new JBossWSTestSetup(JBWS1190TestCase.class, ARCHIVE_NAME);
+ return new JBossWSTestSetup(JBWS1190TestCase.class, "jaxws-jbws1190.war");
}
-
- protected void setUp() throws Exception
+
+ public void testEndpointAddress() throws Exception
{
- if (port == null)
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1190/Endpoint?wsdl");
- QName qname = new QName("http://org.jboss/test/ws/jbws1190", "EndpointService");
- Service service = Service.create(wsdlURL, qname);
- port = (Endpoint)service.getPort(Endpoint.class);
- }
+ MBeanServerConnection server = getServer();
+ ObjectName oname = new ObjectName("jboss.ws:context=jaxws-jbws1190,endpoint=Endpoint");
+ String address = (String)server.getAttribute(oname, "Address");
+ assertTrue("Expected http address, but got: " + address, address.startsWith("http://"));
}
- public void testEndpoint() throws Exception
+ public void testConfidentialEndpointAddress() throws Exception
{
- port.testAddress(ARCHIVE_NAME, "EndpointService", "http", "8080");
+ MBeanServerConnection server = getServer();
+ ObjectName oname = new ObjectName("jboss.ws:context=jaxws-jbws1190,endpoint=ConfidentialEndpoint");
+ String address = (String)server.getAttribute(oname, "Address");
+ assertTrue("Expected https address, but got: " + address, address.startsWith("https://"));
}
-
- public void testConfidentialEndpoint() throws Exception
- {
- port.testAddress(ARCHIVE_NAME, "ConfidentialService", "https", "8443");
- }
}
15 years, 5 months
JBossWS SVN: r10483 - framework/trunk/src/main/java/org/jboss/wsf/framework/management.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 11:10:18 -0400 (Tue, 04 Aug 2009)
New Revision: 10483
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
Log:
[JBWS-2247] Adding address property to managed endpoint (which might generally be useful btw)
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2009-08-04 13:45:10 UTC (rev 10482)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java 2009-08-04 15:10:18 UTC (rev 10483)
@@ -52,6 +52,11 @@
this.endpoint = endpoint;
this.mbeanServer = mbeanServer;
}
+
+ public String getAddress()
+ {
+ return endpoint.getAddress();
+ }
public long getAverageProcessingTime()
{
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2009-08-04 13:45:10 UTC (rev 10482)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java 2009-08-04 15:10:18 UTC (rev 10483)
@@ -36,6 +36,8 @@
void start();
void stop();
+
+ String getAddress();
Date getStartTime();
15 years, 5 months
JBossWS SVN: r10482 - framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-04 09:45:10 -0400 (Tue, 04 Aug 2009)
New Revision: 10482
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
Log:
[JBWS-2332] refactoring fix
Modified: framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
===================================================================
--- framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2009-08-04 13:22:43 UTC (rev 10481)
+++ framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2009-08-04 13:45:10 UTC (rev 10482)
@@ -26,7 +26,6 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
-import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -100,7 +99,10 @@
if ( virtualHosts != null )
{
final List<String> retVal = new LinkedList<String>();
- Collections.copy(retVal, virtualHosts);
+ for ( String virtualHost : virtualHosts )
+ {
+ retVal.add( virtualHost );
+ }
return retVal;
}
15 years, 5 months
JBossWS SVN: r10481 - framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-08-04 09:22:43 -0400 (Tue, 04 Aug 2009)
New Revision: 10481
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
Log:
[JBWS-2203] Fixing testcase
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-08-04 13:18:57 UTC (rev 10480)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointEJB.java 2009-08-04 13:22:43 UTC (rev 10481)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.context;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -85,7 +87,7 @@
return "fail";
// Check standard jaxws properties
- InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Object wsdl = msgContext.get(MessageContext.WSDL_DESCRIPTION);
QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
@@ -102,8 +104,21 @@
try
{
- Element root = DOMUtils.parse(wsdlSource);
- new DOMWriter(System.out).setPrettyprint(true).print(root);
+ Element root = null;
+ if (wsdl instanceof InputSource)
+ {
+ root = DOMUtils.parse((InputSource)wsdl);
+ }
+ else if (wsdl instanceof URI)
+ {
+ root = DOMUtils.parse(((URI)wsdl).toURL().openStream());
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ new DOMWriter(out).setPrettyprint(true).print(root);
+ if (!out.toString().contains("http://schemas.xmlsoap.org/wsdl/"))
+ {
+ throw new WebServiceException("Not a wsdl");
+ }
}
catch (IOException ex)
{
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-08-04 13:18:57 UTC (rev 10480)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/EndpointJSE.java 2009-08-04 13:22:43 UTC (rev 10481)
@@ -21,7 +21,9 @@
*/
package org.jboss.test.ws.jaxws.samples.context;
+import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.net.URI;
import java.security.Principal;
import javax.annotation.Resource;
@@ -61,7 +63,7 @@
return "fail";
// Check standard jaxws properties
- InputSource wsdlSource = (InputSource)msgContext.get(MessageContext.WSDL_DESCRIPTION);
+ Object wsdl = msgContext.get(MessageContext.WSDL_DESCRIPTION);
QName service = (QName)msgContext.get(MessageContext.WSDL_SERVICE);
QName portType = (QName)msgContext.get(MessageContext.WSDL_INTERFACE);
QName port = (QName)msgContext.get(MessageContext.WSDL_PORT);
@@ -76,15 +78,30 @@
if (!operation.equals(new QName("http://org.jboss.ws/jaxws/context", "testMessageContextProperties")))
throw new WebServiceException("Invalid qname: " + operation);
+
try
{
- Element root = DOMUtils.parse(wsdlSource);
- new DOMWriter(System.out).setPrettyprint(true).print(root);
+ Element root = null;
+ if (wsdl instanceof InputSource)
+ {
+ root = DOMUtils.parse((InputSource)wsdl);
+ }
+ else if (wsdl instanceof URI)
+ {
+ root = DOMUtils.parse(((URI)wsdl).toURL().openStream());
+ }
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ new DOMWriter(out).setPrettyprint(true).print(root);
+ if (!out.toString().contains("http://schemas.xmlsoap.org/wsdl/"))
+ {
+ throw new WebServiceException("Not a wsdl");
+ }
}
catch (IOException ex)
{
throw new WebServiceException("Cannot parse MessageContext.WSDL_DESCRIPTION", ex);
}
+
return "pass";
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2009-08-04 13:18:57 UTC (rev 10480)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase.java 2009-08-04 13:22:43 UTC (rev 10481)
@@ -77,12 +77,6 @@
return;
}
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [JBWS-2203] Implement CXF standard message context properties");
- return;
- }
-
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
Modified: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2009-08-04 13:18:57 UTC (rev 10480)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/context/WebServiceContextJSETestCase.java 2009-08-04 13:22:43 UTC (rev 10481)
@@ -76,12 +76,6 @@
return;
}
- if (isIntegrationCXF())
- {
- System.out.println("FIXME: [JBWS-2203] Implement CXF standard message context properties");
- return;
- }
-
String retStr = port.testMessageContextProperties();
assertEquals("pass", retStr);
}
15 years, 5 months
JBossWS SVN: r10480 - in container/jboss50/branches/ropalka-jboss510: src/main/java/org/jboss/webservices/integration/metadata and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-04 09:18:57 -0400 (Tue, 04 Aug 2009)
New Revision: 10480
Added:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebAppGeneratorDeploymentAspect.java
Modified:
container/jboss50/branches/ropalka-jboss510/.classpath
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2332] refactoring
Modified: container/jboss50/branches/ropalka-jboss510/.classpath
===================================================================
--- container/jboss50/branches/ropalka-jboss510/.classpath 2009-08-04 13:15:48 UTC (rev 10479)
+++ container/jboss50/branches/ropalka-jboss510/.classpath 2009-08-04 13:18:57 UTC (rev 10480)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/jbossws-jboss.jar"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources/jbossws-jboss.deployer"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-08-04 13:15:48 UTC (rev 10479)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-08-04 13:18:57 UTC (rev 10480)
@@ -40,8 +40,10 @@
/** JSE meta data builder. */
private MetaDataBuilderJSE metaDataBuilderJSE = new MetaDataBuilderJSE();
+
/** EJB3 meta data builder. */
private MetaDataBuilderEJB3 metaDataBuilderEJB3 = new MetaDataBuilderEJB3();
+
/** EJB21 meta data builder. */
private MetaDataBuilderEJB21 metaDataBuilderEJB21 = new MetaDataBuilderEJB21();
Deleted: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebAppGeneratorDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebAppGeneratorDeploymentAspect.java 2009-08-04 13:15:48 UTC (rev 10479)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebAppGeneratorDeploymentAspect.java 2009-08-04 13:18:57 UTC (rev 10480)
@@ -1,286 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.webservices.integration.tomcat;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.AuthConstraintMetaData;
-import org.jboss.metadata.web.spec.LoginConfigMetaData;
-import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.TransportGuaranteeType;
-import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-import org.jboss.wsf.common.integration.WSHelper;
-import org.jboss.wsf.spi.annotation.WebContext;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-
-/**
- * A deployment aspect that generates a webapp for an EJB endpoint
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-public final class WebAppGeneratorDeploymentAspect extends DeploymentAspect
-{
- private SecurityBuilder securityBuilderEJB21;
- private SecurityBuilder securityBuilderEJB3;
-
- public void setSecurityBuilderEJB21( final SecurityBuilder builder )
- {
- this.securityBuilderEJB21 = builder;
- }
-
- public void setSecurityBuilderEJB3( final SecurityBuilder builder )
- {
- this.securityBuilderEJB3 = builder;
- }
-
- @Override
- public void start(Deployment dep)
- {
- final DeploymentUnit unit = WSHelper.getRequiredAttachment( dep, DeploymentUnit.class );
-
- if ( WSHelper.isJaxrpcEjbDeployment( dep ) )
- {
- JBossWebMetaData jbwmd = generateWebDeployment(dep, securityBuilderEJB21);
- dep.addAttachment(JBossWebMetaData.class, jbwmd);
- unit.addAttachment(JBossWebMetaData.class, jbwmd);
- }
- else if ( WSHelper.isJaxwsEjbDeployment( dep ) )
- {
- JBossWebMetaData jbwmd = generateWebDeployment(dep, securityBuilderEJB3);
- dep.addAttachment(JBossWebMetaData.class, jbwmd);
- unit.addAttachment(JBossWebMetaData.class, jbwmd);
- }
- }
-
- protected JBossWebMetaData generateWebDeployment(Deployment dep, SecurityBuilder securityHandler)
- {
- JBossWebMetaData jbwmd = new JBossWebMetaData();
- createWebAppDescriptor(dep, jbwmd, securityHandler);
- createJBossWebAppDescriptor(dep, jbwmd, securityHandler);
- return jbwmd;
- }
-
- protected void createWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityBuilder securityHandler)
- {
- /*
- <servlet>
- <servlet-name>
- <servlet-class>
- </servlet>
- */
- JBossServletsMetaData servlets = jbwmd.getServlets();
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- JBossServletMetaData servlet = new JBossServletMetaData();
- servlet.setServletName(ep.getShortName());
- servlet.setServletClass(ep.getTargetBeanName());
- servlets.add(servlet);
- }
-
- /*
- <servlet-mapping>
- <servlet-name>
- <url-pattern>
- </servlet-mapping>
- */
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
- if (servletMappings == null)
- {
- servletMappings = new ArrayList<ServletMappingMetaData>();
- jbwmd.setServletMappings(servletMappings);
- }
- ServletMappingMetaData servletMapping = new ServletMappingMetaData();
- servletMapping.setServletName(ep.getShortName());
- servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
- servletMappings.add(servletMapping);
- }
-
- String authMethod = null;
-
- // Add web-app/security-constraint for each port component
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- String ejbName = ep.getShortName();
-
- Boolean secureWSDLAccess = null;
- String transportGuarantee = null;
- String beanAuthMethod = null;
-
- WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
- if (anWebContext != null)
- {
- if (anWebContext.authMethod().length() > 0)
- beanAuthMethod = anWebContext.authMethod();
- if (anWebContext.transportGuarantee().length() > 0)
- transportGuarantee = anWebContext.transportGuarantee();
- if (anWebContext.secureWSDLAccess())
- secureWSDLAccess = anWebContext.secureWSDLAccess();
- }
-
- EJBArchiveMetaData appMetaData = WSHelper.getOptionalAttachment( dep, EJBArchiveMetaData.class );
- if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
- {
- EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
- EJBSecurityMetaData smd = bmd.getSecurityMetaData();
- if (smd != null)
- {
- beanAuthMethod = smd.getAuthMethod();
- transportGuarantee = smd.getTransportGuarantee();
- secureWSDLAccess = smd.getSecureWSDLAccess();
- }
- }
-
- if (beanAuthMethod != null || transportGuarantee != null)
- {
- /*
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>TestUnAuthPort</web-resource-name>
- <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>*</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
- */
- List<SecurityConstraintMetaData> securityContraints = jbwmd.getSecurityContraints();
- if (securityContraints == null)
- {
- securityContraints = new ArrayList<SecurityConstraintMetaData>();
- jbwmd.setSecurityContraints(securityContraints);
- }
- SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
- securityContraints.add(securityConstraint);
-
- WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
- if (resourceCollections == null)
- {
- resourceCollections = new WebResourceCollectionsMetaData();
- securityConstraint.setResourceCollections(resourceCollections);
- }
- WebResourceCollectionMetaData resourceCollection = new WebResourceCollectionMetaData();
- resourceCollections.add(resourceCollection);
-
- resourceCollection.setWebResourceName(ejbName);
- resourceCollection.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
- ArrayList<String> httpMethods = new ArrayList<String>();
- resourceCollection.setHttpMethods(httpMethods);
- if (Boolean.TRUE.equals(secureWSDLAccess))
- {
- httpMethods.add("GET");
- }
- httpMethods.add("POST");
-
- // Optional auth-constraint
- if (beanAuthMethod != null)
- {
- // Only the first auth-method gives the war login-config/auth-method
- if (authMethod == null)
- authMethod = beanAuthMethod;
-
- AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
- authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
- securityConstraint.setAuthConstraint(authConstraint);
- }
- // Optional user-data-constraint
- if (transportGuarantee != null)
- {
- UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
- userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
- securityConstraint.setUserDataConstraint(userDataConstraint);
- }
- }
- }
-
- // Optional login-config/auth-method
- if (authMethod != null && securityHandler != null)
- {
- LoginConfigMetaData loginConfig = jbwmd.getLoginConfig();
- if (loginConfig == null)
- {
- loginConfig = new LoginConfigMetaData();
- jbwmd.setLoginConfig(loginConfig);
- }
- loginConfig.setAuthMethod(authMethod);
- loginConfig.setRealmName("EJBServiceEndpointServlet Realm");
-
- securityHandler.addSecurityRoles(jbwmd, dep);
- }
- }
-
- /**
- * Creates jboss-web meta data.
- *
- * <jboss-web>
- * <security-domain>java:/jaas/custom-security-domain</security-domain>
- * <context-root>/custom-context-root</context-root>
- * <virtual-host>custom-virtual-host</virtual-host>
- * </jboss-web>
- *
- * @param dep
- * @param jbwmd
- * @param securityHandler
- */
- protected void createJBossWebAppDescriptor
- (
- final Deployment dep, final JBossWebMetaData jbossWebMD, final SecurityBuilder securityHandler
- )
- {
- // Set security domain
- if (securityHandler != null)
- {
- securityHandler.addSecurityDomain(jbossWebMD, dep);
- }
-
- // Set context root
- String contextRoot = dep.getService().getContextRoot();
- jbossWebMD.setContextRoot(contextRoot);
-
- // Set virtual hosts
- String[] virtualHosts = dep.getService().getVirtualHosts();
- if (virtualHosts != null && virtualHosts.length > 0)
- {
- jbossWebMD.setVirtualHosts(Arrays.asList(virtualHosts));
- }
- }
-
-}
Added: container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java (rev 0)
+++ container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/tomcat/WebMetaDataCreatingDeploymentAspect.java 2009-08-04 13:18:57 UTC (rev 10480)
@@ -0,0 +1,323 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.webservices.integration.tomcat;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.AuthConstraintMetaData;
+import org.jboss.metadata.web.spec.LoginConfigMetaData;
+import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.TransportGuaranteeType;
+import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+
+/**
+ * A deployment aspect that generates web app meta data for EJB endpoints.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ */
+public final class WebMetaDataCreatingDeploymentAspect extends DeploymentAspect
+{
+
+ /** EJB 21 security builder. */
+ private SecurityBuilder securityBuilderEJB21;
+
+ /** EJB 3 security builder. */
+ private SecurityBuilder securityBuilderEJB3;
+
+ /**
+ * Constructor.
+ */
+ public WebMetaDataCreatingDeploymentAspect()
+ {
+ super();
+ }
+
+ /**
+ * Sets EJB 21 security builder. This method is called using MC injection.
+ *
+ * @param builder EJB 21 security builder
+ */
+ public void setSecurityBuilderEJB21( final SecurityBuilder builder )
+ {
+ this.securityBuilderEJB21 = builder;
+ }
+
+ /**
+ * Sets EJB 3 security builder. This method is called using MC injection.
+ *
+ * @param builder EJB 3 security builder
+ */
+ public void setSecurityBuilderEJB3( final SecurityBuilder builder )
+ {
+ this.securityBuilderEJB3 = builder;
+ }
+
+ /**
+ * Creates web meta data for EJB deployments.
+ *
+ * @param dep webservice deployment
+ */
+ public void start( final Deployment dep )
+ {
+ final boolean isEjbDeployment = WSHelper.isEjbDeployment( dep );
+
+ if ( isEjbDeployment )
+ {
+ final DeploymentUnit unit = WSHelper.getRequiredAttachment( dep, DeploymentUnit.class );
+ final JBossWebMetaData jbossWebMD = this.createWebMetaData( dep );
+
+ dep.addAttachment( JBossWebMetaData.class, jbossWebMD );
+ unit.addAttachment( JBossWebMetaData.class, jbossWebMD );
+ }
+ }
+
+ /**
+ * Creates web meta data for EJB deployment.
+ *
+ * @param dep webservice deployment
+ * @return web meta data for EJB deployment
+ */
+ private JBossWebMetaData createWebMetaData( final Deployment dep )
+ {
+ final JBossWebMetaData jbossWebMD = new JBossWebMetaData();
+
+ this.createWebAppDescriptor( dep, jbossWebMD );
+ this.createJBossWebAppDescriptor( dep, jbossWebMD );
+
+ return jbossWebMD;
+ }
+
+ private void createWebAppDescriptor( final Deployment dep, final JBossWebMetaData jbwmd )
+ {
+ /*
+ <servlet>
+ <servlet-name>
+ <servlet-class>
+ </servlet>
+ */
+ JBossServletsMetaData servlets = jbwmd.getServlets();
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ JBossServletMetaData servlet = new JBossServletMetaData();
+ servlet.setServletName(ep.getShortName());
+ servlet.setServletClass(ep.getTargetBeanName());
+ servlets.add(servlet);
+ }
+
+ /*
+ <servlet-mapping>
+ <servlet-name>
+ <url-pattern>
+ </servlet-mapping>
+ */
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
+ if (servletMappings == null)
+ {
+ servletMappings = new ArrayList<ServletMappingMetaData>();
+ jbwmd.setServletMappings(servletMappings);
+ }
+ ServletMappingMetaData servletMapping = new ServletMappingMetaData();
+ servletMapping.setServletName(ep.getShortName());
+ servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+ servletMappings.add(servletMapping);
+ }
+
+ String authMethod = null;
+
+ // Add web-app/security-constraint for each port component
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String ejbName = ep.getShortName();
+
+ Boolean secureWSDLAccess = null;
+ String transportGuarantee = null;
+ String beanAuthMethod = null;
+
+ WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
+ if (anWebContext != null)
+ {
+ if (anWebContext.authMethod().length() > 0)
+ beanAuthMethod = anWebContext.authMethod();
+ if (anWebContext.transportGuarantee().length() > 0)
+ transportGuarantee = anWebContext.transportGuarantee();
+ if (anWebContext.secureWSDLAccess())
+ secureWSDLAccess = anWebContext.secureWSDLAccess();
+ }
+
+ EJBArchiveMetaData appMetaData = WSHelper.getOptionalAttachment( dep, EJBArchiveMetaData.class );
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
+ {
+ EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
+ EJBSecurityMetaData smd = bmd.getSecurityMetaData();
+ if (smd != null)
+ {
+ beanAuthMethod = smd.getAuthMethod();
+ transportGuarantee = smd.getTransportGuarantee();
+ secureWSDLAccess = smd.getSecureWSDLAccess();
+ }
+ }
+
+ if (beanAuthMethod != null || transportGuarantee != null)
+ {
+ /*
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestUnAuthPort</web-resource-name>
+ <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>*</role-name>
+ </auth-constraint>
+ <user-data-constraint>
+ <transport-guarantee>NONE</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+ */
+ List<SecurityConstraintMetaData> securityContraints = jbwmd.getSecurityContraints();
+ if (securityContraints == null)
+ {
+ securityContraints = new ArrayList<SecurityConstraintMetaData>();
+ jbwmd.setSecurityContraints(securityContraints);
+ }
+ SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
+ securityContraints.add(securityConstraint);
+
+ WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
+ if (resourceCollections == null)
+ {
+ resourceCollections = new WebResourceCollectionsMetaData();
+ securityConstraint.setResourceCollections(resourceCollections);
+ }
+ WebResourceCollectionMetaData resourceCollection = new WebResourceCollectionMetaData();
+ resourceCollections.add(resourceCollection);
+
+ resourceCollection.setWebResourceName(ejbName);
+ resourceCollection.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+ ArrayList<String> httpMethods = new ArrayList<String>();
+ resourceCollection.setHttpMethods(httpMethods);
+ if (Boolean.TRUE.equals(secureWSDLAccess))
+ {
+ httpMethods.add("GET");
+ }
+ httpMethods.add("POST");
+
+ // Optional auth-constraint
+ if (beanAuthMethod != null)
+ {
+ // Only the first auth-method gives the war login-config/auth-method
+ if (authMethod == null)
+ authMethod = beanAuthMethod;
+
+ AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
+ authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
+ securityConstraint.setAuthConstraint(authConstraint);
+ }
+ // Optional user-data-constraint
+ if (transportGuarantee != null)
+ {
+ UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
+ userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
+ securityConstraint.setUserDataConstraint(userDataConstraint);
+ }
+ }
+ }
+
+ // Optional login-config/auth-method
+ if (authMethod != null)
+ {
+ LoginConfigMetaData loginConfig = jbwmd.getLoginConfig();
+ if (loginConfig == null)
+ {
+ loginConfig = new LoginConfigMetaData();
+ jbwmd.setLoginConfig(loginConfig);
+ }
+ loginConfig.setAuthMethod(authMethod);
+ loginConfig.setRealmName("EJBServiceEndpointServlet Realm");
+
+ final SecurityBuilder securityBuilder = this.getSecurityBuilder( dep );
+ securityBuilder.addSecurityRoles(jbwmd, dep);
+ }
+ }
+
+ /**
+ * Creates jboss-web meta data.
+ *
+ * <jboss-web>
+ * <security-domain>java:/jaas/custom-security-domain</security-domain>
+ * <context-root>/custom-context-root</context-root>
+ * <virtual-host>custom-virtual-host-1</virtual-host>
+ * ...
+ * <virtual-host>custom-virtual-host-N</virtual-host>
+ * </jboss-web>
+ *
+ * @param dep webservice deployment
+ * @param jbossWebMD jboss web meta data
+ */
+ private void createJBossWebAppDescriptor( final Deployment dep, final JBossWebMetaData jbossWebMD )
+ {
+ // Set security domain
+ final SecurityBuilder securityBuilder = this.getSecurityBuilder( dep );
+ securityBuilder.addSecurityDomain( jbossWebMD, dep );
+
+ // Set context root
+ final String contextRoot = dep.getService().getContextRoot();
+ jbossWebMD.setContextRoot( contextRoot );
+
+ // Set virtual hosts
+ final List<String> virtualHosts = dep.getService().getVirtualHosts();
+ jbossWebMD.setVirtualHosts( virtualHosts );
+ }
+
+ /**
+ * Returns security builder associated with EJB deployment.
+ *
+ * @param dep webservice EJB deployment
+ * @return security builder for EJB deployment
+ */
+ private SecurityBuilder getSecurityBuilder( final Deployment dep )
+ {
+ final boolean isJaxws = WSHelper.isJaxwsDeployment( dep );
+
+ return isJaxws ? this.securityBuilderEJB3 : this.securityBuilderEJB21;
+ }
+
+}
Modified: container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
--- container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-04 13:15:48 UTC (rev 10479)
+++ container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-08-04 13:18:57 UTC (rev 10480)
@@ -142,7 +142,7 @@
<property name="relativeOrder">33</property> <!-- [JBDEPLOY-201] workaround -->
</bean>
- <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.webservices.integration.tomcat.WebAppGeneratorDeploymentAspect">
+ <bean name="WSWebMetaDataCreatingDeploymentAspect" class="org.jboss.webservices.integration.tomcat.WebMetaDataCreatingDeploymentAspect">
<property name="requires">VirtualHosts,URLPattern</property>
<property name="provides">WebMetaData</property>
<property name="securityBuilderEJB21"><inject bean="WSSecurityBuilderEJB21"/></property>
15 years, 5 months
JBossWS SVN: r10479 - framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-08-04 09:15:48 -0400 (Tue, 04 Aug 2009)
New Revision: 10479
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
Log:
[JBWS-2332] fix Service consistency
Modified: framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java
===================================================================
--- framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2009-08-04 13:14:08 UTC (rev 10478)
+++ framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/DefaultService.java 2009-08-04 13:15:48 UTC (rev 10479)
@@ -26,6 +26,7 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -43,7 +44,7 @@
private Deployment dep;
private List<Endpoint> endpoints = new LinkedList<Endpoint>();
private String contextRoot;
- private String[] virtualHosts;
+ private List<String> virtualHosts;
DefaultService()
{
@@ -94,12 +95,19 @@
this.contextRoot = contextRoot;
}
- public String[] getVirtualHosts()
+ public List<String> getVirtualHosts()
{
- return virtualHosts;
+ if ( virtualHosts != null )
+ {
+ final List<String> retVal = new LinkedList<String>();
+ Collections.copy(retVal, virtualHosts);
+ return retVal;
+ }
+
+ return null;
}
- public void setVirtualHosts(String[] virtualHosts)
+ public void setVirtualHosts(List<String> virtualHosts)
{
this.virtualHosts = virtualHosts;
}
Modified: framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-08-04 13:14:08 UTC (rev 10478)
+++ framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-08-04 13:15:48 UTC (rev 10479)
@@ -23,6 +23,7 @@
package org.jboss.wsf.framework.deployment;
import java.util.Arrays;
+import java.util.List;
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -44,15 +45,11 @@
{
if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
{
- String[] virtualHosts = dep.getService().getVirtualHosts();
- if (virtualHosts == null)
- {
- dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
- }
+ dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
}
}
- protected String[] getExplicitVirtualHosts(Deployment dep)
+ protected List<String> getExplicitVirtualHosts(Deployment dep)
{
String[] virtualHosts = null;
@@ -82,6 +79,14 @@
}
}
}
- return virtualHosts;
+
+ if ( virtualHosts != null )
+ {
+ return Arrays.asList(virtualHosts);
+ }
+ else
+ {
+ return null;
+ }
}
}
15 years, 5 months