JBossWS SVN: r3307 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-30 05:34:58 -0400 (Wed, 30 May 2007)
New Revision: 3307
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java
Log:
Fix service names
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java 2007-05-30 09:33:10 UTC (rev 3306)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/HelloJavaBean.java 2007-05-30 09:34:58 UTC (rev 3307)
@@ -27,13 +27,12 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.EndpointConfig;
import org.jboss.ws.extensions.policy.PolicyScopeLevel;
import org.jboss.ws.extensions.policy.annotation.Policy;
import org.jboss.ws.extensions.policy.annotation.PolicyAttachment;
-@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecurityAnnotatedpolicy")
+@WebService(name = "Hello", serviceName = "HelloService", targetNamespace = "http://org.jboss.ws/samples/wssecurityAnnotatedpolicy")
@PolicyAttachment({@Policy( policyFileLocation="WEB-INF/Policy.xml", scope = PolicyScopeLevel.WSDL_PORT ) })
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloJavaBean
17 years, 8 months
JBossWS SVN: r3306 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-30 05:33:10 -0400 (Wed, 30 May 2007)
New Revision: 3306
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloJavaBean.java
Log:
Fix service names
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloJavaBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloJavaBean.java 2007-05-30 09:30:59 UTC (rev 3305)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/HelloJavaBean.java 2007-05-30 09:33:10 UTC (rev 3306)
@@ -29,7 +29,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.EndpointConfig;
-@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
+@WebService(name = "Hello", serviceName = "HelloService", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
@EndpointConfig(configName = "Standard WSSecurity Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloJavaBean
17 years, 8 months
JBossWS SVN: r3305 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-30 05:30:59 -0400 (Wed, 30 May 2007)
New Revision: 3305
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/SecureEndpointImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/TestEndpointImpl.java
Log:
Fix service names
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/SecureEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/SecureEndpointImpl.java 2007-05-30 09:19:34 UTC (rev 3304)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/SecureEndpointImpl.java 2007-05-30 09:30:59 UTC (rev 3305)
@@ -32,7 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.wsf.spi.annotation.WebContext;
-@WebService(name = "SecureEndpoint", targetNamespace = "http://org.jboss.ws/wsref")
+@WebService(name = "SecureEndpoint", serviceName = "SecureEndpointService", targetNamespace = "http://org.jboss.ws/wsref")
@Stateless(name = "SecureEndpoint")
@SOAPBinding(style = Style.RPC)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/TestEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/TestEndpointImpl.java 2007-05-30 09:19:34 UTC (rev 3304)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/webserviceref/TestEndpointImpl.java 2007-05-30 09:30:59 UTC (rev 3305)
@@ -28,7 +28,7 @@
import org.jboss.logging.Logger;
-@WebService(name = "TestEndpoint", targetNamespace = "http://org.jboss.ws/wsref")
+@WebService(name = "TestEndpoint", serviceName = "TestEndpointService", targetNamespace = "http://org.jboss.ws/wsref")
@SOAPBinding(style = Style.RPC)
public class TestEndpointImpl
{
17 years, 8 months
JBossWS SVN: r3304 - trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-30 05:19:34 -0400 (Wed, 30 May 2007)
New Revision: 3304
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointBean.java
Log:
Fix service names
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-05-30 09:14:04 UTC (rev 3303)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-05-30 09:19:34 UTC (rev 3304)
@@ -49,7 +49,7 @@
public void testClientAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerscope?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointBeanService");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointService");
Service service = Service.create(wsdlURL, serviceName);
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointBean.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointBean.java 2007-05-30 09:14:04 UTC (rev 3303)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/SOAPEndpointBean.java 2007-05-30 09:19:34 UTC (rev 3304)
@@ -32,7 +32,7 @@
import org.jboss.logging.Logger;
-@WebService(name = "SOAPEndpoint", targetNamespace = "http://org.jboss.ws/jaxws/handlerscope")
+@WebService(name = "SOAPEndpoint", serviceName = "SOAPEndpointService", targetNamespace = "http://org.jboss.ws/jaxws/handlerscope")
@BindingType(value = "http://www.w3.org/2003/05/soap/bindings/HTTP/") // SOAP-1.2
@HandlerChain(file = "jaxws-server-handlers.xml")
@SOAPBinding(style = Style.RPC)
17 years, 8 months
JBossWS SVN: r3303 - in trunk/jbossws-core/src: main/java/org/jboss/ws/extensions/policy/metadata and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: palin
Date: 2007-05-30 05:14:04 -0400 (Wed, 30 May 2007)
New Revision: 3303
Added:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyDeployerTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/
trunk/jbossws-core/src/test/resources/jaxws/wspolicy/TestService.wsdl
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
Log:
PolicyDeployer and PolicyMetaDataBuilder test cases
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-30 08:43:49 UTC (rev 3302)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/PolicyDeployer.java 2007-05-30 09:14:04 UTC (rev 3303)
@@ -32,6 +32,7 @@
import org.apache.ws.policy.PrimitiveAssertion;
import org.apache.ws.policy.XorCompositeAssertion;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
import org.jboss.ws.extensions.policy.deployer.domainAssertion.AssertionDeployer;
import org.jboss.ws.extensions.policy.deployer.domainAssertion.NopAssertionDeployer;
import org.jboss.ws.extensions.policy.deployer.domainAssertion.WSSecurityAssertionDeployer;
@@ -90,12 +91,13 @@
@SuppressWarnings("unchecked")
public Policy deployServerside(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
{
-
+ if (policy == null) throw new WSException("Cannot deploy null policy!");
+
List<Assertion> returnedPolicyTerms = new LinkedList<Assertion>();
if (! policy.isNormalized())
{
- policy.normalize();
+ policy = (Policy)policy.normalize();
}
//in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
@@ -141,9 +143,11 @@
@SuppressWarnings("unchecked")
public void deployClientSide(Policy policy, ExtensibleMetaData extMetaData) throws UnsupportedPolicy
{
+ if (policy == null) throw new WSException("Cannot deploy null policy!");
+
if (! policy.isNormalized())
{
- policy.normalize();
+ policy = (Policy)policy.normalize();
}
//in normal form we have just one wsp:ExactlyOne element containg unbounded wsp:All (alternative)
XorCompositeAssertion exactlyOne = (XorCompositeAssertion) policy.getTerms().get(0);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-30 08:43:49 UTC (rev 3302)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-30 09:14:04 UTC (rev 3303)
@@ -61,6 +61,7 @@
private static final Logger log = Logger.getLogger(PolicyMetaDataBuilder.class);
private boolean serverSide = true;
private boolean toolMode = false;
+ private PolicyDeployer customDeployer;
public PolicyMetaDataBuilder()
{
@@ -68,6 +69,16 @@
}
/**
+ * To be used for tests or whenever a custom deployer is required
+ *
+ * @param customDeployer
+ */
+ public PolicyMetaDataBuilder(PolicyDeployer customDeployer)
+ {
+ this.customDeployer = customDeployer;
+ }
+
+ /**
* Creates a new PolicyMetaDataBuilder for server side policy processing.
*
* @param toolMode True if running WSProvideTask (no policy deployments)
@@ -192,7 +203,7 @@
{
if (policyProp!=null && policyProp.getValue()!=null)
{
- StringTokenizer st = new StringTokenizer(policyProp.getValue(), " ", false);
+ StringTokenizer st = new StringTokenizer(policyProp.getValue(), ", ", false);
while (st.hasMoreTokens())
{
PolicyReference policyRef = new PolicyReference(st.nextToken());
@@ -232,8 +243,12 @@
private void deployPolicy(Policy policy, PolicyScopeLevel scope, ExtensibleMetaData extMetaData)
{
PolicyDeployer deployer;
- if (toolMode)
+ if (customDeployer != null)
{
+ deployer = customDeployer;
+ }
+ else if (toolMode)
+ {
deployer = PolicyDeployer.newInstanceForTools();
}
else
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyDeployerTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyDeployerTestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyDeployerTestCase.java 2007-05-30 09:14:04 UTC (rev 3303)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.wspolicy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.policy.AndCompositeAssertion;
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.PrimitiveAssertion;
+import org.apache.ws.policy.XorCompositeAssertion;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.WSException;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.NopAssertionDeployer;
+import org.jboss.ws.extensions.policy.deployer.exceptions.UnsupportedPolicy;
+
+/**
+ * @author Alessio Soldano, <mailto:alessio.soldano@javalinux.it>
+ *
+ * since 29-May-2007
+ */
+public class PolicyDeployerTestCase extends JBossWSTest
+{
+
+ public void testDeployEmptyPolicy() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://www.jboss.com/test/policy", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ try
+ {
+ deployer.deployServerside(null, null);
+ fail("deployServerSide should throw exception when invoked with null policy!");
+ }
+ catch (WSException wse)
+ {
+ //OK
+ }
+ Policy policy = new Policy();
+ deployer.deployServerside(policy, null);
+ }
+
+ public void testDeploySingleAssertion() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://www.jboss.com/test/policy", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ Policy policy = new Policy("myID");
+ PrimitiveAssertion assertion = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy","test"));
+ policy.addTerm(assertion);
+ deployer.deployServerside(policy, null);
+
+ policy.remove(assertion);
+ policy.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy2","test")));
+ try
+ {
+ deployer.deployServerside(policy, null);
+ fail("deployServerSide shouldn't be able to deploy this policy!");
+ }
+ catch (UnsupportedPolicy up)
+ {
+ //OK
+ }
+ }
+
+ public void testDeployMultipleAssertion() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://www.jboss.com/test/policy", NopAssertionDeployer.class);
+ map.put("http://www.jboss.com/test/policy2", NopAssertionDeployer.class);
+ map.put("http://www.jboss.com/test/policy3", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ Policy policy = new Policy("myID");
+ policy.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy","test")));
+ policy.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy2","test2")));
+ deployer.deployServerside(policy, null);
+
+ policy.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy4","test4")));
+ try
+ {
+ deployer.deployServerside(policy, null);
+ fail("deployServerSide shouldn't be able to deploy this policy!");
+ }
+ catch (UnsupportedPolicy up)
+ {
+ //OK
+ }
+ }
+
+ public void testDeployMultipleAlternative() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://www.jboss.com/test/policy", NopAssertionDeployer.class);
+ map.put("http://www.jboss.com/test/policy2", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ Policy policy = new Policy("myID");
+ PrimitiveAssertion assertion1 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy","test"));
+ PrimitiveAssertion assertion2 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy2","test2"));
+ XorCompositeAssertion xorAssertion = new XorCompositeAssertion();
+ xorAssertion.addTerm(assertion1);
+ xorAssertion.addTerm(assertion2);
+ policy.addTerm(xorAssertion);
+ deployer.deployServerside(policy, null);
+
+ xorAssertion.remove(assertion2);
+ xorAssertion.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy3","test3")));
+ deployer.deployServerside(policy, null);
+
+ xorAssertion.remove(assertion1);
+ xorAssertion.addTerm(new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy4","test4")));
+ try
+ {
+ deployer.deployServerside(policy, null);
+ fail("deployServerSide shouldn't be able to deploy this policy (no alternative supported)!");
+ }
+ catch (UnsupportedPolicy up)
+ {
+ //OK
+ }
+ }
+
+ public void testDeployMultipleComplexAlternative() throws Exception
+ {
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://www.jboss.com/test/policy", NopAssertionDeployer.class);
+ map.put("http://www.jboss.com/test/policy2", NopAssertionDeployer.class);
+ map.put("http://www.jboss.com/test/policy3", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ Policy policy = new Policy("myID");
+ PrimitiveAssertion assertion1 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy","test"));
+ PrimitiveAssertion assertion2 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy2","test2"));
+ PrimitiveAssertion assertion3 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy3","test3"));
+ PrimitiveAssertion assertion4 = new PrimitiveAssertion(new QName("http://www.jboss.com/test/policy4","test4"));
+ AndCompositeAssertion andAssertion1 = new AndCompositeAssertion();
+ andAssertion1.addTerm(assertion1);
+ andAssertion1.addTerm(assertion2);
+ AndCompositeAssertion andAssertion2 = new AndCompositeAssertion();
+ andAssertion2.addTerm(assertion3);
+ andAssertion2.addTerm(assertion4);
+ XorCompositeAssertion xorAssertion = new XorCompositeAssertion();
+ xorAssertion.addTerm(andAssertion1);
+ xorAssertion.addTerm(andAssertion2);
+ policy.addTerm(xorAssertion);
+ deployer.deployServerside(policy, null);
+
+ xorAssertion.remove(andAssertion1);
+ try
+ {
+ deployer.deployServerside(policy, null);
+ fail("deployServerSide shouldn't be able to deploy this policy (no alternative supported)!");
+ }
+ catch (UnsupportedPolicy up)
+ {
+ //OK
+ }
+ }
+
+}
Added: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java (rev 0)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wspolicy/PolicyMetaDataBuilderTestCase.java 2007-05-30 09:14:04 UTC (rev 3303)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.wspolicy;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ws.policy.Policy;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.Constants;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.deployer.PolicyDeployer;
+import org.jboss.ws.extensions.policy.deployer.domainAssertion.NopAssertionDeployer;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaDataBuilder;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+
+/**
+ * @author Alessio Soldano, <mailto:alessio.soldano@javalinux.it>
+ *
+ * since 29-May-2007
+ */
+public class PolicyMetaDataBuilderTestCase extends JBossWSTest
+{
+
+ private WSDLDefinitions readWsdl(String filename) throws Exception
+ {
+ File wsdlFile = new File(filename);
+ assertTrue(wsdlFile.exists());
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlFile.toURL());
+ assertNotNull(wsdlDefinitions);
+ return wsdlDefinitions;
+ }
+
+ public void testEndpointScopePolicies() throws Exception
+ {
+ WSDLDefinitions wsdlDefinitions = readWsdl("resources/jaxws/wspolicy/TestService.wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/endpoint", "TestService");
+ ServiceMetaData serviceMetaData = new ServiceMetaData(null, serviceName);
+ QName portName = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointInterfacePort");
+ QName portTypeName = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointInterface");
+ EndpointMetaData epMetaData = new ServerEndpointMetaData(serviceMetaData,portName,portTypeName,Type.JAXWS);
+
+ Map<String,Class> map = new HashMap<String,Class>();
+ map.put("http://schemas.xmlsoap.org/ws/2005/02/rm/policy", NopAssertionDeployer.class);
+ map.put("http://www.fabrikam123.example.com/stock", NopAssertionDeployer.class);
+ map.put("http://schemas.xmlsoap.org/ws/2005/07/securitypolicy", NopAssertionDeployer.class);
+ PolicyDeployer deployer = PolicyDeployer.newInstance(map);
+ PolicyMetaDataBuilder builder = new PolicyMetaDataBuilder(deployer);
+
+ builder.processPolicyExtensions(epMetaData, wsdlDefinitions);
+
+ PolicyMetaExtension policyExt = (PolicyMetaExtension)epMetaData.getExtension(Constants.URI_WS_POLICY);
+ Collection<Policy> bindingPolicies = policyExt.getPolicies(PolicyScopeLevel.WSDL_BINDING);
+ assertNotNull(bindingPolicies);
+ assertEquals(2, bindingPolicies.size());
+ Iterator<Policy> bindingPoliciesIterator = bindingPolicies.iterator();
+ String id1 = bindingPoliciesIterator.next().getId();
+ String id2 = bindingPoliciesIterator.next().getId();
+ assertTrue(("RmPolicy".equalsIgnoreCase(id1) && "X509EndpointPolicy".equalsIgnoreCase(id2)) ||
+ ("RmPolicy".equalsIgnoreCase(id2) && "X509EndpointPolicy".equalsIgnoreCase(id1)));
+
+ Collection<Policy> portPolicies = policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT);
+ assertNotNull(portPolicies);
+ assertEquals(1, portPolicies.size());
+ assertEquals("uselessPortPolicy", portPolicies.iterator().next().getId());
+
+ Collection<Policy> portTypePolicies = policyExt.getPolicies(PolicyScopeLevel.WSDL_PORT_TYPE);
+ assertNotNull(portTypePolicies);
+ assertEquals(2, portTypePolicies.size());
+ Iterator<Policy> portTypePoliciesIterator = portTypePolicies.iterator();
+ String id3 = portTypePoliciesIterator.next().getId();
+ String id4 = portTypePoliciesIterator.next().getId();
+ assertTrue(("uselessPortTypePolicy".equalsIgnoreCase(id3) && "uselessPortTypePolicy2".equalsIgnoreCase(id4)) ||
+ ("uselessPortTypePolicy".equalsIgnoreCase(id4) && "uselessPortTypePolicy2".equalsIgnoreCase(id3)));
+ }
+
+}
Added: trunk/jbossws-core/src/test/resources/jaxws/wspolicy/TestService.wsdl
===================================================================
--- trunk/jbossws-core/src/test/resources/jaxws/wspolicy/TestService.wsdl (rev 0)
+++ trunk/jbossws-core/src/test/resources/jaxws/wspolicy/TestService.wsdl 2007-05-30 09:14:04 UTC (rev 3303)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxws/endpoint"
+ xmlns:tns="http://org.jboss.ws/jaxws/endpoint"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:fab="http://www.fabrikam123.example.com/stock"
+ xmlns:rmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..." >
+ <wsp:Policy wsu:Id="RmPolicy" >
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds="600000" />
+ <rmp:BaseRetransmissionInterval Milliseconds="3000" />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds="200" />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortTypePolicy" >
+ <fab:useless>nothing</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortTypePolicy2" >
+ <fab:useless>nothing and nothing</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="uselessPortPolicy" >
+ <fab:useless>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="X509EndpointPolicy" >
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="SecureMessagePolicy" >
+ <sp:SignedParts>
+ <sp:Body />
+ </sp:SignedParts>
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ </wsp:Policy>
+ <types/>
+ <message name="EndpointInterface_echo">
+ <part name="String_1" type="xsd:string"/>
+ </message>
+ <message name="EndpointInterface_echoResponse">
+ <part name="result" type="xsd:string"/>
+ </message>
+ <portType name="EndpointInterface" wsp:PolicyURIs="#uselessPortTypePolicy,#uselessPortTypePolicy2">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:EndpointInterface_echo"/>
+ <output message="tns:EndpointInterface_echoResponse"/>
+ </operation>
+ </portType>
+ <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+ <wsp:PolicyReference URI="#RmPolicy" wsdl:required="true" />
+ <wsp:PolicyReference URI="#X509EndpointPolicy" wsdl:required="true" />
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/endpoint"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/endpoint"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="TestService">
+ <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
+ <wsp:PolicyReference URI="#uselessPortPolicy" wsdl:required="true" />
+ <soap:address location="http://@jbosstest.host.name@:8080/jaxws-endpoint"/>
+ </port>
+ </service>
+</definitions>
17 years, 8 months
JBossWS SVN: r3302 - in trunk: integration/spi/src/main/java/org/jboss/ws/integration and 12 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-30 04:43:49 -0400 (Wed, 30 May 2007)
New Revision: 3302
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/package.html
Removed:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/package.html
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java
Modified:
trunk/build/etc/wsconsume.bat
trunk/build/etc/wsconsume.sh
trunk/build/etc/wsprovide.bat
trunk/build/etc/wsprovide.sh
trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumerFactory.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProviderFactory.java
trunk/jbossws-core/ant-import-tests/build-testsuite.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSTools.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
trunk/jbossws-core/src/main/resources/samples/build.xml
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleEncryptTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleSignTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
Log:
Rename ANT tasks and command line wrapper
Modified: trunk/build/etc/wsconsume.bat
===================================================================
--- trunk/build/etc/wsconsume.bat 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/build/etc/wsconsume.bat 2007-05-30 08:43:49 UTC (rev 3302)
@@ -42,7 +42,7 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxb-xjc.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-rt.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jaxws-tools.jar
-set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-integration-tools.jar
+set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jbossall-client.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/jboss-jaxrpc.jar
@@ -52,4 +52,4 @@
set WSCONSUME_CLASSPATH=%WSCONSUME_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.command.wsconsume %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSCONSUME_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSConsume %*
Modified: trunk/build/etc/wsconsume.sh
===================================================================
--- trunk/build/etc/wsconsume.sh 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/build/etc/wsconsume.sh 2007-05-30 08:43:49 UTC (rev 3302)
@@ -53,12 +53,6 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/activation.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/getopt.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/javassist.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-api.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-rt.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-tools.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossall-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-client.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-jaxws.jar"
@@ -66,8 +60,15 @@
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/mail.jar"
-WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jbossws-spi.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-rt.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxws-tools.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-api.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/stax-api.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-impl.jar"
+WSCONSUME_CLASSPATH="$WSCONSUME_CLASSPATH:$JBOSS_HOME/client/jaxb-xjc.jar"
+
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
@@ -81,4 +82,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSCONSUME_CLASSPATH" \
- org.jboss.wsf.spi.tools.command.wsconsume "$@"
+ org.jboss.wsf.spi.tools.cmd.WSConsume "$@"
Modified: trunk/build/etc/wsprovide.bat
===================================================================
--- trunk/build/etc/wsprovide.bat 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/build/etc/wsprovide.bat 2007-05-30 08:43:49 UTC (rev 3302)
@@ -43,6 +43,7 @@
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jboss-saaj.jar
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/log4j.jar
set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/mail.jar
+set WSPROVIDE_CLASSPATH=%WSPROVIDE_CLASSPATH%;%JBOSS_HOME%/client/jbossws-spi.jar
rem Execute the JVM
-"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.wsf.spi.tools.command.wsprovide %*
+"%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -Dlog4j.configuration=wstools-log4j.xml -classpath "%WSPROVIDE_CLASSPATH%" org.jboss.wsf.spi.tools.cmd.WSProvide %*
Modified: trunk/build/etc/wsprovide.sh
===================================================================
--- trunk/build/etc/wsprovide.sh 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/build/etc/wsprovide.sh 2007-05-30 08:43:49 UTC (rev 3302)
@@ -60,7 +60,7 @@
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jboss-saaj.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/log4j.jar"
WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/mail.jar"
-WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-integration-tools.jar"
+WSPROVIDE_CLASSPATH="$WSPROVIDE_CLASSPATH:$JBOSS_HOME/client/jbossws-spi.jar"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
@@ -75,4 +75,4 @@
-Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
-Dlog4j.configuration=wstools-log4j.xml \
-classpath "$WSPROVIDE_CLASSPATH" \
- org.jboss.wsf.spi.tools.command.wsprovide "$@"
+ org.jboss.wsf.spi.tools.cmd.WSProvide "$@"
Modified: trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/ws/integration/FactoryLoader.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -35,8 +35,15 @@
// $Id$
/**
- * Load a factory using the factory lookup procedure
- *
+ * Load a factory using this ordered lookup procedure
+ *
+ * <ol>
+ * <li>Use the system property
+ * <li>Use the properties file "lib/jaxm.properties" in the JRE directory
+ * <li>Use the Services API (as detailed in the JAR specification), if available, to determine the classname
+ * <li>Use the default factory implementation class
+ * </ol>
+ *
* @author Thomas.Diesler(a)jboss.com
* @since 14-Dec-2006
*/
@@ -46,15 +53,7 @@
{
}
- /**
- * Load a factory using this ordered lookup procedure
- *
- * <ol>
- * <li>Use the system property
- * <li>Use the properties file "lib/jaxm.properties" in the JRE directory
- * <li>Use the Services API (as detailed in the JAR specification), if available, to determine the classname
- * <li>Use the default factory implementation class
- * </ol>
+ /**
*
* @return the factory impl, or null
*/
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumerFactory.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractConsumerFactory.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -24,7 +24,7 @@
import org.jboss.wsf.spi.tools.WSContractConsumer;
/**
- * WSContractConsumerFactory defines the contract for a WSContractConsumer factory.
+ * Creates WSContractConsumer implementations.
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
*/
Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProviderFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProviderFactory.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/WSContractProviderFactory.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -24,7 +24,7 @@
import org.jboss.wsf.spi.tools.WSContractProvider;
/**
- * WSContractProviderFactory defines the contract for a WSContractProvider factory.
+ * Creates WSContractProvider implementations.
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
*/
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java (from rev 3296, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -0,0 +1,305 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.wsf.spi.tools.ant;
+
+import org.apache.tools.ant.*;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Ant task which consumes a Web Service contract.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
+ * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
+ * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
+ * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>verbose</td><td>Enables more informational output about cmd progress.</td><td>false</td><tr>
+ * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <WSConsumeTask
+ * fork="true"
+ * verbose="true"
+ * destdir="output"
+ * sourcedestdir="gen-src"
+ * keep="true"
+ * wsdllocation="handEdited.wsdl"
+ * wsdl="foo.wsdl">
+ * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
+ * </wsimport>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSConsumeTask extends Task
+{
+ private CommandlineJava command = new CommandlineJava();
+ private String wsdl = null;
+ private File destdir = null;
+ private File sourcedestdir = null;
+ private List<File> bindingFiles = new ArrayList<File>();
+ private File catalog = null;
+ private String wsdlLocation = null;
+ private String targetPackage = null;
+ private boolean keep = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setBinding(File bindingFile)
+ {
+ bindingFiles.add(bindingFile);
+ }
+
+ public void setCatalog(File catalog)
+ {
+ this.catalog = catalog;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setPackage(String targetPackage)
+ {
+ this.targetPackage = targetPackage;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setWsdl(String wsdl)
+ {
+ this.wsdl = wsdl;
+ }
+
+ public void setWsdlLocation(String wsdlLocation)
+ {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredBinding(FileSet fs)
+ {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ File baseDir = ds.getBasedir();
+ for (String file : ds.getIncludedFiles())
+ {
+ bindingFiles.add(new File(baseDir, file));
+ }
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ importer.setGenerateSource(keep);
+ if (destdir != null)
+ importer.setOutputDirectory(destdir);
+ if (sourcedestdir != null)
+ importer.setSourceDirectory(sourcedestdir);
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+ if (catalog != null)
+ importer.setCatalog(catalog);
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
+
+ if (verbose)
+ {
+ importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ }
+
+ try
+ {
+ importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
+ importer.consume(wsdl);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new BuildException(e, getLocation());
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (wsdl == null)
+ throw new BuildException("The wsdl attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private List<String> getTaskClassPathStrings()
+ {
+ // Why is everything in the Ant API a big hack???
+ List<String> strings = new ArrayList<String>();
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
+ strings.add(string);
+ }
+
+ return strings;
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.wsf.spi.tools.cmd.WSConsume.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ for (File file : bindingFiles)
+ {
+ command.createArgument().setValue("-b");
+ command.createArgument().setFile(file);
+ }
+
+ if (catalog != null)
+ {
+ command.createArgument().setValue("-c");
+ command.createArgument().setFile(catalog);
+ }
+
+ if (targetPackage != null)
+ {
+ command.createArgument().setValue("-p");
+ command.createArgument().setValue(targetPackage);
+ }
+
+ if (wsdlLocation != null)
+ {
+ command.createArgument().setValue("-w");
+ command.createArgument().setValue(wsdlLocation);
+ }
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(wsdl);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke WSConsumeTask", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java (from rev 3296, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -0,0 +1,266 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.wsf.spi.tools.ant;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecuteJava;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.jboss.wsf.spi.tools.WSContractProvider;
+
+import java.io.File;
+import java.io.PrintStream;
+
+/**
+ * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
+ *
+ * <table border="1">
+ * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
+ * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
+ * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
+ * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
+ * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
+ * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
+ * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
+ * <tr><td>verbose</td><td>Enables more informational output about cmd progress.</td><td>false</td><tr>
+ * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
+ * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
+ * </table>
+ * <b>* = required.</b>
+ *
+ * <p>Example:
+ *
+ * <pre>
+ * <target name="test-wsproivde" depends="init">
+ * <taskdef name="WSProvideTask" classname="org.jboss.wsf.spi.tools.ant.WSProvideTask">
+ * <classpath refid="core.classpath"/>
+ * </taskdef>
+ * <WSProvideTask
+ * fork="false"
+ * keep="true"
+ * destdir="out"
+ * resourcedestdir="out-resource"
+ * sourcedestdir="out-source"
+ * genwsdl="true"
+ * verbose="true"
+ * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
+ * <classpath>
+ * <pathelement path="${tests.output.dir}/classes"/>
+ * </classpath>
+ * </WSProvideTask>
+ * </target>
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSProvideTask extends Task
+{
+ private Path classpath = new Path(getProject());
+ private CommandlineJava command = new CommandlineJava();
+ private String sei = null;
+ private File destdir = null;
+ private File resourcedestdir = null;
+ private File sourcedestdir = null;
+ private boolean keep = false;
+ private boolean genwsdl = false;
+ private boolean verbose = false;
+ private boolean fork = false;
+ private boolean debug = false;
+
+ // Not actually used right now
+ public void setDebug(boolean debug)
+ {
+ this.debug = debug;
+ }
+
+ public Commandline.Argument createJvmarg()
+ {
+ return command.createVmArgument();
+ }
+
+ public void setClasspath(Path classpath)
+ {
+ this.classpath = classpath;
+ }
+
+ public void setClasspathRef(Reference ref)
+ {
+ createClasspath().setRefid(ref);
+ }
+
+ public Path createClasspath()
+ {
+ return classpath;
+ }
+
+ public void setDestdir(File destdir)
+ {
+ this.destdir = destdir;
+ }
+
+ public void setKeep(boolean keep)
+ {
+ this.keep = keep;
+ }
+
+ public void setSei(String sei)
+ {
+ this.sei = sei;
+ }
+
+ public void setFork(boolean fork)
+ {
+ this.fork = fork;
+ }
+
+ public void setResourcedestdir(File resourcedestdir)
+ {
+ this.resourcedestdir = resourcedestdir;
+ }
+
+ public void setSourcedestdir(File sourcedestdir)
+ {
+ this.sourcedestdir = sourcedestdir;
+ }
+
+ public void setVerbose(boolean verbose)
+ {
+ this.verbose = verbose;
+ }
+
+ public void setGenwsdl(boolean genwsdl)
+ {
+ this.genwsdl = genwsdl;
+ }
+
+ private ClassLoader getClasspathLoader(ClassLoader parent)
+ {
+ return new AntClassLoader(parent, getProject(), classpath, false);
+ }
+
+ public void executeNonForked()
+ {
+ ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
+ ClassLoader antLoader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(antLoader);
+ try
+ {
+ WSContractProvider gen = WSContractProvider.newInstance();
+ gen.setClassLoader(getClasspathLoader(antLoader));
+ if (verbose)
+ gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
+ gen.setGenerateSource(keep);
+ gen.setGenerateWsdl(genwsdl);
+ if (destdir != null)
+ gen.setOutputDirectory(destdir);
+ if (resourcedestdir != null)
+ gen.setResourceDirectory(resourcedestdir);
+ if (sourcedestdir != null)
+ gen.setSourceDirectory(sourcedestdir);
+
+ log("Generating from endpoint: " + sei, Project.MSG_INFO);
+
+ gen.provide(sei);
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(prevCL);
+ }
+ }
+
+ public void execute() throws BuildException
+ {
+ if (sei == null)
+ throw new BuildException("The sei attribute must be specified!", getLocation());
+
+ if (fork)
+ executeForked();
+ else
+ executeNonForked();
+ }
+
+ private Path getTaskClassPath()
+ {
+ // Why is everything in the Ant API a big hack???
+ ClassLoader cl = this.getClass().getClassLoader();
+ if (cl instanceof AntClassLoader)
+ {
+ return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
+ }
+
+ return new Path(getProject());
+ }
+
+ private void executeForked() throws BuildException
+ {
+ command.setClassname(org.jboss.wsf.spi.tools.cmd.WSProvide.class.getName());
+
+ Path path = command.createClasspath(getProject());
+ path.append(getTaskClassPath());
+ path.append(classpath);
+
+ if (keep)
+ command.createArgument().setValue("-k");
+
+ if (genwsdl)
+ command.createArgument().setValue("-w");
+
+ if (destdir != null)
+ {
+ command.createArgument().setValue("-o");
+ command.createArgument().setFile(destdir);
+ }
+ if (resourcedestdir != null)
+ {
+ command.createArgument().setValue("-r");
+ command.createArgument().setFile(resourcedestdir);
+ }
+ if (sourcedestdir != null)
+ {
+ command.createArgument().setValue("-s");
+ command.createArgument().setFile(sourcedestdir);
+ }
+
+ if (!verbose)
+ command.createArgument().setValue("-q");
+
+ // Always dump traces
+ command.createArgument().setValue("-t");
+ command.createArgument().setValue(sei);
+
+ if (verbose)
+ log("Command invoked: " + command.getJavaCommand().toString());
+
+ ExecuteJava execute = new ExecuteJava();
+ execute.setClasspath(path);
+ execute.setJavaCommand(command.getJavaCommand());
+ if (execute.fork(this) != 0)
+ throw new BuildException("Could not invoke WSProvideTask", getLocation());
+ }
+}
\ No newline at end of file
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/package.html
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/package.html 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/package.html 2007-05-30 08:43:49 UTC (rev 3302)
@@ -1,187 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body bgcolor="white">
-
-Provides classes and interfaces for handling text, dates, numbers, currency, messages and
-collation in a manner independent of natural languages. This means your main application
-or applet can be written to be language-independent, and it can rely upon
-separate, dynamically-linked localized resources. This allows the flexibility
-of adding localizations for new localizations at any time.
-<p>
-These classes are capable of formatting dates, numbers, and messages, parsing;
-searching and sorting strings; and iterating over characters, words, sentences,
-and line breaks. This package contains three main groups of classes and
-interfaces:
-<ul>
-<li>Classes for formatting and parsing
-<li>Classes for iteration over text
-<li>Classes for string collation
-</ul>
-
-
-</ul>
-<h3>Formatting and Parsing</h3>
-
-<em>Formatting</em> is the conversion of number and date objects to
-strings. <em>P</em><em>arsing</em> is the reverse operation of
-converting strings into number and date objects.
-<p>
-
-Dates and numbers are represented internally in a
-locale-independent way. For example, dates are kept as milliseconds
-since January 1, 1970, 00:00:00 UCT. When these objects are printed or
-displayed, they must be converted to localized strings. The
-locale-specific parts of a date string, such as the time zone string,
-are separately imported from a locale-specific resource bundle.
-<p>
-
-The <code>format()</code> method converts the <code>Date</code>
-object from -604656780000 milliseconds to the form "Tuesday, November
-3, 1997 9:47am CST" for the U. S. English locale. The figure shows how the
-<code>format()</code> method of subclasses of <code>Format</code>
-enable instances of <code>Number</code>, <code>Date</code>,
-<code>String</code>, and other objects to be formatted to
-locale-specific strings.
-<p>
-
-Conversely, the <code>parseObject()</code> method (and
-<code>parse()</code> method in subclasses) perform the reverse
-operation of parsing localized strings and converting them to
-<code>Number</code>, <code>Date</code>,<code> </code>and
-<code>String</code> objects. The figure
-shows how the <code>parse()</code> method is complementary to
-<code>format()</code>. Any <code>String</code> formatted by
-<code>format()</code> is guaranteed to be parseable by
-<code>parseObject()</code>.
-<p>
-
-Java provides six subclasses of {@link Format} for formatting
-dates, numbers, and messages: {@link DateFormat},
-{@link SimpleDateFormat}, {@link NumberFormat},
-{@link DecimalFormat}, {@link ChoiceFormat}, and
-{@link MessageFormat}.
-
-<h3>String Collation</h3>
-
-The term "<em>collate"</em> means to determine the proper sort
-sequence for two or more strings. It can also tell if two strings
-match, for searching. The <code>Collator</code> class and its subclass
-<code>RuleBasedCollator</code> perform locale-sensitive string
-comparison. You use these classes to build searching and alphabetical
-sorting routines for natural language text. They can distinguish
-characters based on the base character, accent marks, and
-uppercase/lowercase properties.
-<p>
-
-{@link Collator} is an abstract base class. Subclasses
-implement specific collation strategies. One subclass,
-{@link RuleBasedCollator}, is currently provided and is
-applicable to a wide set of languages. Other subclasses may be created
-to handle more specialized
-needs. {@link CollationElementIterator} provides an iterator for
-stepping through each character of a locale-specific string according
-to the rules of a specific <code>Collator</code>
-object. {@link CollationKey} enables fast sorting of strings by
-representing a string as a sort key under the rules of a specific
-<code>Collator</code> object.
-
-<h3>Word Breaks</h3>
-
-While the Java types <code>char</code> and <code>Character</code>
-represent Unicode characters, sometimes Unicode characters combine to
-form a more complex character that has its own semantic value, a
-<em>user character</em>. The {@link BreakIterator} class makes it
-possible to iterate over these user characters. A break iterator can
-find the location of character, word, or sentence boundaries or
-potential line-break boundaries. This makes it possible for a program
-to properly select characters for text operations such as highlighting
-a character, cutting a word, moving to the next sentence, or
-word-wrapping at a line ending. These operations are performed in a
-locale-sensitive manner, meaning that they honor the boundaries of
-text for a particular locale.
-
-
-<h3>Locale-Sensitive Classes</h3>
-
-Many, but not all, of the classes in java.text are locale-sensitive,
-meaning you have to create a different instance for each locale. The
-following table lists which are locale-sensitive and which are not.
-<p>
-
-<table border=1 cellspacing=0 cellpadding=6>
-<tr valign=top>
-<td>
-<b>Locale-Sensitive Classes</b><br>
-
-NumberFormat<br>
-DecimalFormat<br>
-DecimalFormatSymbols<br>
-MessageFormat<br>
-DateFormat<br>
-SimpleDateFormat<br>
-DateFormatSymbols<br>
-Collator<br>
-RuleBasedCollator<br>
-CollationElementIterator<br>
-CollationKey<br>
-BreakIterator<br>
-</td>
-
-<td>
-<b>Locale-Independent Classes</b><br>
-
-Format<br>
-ChoiceFormat<br>
-FieldPosition<br>
-ParsePosition<br>
-ParseException<br>
-StringCharacterIterator<br>
-CharacterIterator
-</td>
-</tr>
-
-</table>
-
-<p>
-
-
-<h2>Package Specification</h2>
-
- (none)
-
-
-<h2>Related Documentation </h2>
-
-The following classes are used by the java.text classes.
-<ul>
- <li>{@link java.lang.Character} (for getType)
- <li>{@link java.util.Locale}
- <li>{@link java.util.Calendar}
- <li>{@link java.util.GregorianCalendar}
- <li>{@link java.util.Date}
- <li>{@link java.util.ResourceBundle}
- <li>{@link java.util.ListResourceBundle}
- <li>{@link java.util.PropertyResourceBundle}
- <li>{@link java.util.TimeZone}
- <li>{@link java.util.SimpleTimeZone}
-</ul>
-
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="http://java.sun.com/products/jdk/1.1/docs/guide/intl/index.html">JDK 1.1.x Internationalization Documentation</a>
-
- <li><a href="http://java.sun.com/products/jdk/1.2/docs/guide/intl/index.html">JDK 1.2.x Input Method Framework Documentation</a>
-</ul>
-<br>
-
-@since JDK1.1
-
-
-<!-- This file was created with Quadralay WebWorks Publisher 3.5.0 -->
-<!-- Last updated: Thu Jan 15 10:16:56 1998 -->
-
-</body>
-</html>
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsconsume.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -1,305 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.wsf.spi.tools.ant;
-
-import org.apache.tools.ant.*;
-import org.apache.tools.ant.taskdefs.ExecuteJava;
-import org.apache.tools.ant.taskdefs.LogOutputStream;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.CommandlineJava;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
-import org.jboss.wsf.spi.tools.WSContractConsumer;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Ant task which consumes a Web Service contract.
- *
- * <table border="1">
- * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
- * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
- * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
- * <tr><td>catalog</td><td> Oasis XML Catalog file for entity resolution</td><td>none</td></tr>
- * <tr><td>package</td><td> The target Java package for generated code.</td><td>generated</td></tr>
- * <tr><td>binding</td><td>A JAX-WS or JAXB binding file</td><td>none</td></tr>
- * <tr><td>wsdlLocation</td><td>Value to use for @(a)WebService.wsdlLocation</td><td>generated</td></tr>
- * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
- * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
- * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
- * <tr><td>wsdl*</td><td>The WSDL file or URL</td><td>n/a</td><tr>
- * </table>
- * <b>* = required.</b>
- *
- * <p>Example:
- *
- * <pre>
- * <wsconsume
- * fork="true"
- * verbose="true"
- * destdir="output"
- * sourcedestdir="gen-src"
- * keep="true"
- * wsdllocation="handEdited.wsdl"
- * wsdl="foo.wsdl">
- * <binding dir="binding-files" includes="*.xml" excludes="bad.xml"/>
- * </wsimport>
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsconsume extends Task
-{
- private CommandlineJava command = new CommandlineJava();
- private String wsdl = null;
- private File destdir = null;
- private File sourcedestdir = null;
- private List<File> bindingFiles = new ArrayList<File>();
- private File catalog = null;
- private String wsdlLocation = null;
- private String targetPackage = null;
- private boolean keep = false;
- private boolean verbose = false;
- private boolean fork = false;
- private boolean debug = false;
-
- // Not actually used right now
- public void setDebug(boolean debug)
- {
- this.debug = debug;
- }
-
- public Commandline.Argument createJvmarg()
- {
- return command.createVmArgument();
- }
-
- public void setBinding(File bindingFile)
- {
- bindingFiles.add(bindingFile);
- }
-
- public void setCatalog(File catalog)
- {
- this.catalog = catalog;
- }
-
- public void setDestdir(File destdir)
- {
- this.destdir = destdir;
- }
-
- public void setFork(boolean fork)
- {
- this.fork = fork;
- }
-
- public void setKeep(boolean keep)
- {
- this.keep = keep;
- }
-
- public void setSourcedestdir(File sourcedestdir)
- {
- this.sourcedestdir = sourcedestdir;
- }
-
- public void setPackage(String targetPackage)
- {
- this.targetPackage = targetPackage;
- }
-
- public void setVerbose(boolean verbose)
- {
- this.verbose = verbose;
- }
-
- public void setWsdl(String wsdl)
- {
- this.wsdl = wsdl;
- }
-
- public void setWsdlLocation(String wsdlLocation)
- {
- this.wsdlLocation = wsdlLocation;
- }
-
- public void addConfiguredBinding(FileSet fs)
- {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- File baseDir = ds.getBasedir();
- for (String file : ds.getIncludedFiles())
- {
- bindingFiles.add(new File(baseDir, file));
- }
- }
-
- public void executeNonForked()
- {
- ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
- ClassLoader antLoader = this.getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(antLoader);
- try
- {
- WSContractConsumer importer = WSContractConsumer.newInstance();
- importer.setGenerateSource(keep);
- if (destdir != null)
- importer.setOutputDirectory(destdir);
- if (sourcedestdir != null)
- importer.setSourceDirectory(sourcedestdir);
- if (targetPackage != null)
- importer.setTargetPackage(targetPackage);
- if (wsdlLocation != null)
- importer.setWsdlLocation(wsdlLocation);
- if (catalog != null)
- importer.setCatalog(catalog);
- if (bindingFiles != null && bindingFiles.size() > 0)
- importer.setBindingFiles(bindingFiles);
-
- log("Consuming wsdl: " + wsdl, Project.MSG_INFO);
-
- if (verbose)
- {
- importer.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
- }
-
- try
- {
- importer.setAdditionalCompilerClassPath(getTaskClassPathStrings());
- importer.consume(wsdl);
- }
- catch (MalformedURLException e)
- {
- throw new BuildException(e, getLocation());
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevCL);
- }
- }
-
- public void execute() throws BuildException
- {
- if (wsdl == null)
- throw new BuildException("The wsdl attribute must be specified!", getLocation());
-
- if (fork)
- executeForked();
- else
- executeNonForked();
- }
-
- private Path getTaskClassPath()
- {
- // Why is everything in the Ant API a big hack???
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
- }
-
- return new Path(getProject());
- }
-
- private List<String> getTaskClassPathStrings()
- {
- // Why is everything in the Ant API a big hack???
- List<String> strings = new ArrayList<String>();
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- for (String string : ((AntClassLoader)cl).getClasspath().split(File.pathSeparator))
- strings.add(string);
- }
-
- return strings;
- }
-
- private void executeForked() throws BuildException
- {
- command.setClassname(org.jboss.wsf.spi.tools.command.wsconsume.class.getName());
-
- Path path = command.createClasspath(getProject());
- path.append(getTaskClassPath());
-
- if (keep)
- command.createArgument().setValue("-k");
-
- for (File file : bindingFiles)
- {
- command.createArgument().setValue("-b");
- command.createArgument().setFile(file);
- }
-
- if (catalog != null)
- {
- command.createArgument().setValue("-c");
- command.createArgument().setFile(catalog);
- }
-
- if (targetPackage != null)
- {
- command.createArgument().setValue("-p");
- command.createArgument().setValue(targetPackage);
- }
-
- if (wsdlLocation != null)
- {
- command.createArgument().setValue("-w");
- command.createArgument().setValue(wsdlLocation);
- }
-
- if (destdir != null)
- {
- command.createArgument().setValue("-o");
- command.createArgument().setFile(destdir);
- }
-
- if (sourcedestdir != null)
- {
- command.createArgument().setValue("-s");
- command.createArgument().setFile(sourcedestdir);
- }
-
- if (!verbose)
- command.createArgument().setValue("-q");
-
- // Always dump traces
- command.createArgument().setValue("-t");
- command.createArgument().setValue(wsdl);
-
- if (verbose)
- log("Command invoked: " + command.getJavaCommand().toString());
-
- ExecuteJava execute = new ExecuteJava();
- execute.setClasspath(path);
- execute.setJavaCommand(command.getJavaCommand());
- if (execute.fork(this) != 0)
- throw new BuildException("Could not invoke wsconsume", getLocation());
- }
-}
\ No newline at end of file
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/wsprovide.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -1,266 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.wsf.spi.tools.ant;
-
-import org.apache.tools.ant.AntClassLoader;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecuteJava;
-import org.apache.tools.ant.taskdefs.LogOutputStream;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.CommandlineJava;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Reference;
-import org.jboss.wsf.spi.tools.WSContractProvider;
-
-import java.io.File;
-import java.io.PrintStream;
-
-/**
- * Ant task which invokes provides a Web Service contract and portable JAX-WS wrapper classes.
- *
- * <table border="1">
- * <tr align="left" BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><th>Attribute</th><th>Description</th><th>Default</th></tr>
- * <tr><td>fork</td><td>Whether or not to run the generation task in a separate VM.</td><td>true</td></tr>
- * <tr><td>keep</td><td>Keep/Enable Java source code generation.</td><td>false</td></tr>
- * <tr><td>destdir</td><td>The output directory for generated artifacts.</td><td>"output"</td></tr>
- * <tr><td>resourcedestdir</td><td>The output directory for resource artifacts (WSDL/XSD).</td><td>value of destdir</td></tr>
- * <tr><td>sourcedestdir</td><td>The output directory for Java source.</td><td>value of destdir</td></tr>
- * <tr><td>genwsdl</td><td>Whether or not to generate WSDL.</td><td>false</td><tr>
- * <tr><td>verbose</td><td>Enables more informational output about command progress.</td><td>false</td><tr>
- * <tr><td>sei*</td><td>Service Endpoint Implementation.</td><td></td><tr>
- * <tr><td>classpath</td><td>The classpath that contains the service endpoint implementation.</td><td>""</tr>
- * </table>
- * <b>* = required.</b>
- *
- * <p>Example:
- *
- * <pre>
- * <target name="test-wsproivde" depends="init">
- * <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.wsprovide">
- * <classpath refid="core.classpath"/>
- * </taskdef>
- * <wsprovide
- * fork="false"
- * keep="true"
- * destdir="out"
- * resourcedestdir="out-resource"
- * sourcedestdir="out-source"
- * genwsdl="true"
- * verbose="true"
- * sei="org.jboss.test.ws.jaxws.jsr181.soapbinding.DocWrappedServiceImpl">
- * <classpath>
- * <pathelement path="${tests.output.dir}/classes"/>
- * </classpath>
- * </wsprovide>
- * </target>
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsprovide extends Task
-{
- private Path classpath = new Path(getProject());
- private CommandlineJava command = new CommandlineJava();
- private String sei = null;
- private File destdir = null;
- private File resourcedestdir = null;
- private File sourcedestdir = null;
- private boolean keep = false;
- private boolean genwsdl = false;
- private boolean verbose = false;
- private boolean fork = false;
- private boolean debug = false;
-
- // Not actually used right now
- public void setDebug(boolean debug)
- {
- this.debug = debug;
- }
-
- public Commandline.Argument createJvmarg()
- {
- return command.createVmArgument();
- }
-
- public void setClasspath(Path classpath)
- {
- this.classpath = classpath;
- }
-
- public void setClasspathRef(Reference ref)
- {
- createClasspath().setRefid(ref);
- }
-
- public Path createClasspath()
- {
- return classpath;
- }
-
- public void setDestdir(File destdir)
- {
- this.destdir = destdir;
- }
-
- public void setKeep(boolean keep)
- {
- this.keep = keep;
- }
-
- public void setSei(String sei)
- {
- this.sei = sei;
- }
-
- public void setFork(boolean fork)
- {
- this.fork = fork;
- }
-
- public void setResourcedestdir(File resourcedestdir)
- {
- this.resourcedestdir = resourcedestdir;
- }
-
- public void setSourcedestdir(File sourcedestdir)
- {
- this.sourcedestdir = sourcedestdir;
- }
-
- public void setVerbose(boolean verbose)
- {
- this.verbose = verbose;
- }
-
- public void setGenwsdl(boolean genwsdl)
- {
- this.genwsdl = genwsdl;
- }
-
- private ClassLoader getClasspathLoader(ClassLoader parent)
- {
- return new AntClassLoader(parent, getProject(), classpath, false);
- }
-
- public void executeNonForked()
- {
- ClassLoader prevCL = Thread.currentThread().getContextClassLoader();
- ClassLoader antLoader = this.getClass().getClassLoader();
- Thread.currentThread().setContextClassLoader(antLoader);
- try
- {
- WSContractProvider gen = WSContractProvider.newInstance();
- gen.setClassLoader(getClasspathLoader(antLoader));
- if (verbose)
- gen.setMessageStream(new PrintStream(new LogOutputStream(this, Project.MSG_INFO)));
- gen.setGenerateSource(keep);
- gen.setGenerateWsdl(genwsdl);
- if (destdir != null)
- gen.setOutputDirectory(destdir);
- if (resourcedestdir != null)
- gen.setResourceDirectory(resourcedestdir);
- if (sourcedestdir != null)
- gen.setSourceDirectory(sourcedestdir);
-
- log("Generating from endpoint: " + sei, Project.MSG_INFO);
-
- gen.provide(sei);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(prevCL);
- }
- }
-
- public void execute() throws BuildException
- {
- if (sei == null)
- throw new BuildException("The sei attribute must be specified!", getLocation());
-
- if (fork)
- executeForked();
- else
- executeNonForked();
- }
-
- private Path getTaskClassPath()
- {
- // Why is everything in the Ant API a big hack???
- ClassLoader cl = this.getClass().getClassLoader();
- if (cl instanceof AntClassLoader)
- {
- return new Path(getProject(), ((AntClassLoader)cl).getClasspath());
- }
-
- return new Path(getProject());
- }
-
- private void executeForked() throws BuildException
- {
- command.setClassname(org.jboss.wsf.spi.tools.command.wsprovide.class.getName());
-
- Path path = command.createClasspath(getProject());
- path.append(getTaskClassPath());
- path.append(classpath);
-
- if (keep)
- command.createArgument().setValue("-k");
-
- if (genwsdl)
- command.createArgument().setValue("-w");
-
- if (destdir != null)
- {
- command.createArgument().setValue("-o");
- command.createArgument().setFile(destdir);
- }
- if (resourcedestdir != null)
- {
- command.createArgument().setValue("-r");
- command.createArgument().setFile(resourcedestdir);
- }
- if (sourcedestdir != null)
- {
- command.createArgument().setValue("-s");
- command.createArgument().setFile(sourcedestdir);
- }
-
- if (!verbose)
- command.createArgument().setValue("-q");
-
- // Always dump traces
- command.createArgument().setValue("-t");
- command.createArgument().setValue(sei);
-
- if (verbose)
- log("Command invoked: " + command.getJavaCommand().toString());
-
- ExecuteJava execute = new ExecuteJava();
- execute.setClasspath(path);
- execute.setJavaCommand(command.getJavaCommand());
- if (execute.fork(this) != 0)
- throw new BuildException("Could not invoke wsprovide", getLocation());
- }
-}
\ No newline at end of file
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/package.html (from rev 3296, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/ant/package.html)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/package.html (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/package.html 2007-05-30 08:43:49 UTC (rev 3302)
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body bgcolor="white">
+
+A stack indepedent SPI that's provides entry points to command line tools and ANT
+tasks that generate JAX-WS artefacts from WSDL or wrapper beans and WSDL from existing sources.
+
+<h3>Service provider responsibilities</h3>
+
+A service provider needs to implement both the factory and the actual <code>WSContractConsumer</code>
+or <code>WSContractProvider</code>.
+The ANT tasks and the command line tools offer static client interfaces and rely on a standard WSF service factory
+mechanism that allows pluggability of different implementations:
+
+<ul>
+ <li>See org.jboss.ws.integration.FactoryLoader</li>
+</ul>
+
+<h3>ANT tasks</h3>
+<ul>
+ <li>{@link org.jboss.wsf.spi.tools.ant.WSConsumeTask}</li>
+ <li>{@link org.jboss.wsf.spi.tools.ant.WSProvideTask}</li>
+</ul>
+
+<h3>Command line interfaces and shell scripts</h3>
+
+The shell scripts are installed with the JBossAS installation
+and can be found in the JBOSS_HOME/bin directory.
+<p/>
+
+They delegate to the following command line implementations:
+<ul>
+ <li>{@link org.jboss.wsf.spi.tools.cmd.WSConsume}</li>
+ <li>{@link org.jboss.wsf.spi.tools.cmd.WSProvide}</li>
+</ul>
+
+
+<h2>Related Documentation</h2>
+
+<ul>
+ <li>{@link org.jboss.ws.integration.FactoryLoader}
+</ul>
+
+For overviews, tutorials, examples, guides, and tool documentation, please see:
+<ul>
+ <li><a href="http://labs.jboss.com/jbossws/">JBossWS Userguide</a>
+</ul>
+<br>
+
+@since JBossWS 2.1
+
+</body>
+</html>
Modified: trunk/jbossws-core/ant-import-tests/build-testsuite.xml
===================================================================
--- trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/ant-import-tests/build-testsuite.xml 2007-05-30 08:43:49 UTC (rev 3302)
@@ -74,7 +74,7 @@
<target name="wsconsume" depends="tests-init" description="Consume JAX-WS contracts">
<!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.wsconsume">
+ <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask">
<classpath refid="ws.stack.classpath"/>
<classpath location="${spi.dir}/output/lib/jbossws-spi.jar"/>
@@ -179,7 +179,7 @@
<target name="wsprovide" depends="tests-compile" description="Provide the JAX-WS contracts.">
<!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.wsprovide">
+ <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.WSProvideTask">
<classpath refid="ws.stack.classpath"/>
<classpath refid="thirdparty.classpath"/>
<classpath location="${core.dir}/thirdparty/concurrent.jar"/>
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/deployer/domainAssertion/NopAssertionDeployer.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -30,7 +30,7 @@
* deploy a policy assertion. It is used as a placeholder by
* PolicyDeployer in case no modification to umdm or anything
* else is actually required (for example when running the
- * wsprovide tool).
+ * WSProvideTask tool).
*
* @author Stefano Maestri <mailto:stefano.maestri@javalinux.it>
* @author Alessio Soldano <mailto:alessio.soldano@javalinux.it>
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaDataBuilder.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -70,7 +70,7 @@
/**
* Creates a new PolicyMetaDataBuilder for server side policy processing.
*
- * @param toolMode True if running wsprovide (no policy deployments)
+ * @param toolMode True if running WSProvideTask (no policy deployments)
* @return
*/
public static PolicyMetaDataBuilder getServerSidePolicyMetaDataBuilder(boolean toolMode) {
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/SecurityStore.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -203,7 +203,7 @@
private String execPasswordCmd(String keyStorePasswordCmd) throws WSSecurityException
{
- if(log.isDebugEnabled()) log.debug("Executing command: " + keyStorePasswordCmd);
+ if(log.isDebugEnabled()) log.debug("Executing cmd: " + keyStorePasswordCmd);
try
{
Runtime rt = Runtime.getRuntime();
@@ -218,7 +218,7 @@
}
catch (Exception e)
{
- throw new WSSecurityException("Problems executing password command: " + keyStorePasswordCmd, e);
+ throw new WSSecurityException("Problems executing password cmd: " + keyStorePasswordCmd, e);
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSTools.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSTools.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/WSTools.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -46,7 +46,7 @@
private static Logger log = Logger.getLogger(WSTools.class);
/**
- * Entry point for the command line scripts.
+ * Entry point for the cmd line scripts.
* Just passes the arguments to
* @see generate(String)
* @param args
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -70,7 +70,7 @@
import org.jboss.wsf.spi.utils.JavaUtils;
/**
- * Helper class used by the command line tool "jbossws"
+ * Helper class used by the cmd line tool "jbossws"
* and ant task "wstools"
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
* @since Aug 19, 2005
Modified: trunk/jbossws-core/src/main/resources/samples/build.xml
===================================================================
--- trunk/jbossws-core/src/main/resources/samples/build.xml 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/main/resources/samples/build.xml 2007-05-30 08:43:49 UTC (rev 3302)
@@ -236,17 +236,17 @@
<!-- Generating sources -->
<!-- ================================================================== -->
- <target name="wsconsume" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
+ <target name="WSConsumeTask" depends="init" description="Consume JAX-WS contracts" if="HAVE_JDK_1.5">
- <!-- Define the JAX-WS wsconsume task -->
- <taskdef name="wsconsume" classname="org.jboss.ws.tools.jaxws.ant.wsconsume">
+ <!-- Define the JAX-WS WSConsumeTask task -->
+ <taskdef name="WSConsumeTask" classname="org.jboss.ws.tools.jaxws.ant.WSConsumeTask">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
- <classpath location="${thirdparty.dir}/jbossws-wsconsume-impl.jar"/>
+ <classpath location="${thirdparty.dir}/jbossws-WSConsumeTask-impl.jar"/>
<classpath location="${thirdparty.dir}/jaxb-xjc.jar"/>
</taskdef>
- <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/WSConsumeTask/java" keep="true"/>
</target>
<!--
@@ -328,17 +328,17 @@
<!--
Generate JAX-WS sources
-->
- <target name="wsprovide" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
+ <target name="WSProvideTask" depends="compile" description="Provide the JAX-WS contracts." if="HAVE_JDK_1.5">
- <!-- Define the JAX-WS wsprovide task -->
- <taskdef name="wsprovide" classname="org.jboss.ws.tools.jaxws.ant.wsprovide">
+ <!-- Define the JAX-WS WSProvideTask task -->
+ <taskdef name="WSProvideTask" classname="org.jboss.ws.tools.jaxws.ant.WSProvideTask">
<classpath refid="core.classpath"/>
<classpath refid="jbossws.classpath"/>
<classpath location="${thirdparty.dir}/concurrent.jar"/>
<classpath location="${tests.output.dir}/classes"/>
</taskdef>
- <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+ <wsprovide resourcedestdir="${tests.output.dir}/WSProvideTask/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
</target>
<target name="generate-resources" depends="servicegen,wstools,wsprovide">
@@ -372,7 +372,7 @@
<javac destdir="${tests.output.dir}/classes" debug="${javac.debug}" encoding="utf-8" verbose="${javac.verbose}" deprecation="${javac.deprecation}"
failonerror="${javac.fail.onerror}" excludesfile="${excludesfile}">
<src path="${tests.java.dir}"/>
- <src path="${tests.output.dir}/wsconsume/java"/>
+ <src path="${tests.output.dir}/WSConsumeTask/java"/>
<classpath refid="javac.classpath"/>
</javac>
</target>
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleEncryptTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleEncryptTestCase.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleEncryptTestCase.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -68,7 +68,7 @@
private Hello getPort() throws Exception
{
- URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecurity/HelloService.wsdl").toURL();
+ URL wsdlURL = new File("WSProvideTask/resources/jaxws/samples/wssecurity/HelloService.wsdl").toURL();
URL securityURL = new File("resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml").toURL();
QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "HelloService");
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleSignTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleSignTestCase.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleSignTestCase.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -64,7 +64,7 @@
private Hello getPort() throws Exception
{
- URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecurity/HelloService.wsdl").toURL();
+ URL wsdlURL = new File("WSProvideTask/resources/jaxws/samples/wssecurity/HelloService.wsdl").toURL();
URL securityURL = new File("resources/jaxws/samples/wssecurity/simple-sign/META-INF/jboss-wsse-client.xml").toURL();
QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "HelloService");
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurityAnnotatedpolicy/SimpleEncryptTestCase.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -33,8 +33,6 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.jaxws.client.ServiceExt;
/**
* Test WS-Security with RPC/Literal
@@ -68,7 +66,7 @@
private Hello getPort() throws Exception
{
- URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecurityAnnotatedpolicy/HelloService.wsdl").toURL();
+ URL wsdlURL = new File("WSProvideTask/resources/jaxws/samples/wssecurityAnnotatedpolicy/HelloService.wsdl").toURL();
QName serviceName = new QName("http://org.jboss.ws/samples/wssecurityAnnotatedpolicy", "HelloService");
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-30 08:43:26 UTC (rev 3301)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/tools/jaxws/WSContractProviderTestCase.java 2007-05-30 08:43:49 UTC (rev 3302)
@@ -42,7 +42,7 @@
public void testBasic() throws Exception
{
WSContractProvider gen = getGenerator();
- File outputDir = new File("tools/wsprovide/basic/out");
+ File outputDir = new File("tools/WSProvideTask/basic/out");
gen.setOutputDirectory(outputDir);
gen.provide(DocWrappedServiceImpl.class);
@@ -84,7 +84,7 @@
public void testSource() throws Exception
{
WSContractProvider gen = getGenerator();
- File outputDir = new File("tools/wsprovide/source/out");
+ File outputDir = new File("tools/WSProvideTask/source/out");
gen.setOutputDirectory(outputDir);
gen.setGenerateSource(true);
gen.provide(DocWrappedServiceImpl.class);
@@ -96,8 +96,8 @@
public void testSourceDir() throws Exception
{
WSContractProvider gen = getGenerator();
- File outputDir = new File("tools/wsprovide/sourcedir/out");
- File sourceDir = new File("tools/wsprovide/sourcedir/source");
+ File outputDir = new File("tools/WSProvideTask/sourcedir/out");
+ File sourceDir = new File("tools/WSProvideTask/sourcedir/source");
gen.setOutputDirectory(outputDir);
gen.setSourceDirectory(sourceDir);
@@ -112,7 +112,7 @@
public void testWsdl() throws Exception
{
WSContractProvider gen = getGenerator();
- File outputDir = new File("tools/wsprovide/wsdl/out");
+ File outputDir = new File("tools/WSProvideTask/wsdl/out");
gen.setOutputDirectory(outputDir);
gen.setGenerateWsdl(true);
gen.provide(DocWrappedServiceImpl.class);
@@ -130,8 +130,8 @@
public void testResourceDir() throws Exception
{
WSContractProvider gen = getGenerator();
- File outputDir = new File("tools/wsprovide/resourcedir/out");
- File wsdlDir = new File("tools/wsprovide/resourcedir/wsdl");
+ File outputDir = new File("tools/WSProvideTask/resourcedir/out");
+ File wsdlDir = new File("tools/WSProvideTask/resourcedir/wsdl");
gen.setOutputDirectory(outputDir);
gen.setResourceDirectory(wsdlDir);
gen.setGenerateWsdl(true);
17 years, 8 months
JBossWS SVN: r3300 - in trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools: cmd and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-30 04:42:44 -0400 (Wed, 30 May 2007)
New Revision: 3300
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java
Removed:
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsconsume.java
trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsprovide.java
Log:
Rename ANT tasks and command line wrapper
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd (from rev 3295, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command)
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java (from rev 3296, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java 2007-05-30 08:42:44 UTC (rev 3300)
@@ -0,0 +1,249 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.spi.tools.cmd;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+import org.jboss.wsf.spi.tools.WSContractConsumer;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * WSConsumeTask is a cmd line tool that generates portable JAX-WS artifacts
+ * from a WSDL file.
+ *
+ * <pre>
+ * usage: WSConsumeTask [options] <wsdl-url>
+ * options:
+ * -h, --help Show this help message
+ * -b, --binding=<file> One or more JAX-WS or JAXB binding files
+ * -k, --keep Keep/Generate Java source
+ * -c --catalog=<file> Oasis XML Catalog file for entity resolution
+ * -p --package=<name> The target package for generated source
+ * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * -l, --load-consumer Load the consumer and exit (debug utility)
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSConsume
+{
+ private List<File> bindingFiles = new ArrayList<File>();
+ private boolean generateSource = false;
+ private File catalog = null;
+ private String targetPackage = null;
+ private String wsdlLocation = null;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private boolean loadConsumer = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", WSConsume.class.getName());
+
+ public static void main(String[] args)
+ {
+ WSConsume importer = new WSConsume();
+ URL wsdl = importer.parseArguments(args);
+ System.exit(importer.importServices(wsdl));
+ }
+
+ private URL parseArguments(String[] args)
+ {
+ String shortOpts = "hb:kc:p:w:o:s:qtl";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ new LongOpt("load-consumer", LongOpt.NO_ARGUMENT, null, 'l'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'b':
+ bindingFiles.add(new File(getopt.getOptarg()));
+ break;
+ case 'k':
+ generateSource = true;
+ break;
+ case 'c':
+ catalog = new File(getopt.getOptarg());
+ break;
+ case 'p':
+ targetPackage = getopt.getOptarg();
+ break;
+ case 'w':
+ wsdlLocation = getopt.getOptarg();
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'l':
+ loadConsumer = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ // debug output
+ if(loadConsumer)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+ System.out.println("WSContractConsumer instance: " + importer.getClass().getCanonicalName());
+ System.exit(0);
+ }
+
+ int wsdlPos = getopt.getOptind();
+ if (wsdlPos >= args.length)
+ {
+ System.err.println("Error: WSDL URL was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ URL url = null;
+ try
+ {
+ try
+ {
+ url = new URL(args[wsdlPos]);
+ }
+ catch (MalformedURLException e)
+ {
+ File file = new File(args[wsdlPos]);
+ url = file.toURL();
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: Invalid URI: " + args[wsdlPos]);
+ System.exit(1);
+ }
+
+ return url;
+ }
+
+
+ private int importServices(URL wsdl)
+ {
+ WSContractConsumer importer = WSContractConsumer.newInstance();
+
+ importer.setGenerateSource(generateSource);
+ importer.setOutputDirectory(outputDir);
+ if (sourceDir != null)
+ importer.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ importer.setMessageStream(System.out);
+
+ if (catalog != null)
+ importer.setCatalog(catalog);
+
+ if (targetPackage != null)
+ importer.setTargetPackage(targetPackage);
+
+ if (wsdlLocation != null)
+ importer.setWsdlLocation(wsdlLocation);
+
+ if (bindingFiles != null && bindingFiles.size() > 0)
+ importer.setBindingFiles(bindingFiles);
+
+ try
+ {
+ importer.consume(wsdl);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not import. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("WSConsumeTask is a cmd line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
+ out.println(" -p --package=<name> The target package for generated source");
+ out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.println(" -l, --load-consumer Load the consumer and exit (debug utility)");
+ out.flush();
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSConsume.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java (from rev 3296, trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java 2007-05-30 08:42:44 UTC (rev 3300)
@@ -0,0 +1,238 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.spi.tools.cmd;
+
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+import org.jboss.wsf.spi.tools.WSContractProvider;
+import org.jboss.wsf.spi.utils.JavaUtils;
+
+import java.io.File;
+import java.io.PrintStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * WSProvideTask is a cmd line tool that generates portable JAX-WS artifacts
+ * for a service endpoint implementation.
+ *
+ * <pre>
+ * usage: WSProvideTask [options] <endpoint class name>
+ * options:
+ * -h, --help Show this help message
+ * -k, --keep Keep/Generate Java source
+ * -w, --wsdl Enable WSDL file generation
+ * -c. --classpath=<path< The classpath that contains the endpoint
+ * -o, --output=<directory> The directory to put generated artifacts
+ * -r, --resource=<directory> The directory to put resource artifacts
+ * -s, --source=<directory> The directory to put Java source
+ * -q, --quiet Be somewhat more quiet
+ * -t, --show-traces Show full exception stack traces
+ * -l, --load-provider Load the provider and exit (debug utility)
+ * </pre>
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WSProvide
+{
+ private boolean generateSource = false;
+ private boolean generateWsdl = false;
+ private boolean quiet = false;
+ private boolean showTraces = false;
+ private boolean loadProvider = false;
+ private ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ private File outputDir = new File("output");
+ private File resourceDir = null;
+ private File sourceDir = null;
+
+ public static String PROGRAM_NAME = System.getProperty("program.name", WSProvide.class.getSimpleName());
+
+ public static void main(String[] args)
+ {
+ WSProvide generate = new WSProvide();
+ String endpoint = generate.parseArguments(args);
+ System.exit(generate.generate(endpoint));
+ }
+
+ private String parseArguments(String[] args)
+ {
+ String shortOpts = "hwko:r:s:c:qtl";
+ LongOpt[] longOpts =
+ {
+ new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
+ new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
+ new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
+ new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
+ new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
+ new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
+ new LongOpt("load-provider", LongOpt.NO_ARGUMENT, null, 'l'),
+ };
+
+ Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
+ int c;
+ while ((c = getopt.getopt()) != -1)
+ {
+ switch (c)
+ {
+ case 'k':
+ generateSource = true;
+ break;
+ case 's':
+ sourceDir = new File(getopt.getOptarg());
+ break;
+ case 'r':
+ resourceDir = new File(getopt.getOptarg());
+ break;
+ case 'w':
+ generateWsdl = true;
+ break;
+ case 't':
+ showTraces = true;
+ break;
+ case 'o':
+ outputDir = new File(getopt.getOptarg());
+ break;
+ case 'q':
+ quiet = true;
+ break;
+ case 'c':
+ processClassPath(getopt.getOptarg());
+ break;
+ case 'l':
+ loadProvider = true;
+ break;
+ case 'h':
+ printHelp();
+ System.exit(0);
+ case '?':
+ System.exit(1);
+ }
+ }
+
+ // debug output
+ if(loadProvider)
+ {
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ System.out.println("WSContractProvider instance: " + gen.getClass().getCanonicalName());
+ System.exit(0);
+ }
+
+ int endpointPos = getopt.getOptind();
+ if (endpointPos >= args.length)
+ {
+ System.err.println("Error: endpoint implementation was not specified!");
+ printHelp();
+ System.exit(1);
+ }
+
+ return args[endpointPos];
+ }
+
+
+ private int generate(String endpoint)
+ {
+ if (!JavaUtils.isLoaded(endpoint, loader))
+ {
+ System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
+ return 1;
+ }
+
+ WSContractProvider gen = WSContractProvider.newInstance(loader);
+ gen.setGenerateWsdl(generateWsdl);
+ gen.setGenerateSource(generateSource);
+ gen.setOutputDirectory(outputDir);
+ if (resourceDir != null)
+ gen.setResourceDirectory(resourceDir);
+ if (sourceDir != null)
+ gen.setSourceDirectory(sourceDir);
+
+ if (! quiet)
+ gen.setMessageStream(System.out);
+
+ try
+ {
+ gen.provide(endpoint);
+ return 0;
+ }
+ catch (Throwable t)
+ {
+ System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
+ if (!showTraces)
+ {
+ String message = t.getMessage();
+ if (message == null)
+ message = t.getClass().getSimpleName();
+ System.err.println("Error: " + message);
+ }
+ else
+ {
+ t.printStackTrace(System.err);
+ }
+
+ }
+
+ return 1;
+ }
+
+ private void processClassPath(String classPath)
+ {
+ String[] entries = classPath.split(File.pathSeparator);
+ List<URL> urls= new ArrayList<URL>(entries.length);
+ for (String entry : entries)
+ {
+ try
+ {
+ urls.add(new File(entry).toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ System.err.println("Error: a classpath entry was malformed: " + entry);
+ }
+ }
+ loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
+ }
+
+ private static void printHelp()
+ {
+ PrintStream out = System.out;
+ out.println("WSProvideTask generates portable JAX-WS artifacts for an endpoint implementation.\n");
+ out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
+ out.println("options: ");
+ out.println(" -h, --help Show this help message");
+ out.println(" -k, --keep Keep/Generate Java source");
+ out.println(" -w, --wsdl Enable WSDL file generation");
+ out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
+ out.println(" -o, --output=<directory> The directory to put generated artifacts");
+ out.println(" -r, --resource=<directory> The directory to put resource artifacts");
+ out.println(" -s, --source=<directory> The directory to put Java source");
+ out.println(" -q, --quiet Be somewhat more quiet");
+ out.println(" -t, --show-traces Show full exception stack traces");
+ out.flush();
+ }
+}
Property changes on: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/WSProvide.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsconsume.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsconsume.java 2007-05-30 07:17:39 UTC (rev 3295)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsconsume.java 2007-05-30 08:42:44 UTC (rev 3300)
@@ -1,233 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.spi.tools.command;
-
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-import org.jboss.wsf.spi.tools.api.WSContractConsumer;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * wsconsume is a command line tool that generates portable JAX-WS artifacts
- * from a WSDL file.
- *
- * <pre>
- * usage: wsconsume [options] <wsdl-url>
- * options:
- * -h, --help Show this help message
- * -b, --binding=<file> One or more JAX-WS or JAXB binding files
- * -k, --keep Keep/Generate Java source
- * -c --catalog=<file> Oasis XML Catalog file for entity resolution
- * -p --package=<name> The target package for generated source
- * -w --wsdlLocation=<loc> Value to use for @(a)WebService.wsdlLocation
- * -o, --output=<directory> The directory to put generated artifacts
- * -s, --source=<directory> The directory to put Java source
- * -q, --quiet Be somewhat more quiet
- * -t, --show-traces Show full exception stack traces
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsconsume
-{
- private List<File> bindingFiles = new ArrayList<File>();
- private boolean generateSource = false;
- private File catalog = null;
- private String targetPackage = null;
- private String wsdlLocation = null;
- private boolean quiet = false;
- private boolean showTraces = false;
- private File outputDir = new File("output");
- private File sourceDir = null;
-
- public static String PROGRAM_NAME = System.getProperty("program.name", wsconsume.class.getName());
-
- public static void main(String[] args)
- {
- wsconsume importer = new wsconsume();
- URL wsdl = importer.parseArguments(args);
- System.exit(importer.importServices(wsdl));
- }
-
- private URL parseArguments(String[] args)
- {
- String shortOpts = "hb:kc:p:w:o:s:qt";
- LongOpt[] longOpts =
- {
- new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
- new LongOpt("binding", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
- new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
- new LongOpt("catalog", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
- new LongOpt("package", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
- new LongOpt("wsdlLocation", LongOpt.REQUIRED_ARGUMENT, null, 'w'),
- new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
- new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
- new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
- new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
- };
-
- Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
- int c;
- while ((c = getopt.getopt()) != -1)
- {
- switch (c)
- {
- case 'b':
- bindingFiles.add(new File(getopt.getOptarg()));
- break;
- case 'k':
- generateSource = true;
- break;
- case 'c':
- catalog = new File(getopt.getOptarg());
- break;
- case 'p':
- targetPackage = getopt.getOptarg();
- break;
- case 'w':
- wsdlLocation = getopt.getOptarg();
- break;
- case 'o':
- outputDir = new File(getopt.getOptarg());
- break;
- case 's':
- sourceDir = new File(getopt.getOptarg());
- break;
- case 'q':
- quiet = true;
- break;
- case 't':
- showTraces = true;
- break;
- case 'h':
- printHelp();
- System.exit(0);
- case '?':
- System.exit(1);
- }
- }
-
- int wsdlPos = getopt.getOptind();
- if (wsdlPos >= args.length)
- {
- System.err.println("Error: WSDL URL was not specified!");
- printHelp();
- System.exit(1);
- }
-
- URL url = null;
- try
- {
- try
- {
- url = new URL(args[wsdlPos]);
- }
- catch (MalformedURLException e)
- {
- File file = new File(args[wsdlPos]);
- url = file.toURL();
- }
- }
- catch (MalformedURLException e)
- {
- System.err.println("Error: Invalid URI: " + args[wsdlPos]);
- System.exit(1);
- }
-
- return url;
- }
-
-
- private int importServices(URL wsdl)
- {
- WSContractConsumer importer = WSContractConsumer.newInstance();
- importer.setGenerateSource(generateSource);
- importer.setOutputDirectory(outputDir);
- if (sourceDir != null)
- importer.setSourceDirectory(sourceDir);
-
- if (! quiet)
- importer.setMessageStream(System.out);
-
- if (catalog != null)
- importer.setCatalog(catalog);
-
- if (targetPackage != null)
- importer.setTargetPackage(targetPackage);
-
- if (wsdlLocation != null)
- importer.setWsdlLocation(wsdlLocation);
-
- if (bindingFiles != null && bindingFiles.size() > 0)
- importer.setBindingFiles(bindingFiles);
-
- try
- {
- importer.consume(wsdl);
- return 0;
- }
- catch (Throwable t)
- {
- System.err.println("Error: Could not import. (use --show-traces to see full traces)");
- if (!showTraces)
- {
- String message = t.getMessage();
- if (message == null)
- message = t.getClass().getSimpleName();
- System.err.println("Error: " + message);
- }
- else
- {
- t.printStackTrace(System.err);
- }
-
- }
-
- return 1;
- }
-
- private static void printHelp()
- {
- PrintStream out = System.out;
- out.println("wsconsume is a command line tool that generates portable JAX-WS artifacts from a WSDL file.\n");
- out.println("usage: " + PROGRAM_NAME + " [options] <wsdl-url>\n");
- out.println("options: ");
- out.println(" -h, --help Show this help message");
- out.println(" -b, --binding=<file> One or more JAX-WS or JAXB binding files ");
- out.println(" -k, --keep Keep/Generate Java source");
- out.println(" -c --catalog=<file> Oasis XML Catalog file for entity resolution");
- out.println(" -p --package=<name> The target package for generated source");
- out.println(" -w --wsdlLocation=<loc> Value to use for @WebService.wsdlLocation");
- out.println(" -o, --output=<directory> The directory to put generated artifacts");
- out.println(" -s, --source=<directory> The directory to put Java source");
- out.println(" -q, --quiet Be somewhat more quiet");
- out.println(" -t, --show-traces Show full exception stack traces");
- out.flush();
- }
-}
Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsprovide.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/command/wsprovide.java 2007-05-30 07:17:39 UTC (rev 3295)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/tools/cmd/wsprovide.java 2007-05-30 08:42:44 UTC (rev 3300)
@@ -1,224 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.spi.tools.command;
-
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-import org.jboss.wsf.spi.utils.JavaUtils;
-import org.jboss.wsf.spi.tools.api.WSContractProvider;
-
-import java.io.File;
-import java.io.PrintStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * wsprovide is a command line tool that generates portable JAX-WS artifacts
- * for a service endpoint implementation.
- *
- * <pre>
- * usage: wsprovide [options] <endpoint class name>
- * options:
- * -h, --help Show this help message
- * -k, --keep Keep/Generate Java source
- * -w, --wsdl Enable WSDL file generation
- * -c. --classpath=<path< The classpath that contains the endpoint
- * -o, --output=<directory> The directory to put generated artifacts
- * -r, --resource=<directory> The directory to put resource artifacts
- * -s, --source=<directory> The directory to put Java source
- * -q, --quiet Be somewhat more quiet
- * -t, --show-traces Show full exception stack traces
- * </pre>
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public class wsprovide
-{
- private boolean generateSource = false;
- private boolean generateWsdl = false;
- private boolean quiet = false;
- private boolean showTraces = false;
- private ClassLoader loader = Thread.currentThread().getContextClassLoader();
- private File outputDir = new File("output");
- private File resourceDir = null;
- private File sourceDir = null;
-
- public static String PROGRAM_NAME = System.getProperty("program.name", wsprovide.class.getSimpleName());
-
- public static void main(String[] args)
- {
- wsprovide generate = new wsprovide();
- String endpoint = generate.parseArguments(args);
- System.exit(generate.generate(endpoint));
- }
-
- private String parseArguments(String[] args)
- {
- String shortOpts = "hwko:r:s:c:qt";
- LongOpt[] longOpts =
- {
- new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
- new LongOpt("wsdl", LongOpt.NO_ARGUMENT, null, 'w'),
- new LongOpt("keep", LongOpt.NO_ARGUMENT, null, 'k'),
- new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'),
- new LongOpt("resource", LongOpt.REQUIRED_ARGUMENT, null, 'r'),
- new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'),
- new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
- new LongOpt("quiet", LongOpt.NO_ARGUMENT, null, 'q'),
- new LongOpt("show-traces", LongOpt.NO_ARGUMENT, null, 't'),
- };
-
- Getopt getopt = new Getopt(PROGRAM_NAME, args, shortOpts, longOpts);
- int c;
- while ((c = getopt.getopt()) != -1)
- {
- switch (c)
- {
- case 'k':
- generateSource = true;
- break;
- case 's':
- sourceDir = new File(getopt.getOptarg());
- break;
- case 'r':
- resourceDir = new File(getopt.getOptarg());
- break;
- case 'w':
- generateWsdl = true;
- break;
- case 't':
- showTraces = true;
- break;
- case 'o':
- outputDir = new File(getopt.getOptarg());
- break;
- case 'q':
- quiet = true;
- break;
- case 'c':
- processClassPath(getopt.getOptarg());
- break;
- case 'h':
- printHelp();
- System.exit(0);
- case '?':
- System.exit(1);
- }
- }
-
- int endpointPos = getopt.getOptind();
- if (endpointPos >= args.length)
- {
- System.err.println("Error: endpoint implementation was not specified!");
- printHelp();
- System.exit(1);
- }
-
- return args[endpointPos];
- }
-
-
- private int generate(String endpoint)
- {
- if (!JavaUtils.isLoaded(endpoint, loader))
- {
- System.err.println("Error: Could not load class [" + endpoint + "]. Did you specify a valid --classpath?");
- return 1;
- }
-
- WSContractProvider gen = WSContractProvider.newInstance(loader);
- gen.setGenerateWsdl(generateWsdl);
- gen.setGenerateSource(generateSource);
- gen.setOutputDirectory(outputDir);
- if (resourceDir != null)
- gen.setResourceDirectory(resourceDir);
- if (sourceDir != null)
- gen.setSourceDirectory(sourceDir);
-
- if (! quiet)
- gen.setMessageStream(System.out);
-
- try
- {
- gen.provide(endpoint);
- return 0;
- }
- catch (Throwable t)
- {
- System.err.println("Error: Could not generate. (use --show-traces to see full traces)");
- if (!showTraces)
- {
- String message = t.getMessage();
- if (message == null)
- message = t.getClass().getSimpleName();
- System.err.println("Error: " + message);
- }
- else
- {
- t.printStackTrace(System.err);
- }
-
- }
-
- return 1;
- }
-
- private void processClassPath(String classPath)
- {
- String[] entries = classPath.split(File.pathSeparator);
- List<URL> urls= new ArrayList<URL>(entries.length);
- for (String entry : entries)
- {
- try
- {
- urls.add(new File(entry).toURL());
- }
- catch (MalformedURLException e)
- {
- System.err.println("Error: a classpath entry was malformed: " + entry);
- }
- }
- loader = new URLClassLoader(urls.toArray(new URL[0]), loader);
- }
-
- private static void printHelp()
- {
- PrintStream out = System.out;
- out.println("wsprovide generates portable JAX-WS artifacts for an endpoint implementation.\n");
- out.println("usage: " + PROGRAM_NAME + " [options] <endpoint class name>\n");
- out.println("options: ");
- out.println(" -h, --help Show this help message");
- out.println(" -k, --keep Keep/Generate Java source");
- out.println(" -w, --wsdl Enable WSDL file generation");
- out.println(" -c. --classpath=<path> The classpath that contains the endpoint");
- out.println(" -o, --output=<directory> The directory to put generated artifacts");
- out.println(" -r, --resource=<directory> The directory to put resource artifacts");
- out.println(" -s, --source=<directory> The directory to put Java source");
- out.println(" -q, --quiet Be somewhat more quiet");
- out.println(" -t, --show-traces Show full exception stack traces");
- out.flush();
- }
-}
17 years, 8 months
JBossWS SVN: r3299 - trunk/integration/native/ant-import.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-05-30 04:38:39 -0400 (Wed, 30 May 2007)
New Revision: 3299
Modified:
trunk/integration/native/ant-import/macros-deploy-native.xml
Log:
Clean up tools dependencies between deploy/undeploy
Modified: trunk/integration/native/ant-import/macros-deploy-native.xml
===================================================================
--- trunk/integration/native/ant-import/macros-deploy-native.xml 2007-05-30 08:15:50 UTC (rev 3298)
+++ trunk/integration/native/ant-import/macros-deploy-native.xml 2007-05-30 08:38:39 UTC (rev 3299)
@@ -37,14 +37,15 @@
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
- <include name="jbossws-client.jar"/>
- <include name="jbossws-integration-tools.jar"/>
+ <include name="jbossws-client.jar"/>
</fileset>
<fileset dir="@{thirdpartylibs}">
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
<include name="wsdl4j.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="jaxws-rt.jar"/>
</fileset>
</copy>
<copy todir="${jboss50.home}/lib" overwrite="true">
@@ -92,7 +93,10 @@
<include name="jboss-jaxws.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-client.jar"/>
+ <include name="jbossws-integration-tools.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="jaxws-rt.jar"/>
</fileset>
<fileset dir="${jboss50.home}/server/${jboss.server.instance}/lib">
<include name="jbossws-spi.jar"/>
@@ -139,7 +143,9 @@
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxb-xjc.jar"/>
- <include name="wsdl4j.jar"/>
+ <include name="wsdl4j.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="jaxws-rt.jar"/>
</fileset>
</copy>
<copy todir="${jboss42.home}/server/${jboss.server.instance}/lib" overwrite="true">
@@ -180,6 +186,8 @@
<include name="jbossws-client.jar"/>
<include name="jbossws-integration-tools.jar"/>
<include name="jbossws-wsconsume-impl.jar"/>
+ <include name="jaxws-tools.jar"/>
+ <include name="jaxws-rt.jar"/>
</fileset>
<fileset dir="${jboss42.home}/lib">
<include name="jbossws-integration.jar"/> <!-- The old integration jar-->
17 years, 8 months
JBossWS SVN: r3298 - in trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws: handlerlifecycle and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-05-30 04:15:50 -0400 (Wed, 30 May 2007)
New Revision: 3298
Modified:
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529Impl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java
Log:
Fix service names
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/binding/SOAPBindingTestCase.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -54,7 +54,7 @@
public void testClientAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-binding?wsdl");
- QName qname = new QName("http://org.jboss.ws/jaxws/binding", "SOAPEndpointService");
+ QName qname = new QName("http://org.jboss.ws/jaxws/binding", "SOAPEndpointBeanService");
Service service = Service.create(wsdlURL, qname);
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerlifecycle/HandlerLifecycleTestCase.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -60,7 +60,7 @@
if (trackerPort == null)
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/tracker?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointService");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "TrackerEndpointBeanService");
Service service = Service.create(wsdlURL, serviceName);
trackerPort = (TrackerEndpoint)service.getPort(TrackerEndpoint.class);
}
@@ -68,7 +68,7 @@
if (port == null)
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerlifecycle/soap?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointService");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerlifecycle", "SOAPEndpointBeanService");
Service service = Service.create(wsdlURL, serviceName);
port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
}
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/handlerscope/HandlerScopeTestCase.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -49,7 +49,7 @@
public void testClientAccess() throws Exception
{
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-handlerscope?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointService");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/handlerscope", "SOAPEndpointBeanService");
Service service = Service.create(wsdlURL, serviceName);
SOAPEndpoint port = (SOAPEndpoint)service.getPort(SOAPEndpoint.class);
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -42,7 +42,7 @@
* @author darran.lofthouse(a)jboss.com
* @since 19-October-2006
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint", targetNamespace = "http://org.jboss/test/ws/jbws1190", name = "Test")
+@WebService(name = "Test", serviceName = "TestService", targetNamespace = "http://org.jboss/test/ws/jbws1190", endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint")
public class TestEndpointImpl implements TestEndpoint
{
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357Impl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -23,7 +23,7 @@
import javax.jws.WebService;
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.jbws1357.JBWS1357", name="JBWS1357")
+@WebService(name="JBWS1357", serviceName="JBWS1357Service", endpointInterface="org.jboss.test.ws.jaxws.jbws1357.JBWS1357")
public class JBWS1357Impl implements JBWS1357
{
public String echo(String message)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529Impl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529Impl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws1529/JBWS1529Impl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -25,7 +25,7 @@
// An endpoint implementation that does not define a target namespace
// does NOT inherit the namespace from the referrenced SEI
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.jbws1529.JBWS1529", name="JBWS1529")
+@WebService(name="JBWS1529", serviceName="JBWS1529Service", endpointInterface="org.jboss.test.ws.jaxws.jbws1529.JBWS1529")
public class JBWS1529Impl implements JBWS1529
{
public String echo(String message) throws UserException
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/jbws944/EJB3Bean01.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -31,7 +31,7 @@
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.wsf.spi.annotation.WebContext;
-@WebService(name = "EJB3Bean", targetNamespace = "http://org.jboss.ws/jbws944")
+@WebService(name = "EJB3Bean", serviceName = "EJB3BeanService", targetNamespace = "http://org.jboss.ws/jbws944")
@WebContext(contextRoot = "/jaxws-jbws944", urlPattern = "/FooBean01")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wrapped/accessor/AccessorImpl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -23,7 +23,7 @@
import javax.jws.WebService;
-@WebService(endpointInterface="org.jboss.test.ws.jaxws.wrapped.accessor.Accessor", name="Accessor")
+@WebService(name="Accessor", serviceName="AccessorService", endpointInterface="org.jboss.test.ws.jaxws.wrapped.accessor.Accessor")
public class AccessorImpl implements Accessor
{
public String fieldAccessor(String one, int two)
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/FaultToEndpointImpl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -42,7 +42,7 @@
* @since 24-Nov-2005
*/
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
-@WebService(name = "FaultToEndpoint", targetNamespace = "http://org.jboss.ws/addressing/replyto")
+@WebService(name = "FaultToEndpoint", serviceName = "FaultToEndpointService", targetNamespace = "http://org.jboss.ws/addressing/replyto")
public class FaultToEndpointImpl
{
// provide logging
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -40,7 +40,7 @@
* @since 24-Nov-2005
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@WebService(name = "InitialEndpoint", targetNamespace = "http://org.jboss.ws/addressing/replyto")
+@WebService(name = "InitialEndpoint", serviceName = "InitialEndpointService", targetNamespace = "http://org.jboss.ws/addressing/replyto")
@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public class InitialEndpointImpl implements InitialEndpoint
{
Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java 2007-05-30 08:01:59 UTC (rev 3297)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/ReplyToEndpointImpl.java 2007-05-30 08:15:50 UTC (rev 3298)
@@ -42,7 +42,7 @@
* @since 24-Nov-2005
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@WebService(name = "ReplyToEndpoint", targetNamespace = "http://org.jboss.ws/addressing/replyto")
+@WebService(name = "ReplyToEndpoint", serviceName = "ReplyToEndpointService", targetNamespace = "http://org.jboss.ws/addressing/replyto")
public class ReplyToEndpointImpl implements ReplyToEndpoint
{
// provide logging
17 years, 8 months