Author: darran.lofthouse(a)jboss.com
Date: 2006-10-19 11:10:32 -0400 (Thu, 19 Oct 2006)
New Revision: 1273
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.java
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/web.xml
Modified:
branches/dlofthouse/JBWS-1190/src/test/ant/build-jars-jaxws.xml
Log:
JBWS-1190 - Test Case
Modified: branches/dlofthouse/JBWS-1190/src/test/ant/build-jars-jaxws.xml
===================================================================
--- branches/dlofthouse/JBWS-1190/src/test/ant/build-jars-jaxws.xml 2006-10-19 15:07:59
UTC (rev 1272)
+++ branches/dlofthouse/JBWS-1190/src/test/ant/build-jars-jaxws.xml 2006-10-19 15:10:32
UTC (rev 1273)
@@ -82,6 +82,16 @@
</classes>
</war>
+ <!-- jaxws-jbws1190 -->
+ <war destfile="${build.test.dir}/libs/jaxws-jbws1190.war"
webxml="${build.test.dir}/resources/jaxws/jbws1190/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl*.class"/>
+ <include
name="org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-jsr181-complex -->
<war warfile="${build.test.dir}/libs/jaxws-jsr181-complex.war"
webxml="${build.test.dir}/resources/jaxws/jsr181/complex/WEB-INF/web.xml">
<classes dir="${build.test.dir}/classes">
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,42 @@
+/*
+ * 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.jbws1190;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 19-October-2006
+ */
+@WebService(targetNamespace = "http://org.jboss/test/ws/jbws1190")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class ConfidentialEndpoint
+{
+
+ public String helloWorld(final String message)
+ {
+ return message;
+ }
+
+}
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/ConfidentialEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.java
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.java 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.java 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,52 @@
+/*
+ * 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.jbws1190;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 19-October-2006
+ */
+public class JBWS1190Exception extends RuntimeException
+{
+
+ public JBWS1190Exception()
+ {
+ super();
+ }
+
+ public JBWS1190Exception(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public JBWS1190Exception(final String message)
+ {
+ super(message);
+ }
+
+ public JBWS1190Exception(final Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190Exception.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,85 @@
+/*
+ * 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.jbws1190;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 19-October-2006
+ */
+public class JBWS1190TestCase extends JBossWSTest
+{
+
+ private static final String ARCHIVE_NAME = "jaxws-jbws1190.war";
+
+ private static Service service;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1190TestCase.class, ARCHIVE_NAME);
+ }
+
+ protected void setUp() throws Exception
+ {
+ if (service == null)
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws1190/TestEndpoint?wsdl");
+
+ QName qname = new QName("http://org.jboss/test/ws/jbws1190",
"TestEndpointService");
+ service = factory.createService(wsdlURL, qname);
+ }
+ }
+
+ public void testTestEndpoint() throws Exception
+ {
+ QName portName = new QName("http://org.jboss/test/ws/jbws1190",
"TestEndpointPort");
+ QName methodName = new QName("http://org.jboss/test/ws/jbws1190",
"testAddress");
+
+ Call call = service.createCall(portName);
+ call.setOperationName(methodName);
+ call.invoke(new Object[] { ARCHIVE_NAME, "TestEndpointService",
"http", "8080" });
+ }
+
+ public void testConfidentialEndpoint() throws Exception
+ {
+ QName portName = new QName("http://org.jboss/test/ws/jbws1190",
"TestEndpointPort");
+ QName methodName = new QName("http://org.jboss/test/ws/jbws1190",
"testAddress");
+
+ Call call = service.createCall(portName);
+ call.setOperationName(methodName);
+ call.invoke(new Object[] { ARCHIVE_NAME, "TestEndpointService",
"https", "8484" });
+ }
+
+}
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/JBWS1190TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,43 @@
+/*
+ * 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.jbws1190;
+
+import java.rmi.Remote;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 19-October-2006
+ */
+@WebService(targetNamespace = "http://org.jboss/test/ws/jbws1190")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface TestEndpoint extends Remote
+{
+
+ @WebMethod
+ public void testAddress(final String archive, final String service, final String
scheme, final String port);
+
+}
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,105 @@
+/*
+ * 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.jbws1190;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
+import org.jboss.ws.metadata.wsdl.WSDLService;
+import org.jboss.ws.server.ServerConfig;
+import org.jboss.ws.server.ServerConfigFactory;
+
+/**
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 19-October-2006
+ */
+@WebService(name = "TestEndpoint", endpointInterface =
"org.jboss.test.ws.jaxws.jbws1190.TestEndpoint")
+public class TestEndpointImpl implements TestEndpoint
+{
+
+ public void testAddress(final String archive, final String service, final String
scheme, final String port)
+ {
+ ServerConfigFactory serverConfigFactory = ServerConfigFactory.getInstance();
+ ServerConfig serverConfig = serverConfigFactory.getServerConfig();
+
+ File dataDir = serverConfig.getServerDataDir();
+ File wsdlDir = new File(dataDir.getAbsolutePath() + File.separator +
"wsdl" + File.separator + archive);
+
+ if (wsdlDir.exists() == false)
+ {
+ throw new JBWS1190Exception(wsdlDir.getAbsolutePath() + " does not
exist.");
+ }
+
+ File[] wsdls = wsdlDir.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ return name.startsWith(service);
+ }
+ });
+
+ assertEquals("WSDL files found", 1, wsdls.length);
+
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl;
+ try
+ {
+ wsdl = factory.parse(wsdls[0].toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ throw new JBWS1190Exception("Error readin WSDL", e);
+ }
+
+ WSDLService[] services = wsdl.getServices();
+ assertEquals("No of services", 1, services.length);
+
+ WSDLEndpoint[] endpoints = services[0].getEndpoints();
+ assertEquals("No of endpoints", 1, endpoints.length);
+
+ String address = endpoints[0].getAddress();
+ assertTrue("Expected Scheme '" + scheme + "'",
address.startsWith(scheme + "://"));
+ assertTrue("Expected Port '" + port + "'",
address.contains(":" + port + "/"));
+ }
+
+ private void assertEquals(final String message, final int expected, final int actual)
+ {
+ if (expected != actual)
+ {
+ throw new JBWS1190Exception(message + " expected=" + expected + "
actual=" + actual);
+ }
+ }
+
+ private void assertTrue(final String message, final boolean value)
+ {
+ if (value == false)
+ {
+ throw new JBWS1190Exception(message);
+ }
+ }
+}
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/web.xml
===================================================================
---
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/web.xml 2006-10-19
15:07:59 UTC (rev 1272)
+++
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/web.xml 2006-10-19
15:10:32 UTC (rev 1273)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>ConfidentialEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1190.ConfidentialEndpoint</servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1190.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ConfidentialEndpoint</servlet-name>
+ <url-pattern>/ConfidentialEndpoint</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>TestEndpoint</servlet-name>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>ConfidentialEndpoint</web-resource-name>
+ <url-pattern>/ConfidentialEndpoint</url-pattern>
+ </web-resource-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+</web-app>
\ No newline at end of file
Property changes on:
branches/dlofthouse/JBWS-1190/src/test/resources/jaxws/jbws1190/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF