[wise-commits] wise SVN: r555 - in core/trunk/integration-testsuite/common: src/test/java/org/jboss/wise/test/integration and 3 other directories.

wise-commits at lists.jboss.org wise-commits at lists.jboss.org
Mon Jun 10 19:06:33 EDT 2013


Author: alessio.soldano at jboss.com
Date: 2013-06-10 19:06:33 -0400 (Mon, 10 Jun 2013)
New Revision: 555

Added:
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBBean.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBInterface.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBean.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldInterface.java
   core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/JBIDE14739IntegrationTest.java
   core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/
   core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web-b.xml
   core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web.xml
Modified:
   core/trunk/integration-testsuite/common/pom.xml
Log:
[WISE-202] Adding testcase for the JBIDE-14739 scenario


Modified: core/trunk/integration-testsuite/common/pom.xml
===================================================================
--- core/trunk/integration-testsuite/common/pom.xml	2013-06-10 22:59:31 UTC (rev 554)
+++ core/trunk/integration-testsuite/common/pom.xml	2013-06-10 23:06:33 UTC (rev 555)
@@ -84,6 +84,56 @@
 						</configuration>
 					</execution>
 					<execution>
+						<id>war-it-jbide14739</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>war</goal>
+						</goals>
+						<configuration>
+							<webXml>${basedir}/src/test/resources/WEB-INF/jbide14739/web.xml</webXml>
+							<warName>jbide14739</warName>
+							<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+							<webappDirectory>${project.build.directory}/jbide14739</webappDirectory>
+							<warSourceExcludes>**/lib/**</warSourceExcludes>
+							<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+							<webResources>
+								<webResource>
+									<targetPath>WEB-INF/classes</targetPath>
+									<directory>${basedir}/target/test-classes/</directory>
+									<includes>
+										<include>**/jbide14739/HelloWorldBean.class</include>
+										<include>**/jbide14739/HelloWorldInterface.class</include>
+									</includes>
+								</webResource>
+							</webResources>
+						</configuration>
+					</execution>
+					<execution>
+						<id>war-it-jbide14739-b</id>
+						<phase>pre-integration-test</phase>
+						<goals>
+							<goal>war</goal>
+						</goals>
+						<configuration>
+							<webXml>${basedir}/src/test/resources/WEB-INF/jbide14739/web-b.xml</webXml>
+							<warName>jbide14739B</warName>
+							<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
+							<webappDirectory>${project.build.directory}/jbide14739B</webappDirectory>
+							<warSourceExcludes>**/lib/**</warSourceExcludes>
+							<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
+							<webResources>
+								<webResource>
+									<targetPath>WEB-INF/classes</targetPath>
+									<directory>${basedir}/target/test-classes/</directory>
+									<includes>
+										<include>**/jbide14739/HelloWorldBBean.class</include>
+										<include>**/jbide14739/HelloWorldBInterface.class</include>
+									</includes>
+								</webResource>
+							</webResources>
+						</configuration>
+					</execution>
+					<execution>
 						<id>war-it-complex</id>
 						<phase>pre-integration-test</phase>
 						<goals>

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBBean.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBBean.java	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBBean.java	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.jbide14739;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.api.annotation.WebContext;
+ at WebService(endpointInterface = "org.jboss.wise.test.integration.jbide14739.HelloWorldBInterface",
+	    targetNamespace = "http://www.javalinux.it/helloworld",
+	    portName = "HelloWorldBeanPort",
+	    name = "HelloWorldInterface",
+	    serviceName = "HelloService" )
+ at WebContext(contextRoot="jbide14739")
+public class HelloWorldBBean implements HelloWorldBInterface {
+    public String echo( String input ) {
+        return input;
+    }
+    public String echoB( String input ) {
+        return input;
+    }
+}

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBInterface.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBInterface.java	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBInterface.java	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.jbide14739;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(targetNamespace = "http://www.javalinux.it/helloworld", name = "HelloWorldInterface")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface HelloWorldBInterface
+{
+   String echo(String input);
+   String echoB(String input);
+}

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBean.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBean.java	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldBean.java	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.jbide14739;
+
+import javax.jws.WebService;
+ at WebService( endpointInterface = "org.jboss.wise.test.integration.jbide14739.HelloWorldInterface", targetNamespace = "http://www.javalinux.it/helloworld", serviceName = "HelloService" )
+public class HelloWorldBean implements HelloWorldInterface {
+    public String echo( String input ) {
+        return input;
+    }
+}

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldInterface.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldInterface.java	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/HelloWorldInterface.java	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.jbide14739;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(targetNamespace = "http://www.javalinux.it/helloworld")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
+public interface HelloWorldInterface
+{
+   String echo(String input);
+}

Added: core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/JBIDE14739IntegrationTest.java
===================================================================
--- core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/JBIDE14739IntegrationTest.java	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/java/org/jboss/wise/test/integration/jbide14739/JBIDE14739IntegrationTest.java	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wise.test.integration.jbide14739;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Map;
+
+import org.jboss.wise.core.client.InvocationResult;
+import org.jboss.wise.core.client.WSDynamicClient;
+import org.jboss.wise.core.client.WSMethod;
+import org.jboss.wise.core.client.builder.WSDynamicClientBuilder;
+import org.jboss.wise.core.client.factories.WSDynamicClientFactory;
+import org.jboss.wise.core.test.WiseTest;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class JBIDE14739IntegrationTest extends WiseTest {
+    
+    @Test
+    public void shouldConsumeNewWsdlAfterEndpointRefresh() throws Exception {
+	URL warUrl = JBIDE14739IntegrationTest.class.getClassLoader().getResource("jbide14739.war");
+	URL wsdlURL = new URL(getServerHostAndPort() + "/jbide14739/HelloWorld?wsdl");
+	try {
+	    deployWS(warUrl);
+	    checkWsdl(wsdlURL);
+	    runWise(wsdlURL, "target/temp/wise/jbide14739", "echo");
+	} finally {
+	    undeployWS(warUrl);
+	}
+	
+	warUrl = JBIDE14739IntegrationTest.class.getClassLoader().getResource("jbide14739B.war");
+	
+	wsdlURL = new URL(getServerHostAndPort() + "/jbide14739/HelloWorld?wsdl");
+	try {
+	    deployWS(warUrl);
+	    checkWsdl(wsdlURL);
+	    runWise(wsdlURL, "target/temp/wise/jbide14739B", "echoB");
+	} finally {
+	    undeployWS(warUrl);
+	}
+    }
+    
+    private void checkWsdl(URL wsdlURL) throws Exception {
+	BufferedReader br = new BufferedReader(new InputStreamReader(wsdlURL.openStream(), "UTF-8"));
+	StringBuilder sb = new StringBuilder();
+	try {
+	    String s;
+	    while ((s = br.readLine()) != null) {
+		sb.append(s);
+	    }
+	} finally {
+	    br.close();
+	}
+	System.out.println(sb.toString());
+    }
+    
+    private void runWise(URL wsdlURL, String tempDir, String methodName) throws Exception {
+	WSDynamicClientBuilder clientBuilder = WSDynamicClientFactory.getJAXWSClientBuilder();
+	WSDynamicClient client = clientBuilder.tmpDir(tempDir).verbose(true).keepSource(true).wsdlURL(wsdlURL
+		.toString()).build();
+	WSMethod method = client.getWSMethod("HelloService", "HelloWorldBeanPort", methodName);
+	Map<String, Object> args = new java.util.HashMap<String, Object>();
+	args.put("arg0", "from-wise-client");
+	ByteArrayOutputStream bos = new ByteArrayOutputStream();
+	method.writeRequestPreview(args, bos);
+	Assert.assertTrue("Expected string containing '<arg0>from-wise-client</arg0>' but got: " + bos.toString(), bos.toString().contains("<arg0>from-wise-client</arg0>"));
+	InvocationResult result = method.invoke(args, null);
+	Map<String, Object> res = result.getMapRequestAndResult(null, null);
+	@SuppressWarnings("unchecked")
+	Map<String, Object> test = (Map<String, Object>) res.get("results");
+	client.close();
+	Assert.assertEquals("from-wise-client", test.get("result"));
+    }
+}

Added: core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web-b.xml
===================================================================
--- core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web-b.xml	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web-b.xml	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <servlet>
+        <servlet-name>HelloWorld</servlet-name>
+        <servlet-class>org.jboss.wise.test.integration.jbide14739.HelloWorldBBean</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>HelloWorld</servlet-name>
+        <url-pattern>/HelloWorld</url-pattern>
+    </servlet-mapping>
+
+</web-app>
+

Added: core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web.xml
===================================================================
--- core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web.xml	                        (rev 0)
+++ core/trunk/integration-testsuite/common/src/test/resources/WEB-INF/jbide14739/web.xml	2013-06-10 23:06:33 UTC (rev 555)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <servlet>
+        <servlet-name>HelloWorld</servlet-name>
+        <servlet-class>org.jboss.wise.test.integration.jbide14739.HelloWorldBean</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>HelloWorld</servlet-name>
+        <url-pattern>/HelloWorld</url-pattern>
+    </servlet-mapping>
+
+</web-app>
+



More information about the wise-commits mailing list