Author: thomas.diesler(a)jboss.com
Date: 2006-12-23 19:55:26 -0500 (Sat, 23 Dec 2006)
New Revision: 1773
Added:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt
Removed:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt
Modified:
branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
branches/tdiesler/trunk/jbossws-tests/build.xml
branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
Log:
Fix jse deployement for jboss42
Modified: branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-24
00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2006-12-24
00:55:26 UTC (rev 1773)
@@ -18,6 +18,8 @@
<target name="build-jars" description="Build the jaxrpc
deployments">
+ <mkdir dir="${tests.output.dir}/libs"/>
+
<!-- jaxrpc-anonymous -->
<war warfile="${tests.output.dir}/libs/jaxrpc-anonymous.war"
webxml="${tests.output.dir}/resources/jaxrpc/anonymous/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2006-12-24
00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2006-12-24
00:55:26 UTC (rev 1773)
@@ -18,6 +18,8 @@
<target name="build-jars" description="Build the
deployments.">
+ <mkdir dir="${tests.output.dir}/libs"/>
+
<!-- jaxws-asynchronous -->
<war warfile="${tests.output.dir}/libs/jaxws-asynchronous.war"
webxml="${tests.output.dir}/resources/jaxws/asynchronous/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -68,6 +70,15 @@
<include name="jboss-app.xml"/>
</metainf>
</jar>
+ <jar jarfile="${tests.output.dir}/libs/jaxws-eardeployment42.ear">
+ <fileset dir="${tests.output.dir}/libs">
+ <include name="jaxws-eardeployment.jar"/>
+ <include name="jaxws-eardeployment.war"/>
+ </fileset>
+ <metainf
dir="${tests.output.dir}/resources/jaxws/eardeployment/META-INF">
+ <include name="application.xml"/>
+ </metainf>
+ </jar>
<!-- jaxws-endpoint-servlet -->
<war warfile="${tests.output.dir}/libs/jaxws-endpoint-servlet.war"
webxml="${tests.output.dir}/resources/jaxws/endpoint/WEB-INF/web.xml">
Modified: branches/tdiesler/trunk/jbossws-tests/build.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/build.xml 2006-12-24 00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/build.xml 2006-12-24 00:55:26 UTC (rev 1773)
@@ -110,7 +110,7 @@
<target name="init" depends="prepare,thirdparty">
<!-- Define excluded tests -->
- <condition property="tests.excludesfile"
value="${tests.resources.dir}/tests-excludes.txt">
+ <condition property="tests.excludesfile"
value="${tests.resources.dir}/tests-no-excludes.txt">
<equals arg1="${jbossws.target.server}" arg2="jboss"/>
</condition>
<condition property="tests.excludesfile"
value="${tests.resources.dir}/tests-tomcat-excludes.txt">
@@ -159,8 +159,9 @@
-->
<path id="test.client.classpath">
<path refid="jbossws.client.classpath"/>
- <pathelement
location="${core.output.lib.dir}/jbossws-${jboss.integration.target}-integration.jar"/>
- <pathelement
location="${core.output.lib.dir}/jbossws-tomcat-integration.jar"/>
+ <pathelement
location="${integration.jboss50.dir}/output/lib/jbossws-${jboss.integration.target}-integration.jar"/>
+ <pathelement
location="${integration.jboss42.dir}/output/lib/jbossws-${jboss.integration.target}-integration.jar"/>
+ <pathelement
location="${integration.tomcat.dir}/output/lib/jbossws-tomcat-integration.jar"/>
<pathelement
location="${jboss.client}/jboss-aspect-jdk50-client.jar"/>
<pathelement
location="${jboss.client}/jboss-aop-jdk50-client.jar"/>
<pathelement location="${jboss.client}/jboss-ejb3-client.jar"/>
@@ -180,7 +181,7 @@
<!-- Compiling -->
<!-- ================================================================== -->
- <target name="compile"
depends="core-jars,jboss42-jars,jboss50-jars,tomcat-jars,compile14,compile15"
description="Compile sources"/>
+ <target name="compile" depends="compile14,compile15"
description="Compile sources"/>
<target name="compile14" depends="init"
unless="HAVE_JDK_1.5">
<mkdir dir="${tests.output.dir}/classes"/>
@@ -242,8 +243,6 @@
<!-- ================================================================== -->
<target name="main"
depends="compile,copy-resources,generate-sources,compile-generated,copy-generated"
description="Build the deployments.">
- <mkdir dir="${tests.output.dir}/reports"/>
- <mkdir dir="${tests.output.dir}/libs"/>
<ant antfile="${basedir}/ant-import/build-jars-jaxrpc.xml"
target="build-jars" inheritall="true"/>
<ant antfile="${basedir}/ant-import/build-jars-jaxws.xml"
target="build-jars" inheritall="true"/>
</target>
@@ -317,7 +316,7 @@
<antcall target="tests-main">
<param name="include.wildcard"
value="org/jboss/test/ws/**/*TestCase.class"/>
<param name="exclude.wildcard"
value="org/jboss/test/ws/*/benchmark/**"/>
- <param name="excludesfile"
value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile"
value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -326,7 +325,7 @@
<target name="tests-benchmark" description="Run benchmark unit
tests">
<antcall target="tests-main">
<param name="include.wildcard"
value="org/jboss/test/ws/benchmark/**/*TestCase.class"/>
- <param name="excludesfile"
value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile"
value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -344,7 +343,7 @@
<target name="tests-tools" description="Run tools unit
tests">
<antcall target="tests-main">
<param name="include.wildcard"
value="org/jboss/test/ws/tools/**/*TestCase.class"/>
- <param name="excludesfile"
value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="excludesfile"
value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
<antcall target="tests-report"/>
</target>
@@ -356,12 +355,14 @@
<target name="test" if="test" description="Run all unit
tests in a given directory">
<antcall target="tests-main">
<param name="include.wildcard"
value="org/jboss/test/ws/${test}/**/*TestCase.class"/>
- <param name="excludesfile"
value="${tests.resources.dir}/tests-excludes.txt"/>
+ <param name="exclude.wildcard"
value="org/jboss/test/ws/*/benchmark/**"/>
+ <param name="excludesfile"
value="${tests.resources.dir}/tests-no-excludes.txt"/>
</antcall>
</target>
<!-- Common test target -->
<target name="tests-main" depends="init">
+ <mkdir dir="${tests.output.dir}/reports"/>
<junit printsummary="yes" showoutput="yes"
dir="${tests.output.dir}">
<jvmarg value="-Djava.security.manager"/>
<sysproperty key="java.security.policy"
value="${tests.etc.dir}/tst.policy"/>
@@ -399,6 +400,7 @@
ant -Dtest=org.jboss.test.ws.jaxrpc.samples.jsr109pojo.RpcJSETestCase one-test
-->
<target name="one-test" depends="init" if="test"
description="Run a single unit test">
+ <mkdir dir="${tests.output.dir}/reports"/>
<junit printsummary="yes" showoutput="yes"
dir="${tests.output.dir}">
<jvmarg line="${remote.debug.line}"/>
<jvmarg value="-Djava.security.manager"/>
Modified: branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml 2006-12-24 00:55:22 UTC
(rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/etc/log4j.xml 2006-12-24 00:55:26 UTC
(rev 1773)
@@ -53,7 +53,7 @@
<!-- ================ -->
<category name="org.jboss.ws">
- <priority value="TRACE" class="org.jboss.logging.XLevel"/>
+ <priority value="DEBUG"/>
</category>
<category name="org.jboss.remoting">
Modified:
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java
===================================================================
---
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java 2006-12-24
00:55:22 UTC (rev 1772)
+++
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTest.java 2006-12-24
00:55:26 UTC (rev 1773)
@@ -70,6 +70,26 @@
return delegate.isTargetServerTomcat();
}
+ public String getJBossVersion()
+ {
+ return delegate.getJBossVersion();
+ }
+
+ public boolean isJBoss50()
+ {
+ return delegate.isJBoss50();
+ }
+
+ public boolean isJBoss42()
+ {
+ return delegate.isJBoss42();
+ }
+
+ public boolean isJBoss40()
+ {
+ return delegate.isJBoss40();
+ }
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
Modified:
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java
===================================================================
---
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2006-12-24
00:55:22 UTC (rev 1772)
+++
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/JBossWSTestHelper.java 2006-12-24
00:55:26 UTC (rev 1773)
@@ -26,9 +26,12 @@
import java.net.URL;
import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
+import org.jboss.ws.core.utils.ObjectNameFactory;
+
/**
* A JBossWS test helper that deals with test deployment/undeployment, etc.
*
@@ -37,6 +40,8 @@
*/
public class JBossWSTestHelper
{
+ private static MBeanServerConnection server;
+
/** Deploy the given archive
*/
public void deploy(String archive) throws Exception
@@ -54,23 +59,63 @@
}
/** True, if -Djbossws.target.server=jboss */
- public boolean isTargetServerJBoss()
+ public static boolean isTargetServerJBoss()
{
String targetServer = getTargetServer();
return "jboss".equals(targetServer);
}
/** True, if -Djbossws.target.server=tomcat */
- public boolean isTargetServerTomcat()
+ public static boolean isTargetServerTomcat()
{
String targetServer = getTargetServer();
return "tomcat".equals(targetServer);
}
- public MBeanServerConnection getServer() throws NamingException
+ public static String getJBossVersion()
{
- InitialContext iniCtx = new InitialContext();
- MBeanServerConnection server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ String jbossVersion = null;
+ if (isTargetServerJBoss())
+ {
+ try
+ {
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ jbossVersion = (String)getServer().getAttribute(oname,
"SpecificationVersion");
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ ex.printStackTrace();
+ }
+ }
+ return jbossVersion;
+ }
+
+ public static boolean isJBoss50()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("5.0");
+ }
+
+ public static boolean isJBoss42()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("4.2");
+ }
+
+ public static boolean isJBoss40()
+ {
+ String jbossVersion = getJBossVersion();
+ return jbossVersion != null && jbossVersion.startsWith("4.0");
+ }
+
+ public static MBeanServerConnection getServer() throws NamingException
+ {
+ if (server == null)
+ {
+ InitialContext iniCtx = new InitialContext();
+ server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
return server;
}
@@ -92,7 +137,7 @@
}
}
- private String getTargetServer()
+ private static String getTargetServer()
{
return System.getProperty("jbossws.target.server");
}
Modified:
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java
===================================================================
---
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-24
00:55:22 UTC (rev 1772)
+++
branches/tdiesler/trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EarTestCase.java 2006-12-24
00:55:26 UTC (rev 1773)
@@ -29,6 +29,7 @@
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestHelper;
import org.jboss.test.ws.JBossWSTestSetup;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
@@ -46,45 +47,49 @@
{
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(EarTestCase.class,
"jaxws-eardeployment.ear");
+ String earName = (JBossWSTestHelper.isJBoss50() ?
"jaxws-eardeployment.ear" : "jaxws-eardeployment42.ear");
+ return JBossWSTestSetup.newTestSetup(EarTestCase.class, earName);
}
-
+
public void testResourceURL() throws Exception
{
File earFile = new File("libs/jaxws-eardeployment.ear");
assertTrue(earFile.exists());
-
+
URL warURL = new URL("jar:" + earFile.toURL() +
"!/jaxws-eardeployment.war!/");
URL wsdlURL = new URL(warURL, "WEB-INF/wsdl/TestEndpoint.wsdl");
-
+
Element root = DOMUtils.parse(new ResourceURL(wsdlURL).openStream());
assertNotNull(root);
}
public void testVirtualFile() throws Exception
{
+ if (isJBoss50() == false)
+ return;
+
File earFile = new File("libs/jaxws-eardeployment.ear");
assertTrue(earFile.exists());
-
+
URL earURL = earFile.toURL();
VFS fsEar = VFS.getVFS(earURL);
VirtualFile vfWar = fsEar.findChild("jaxws-eardeployment.war");
assertNotNull(earURL + "!/jaxws-eardeployment.war", vfWar);
-
+
VirtualFile vfWsdl = vfWar.findChild("WEB-INF/wsdl/TestEndpoint.wsdl");
assertNotNull(earURL +
"!/jaxws-eardeployment.war!/WEB-INF/wsdl/TestEndpoint.wsdl", vfWsdl);
-
+
Element root = DOMUtils.parse(vfWsdl.openStream());
assertNotNull(root);
}
public void testEJB3Endpoint() throws Exception
{
- URL wsdlURL = new URL ("http://" + getServerHost() +
":8080/earejb3/EJB3Bean?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/earejb3/EJB3Bean?wsdl");
QName serviceName = new
QName("http://eardeployment.jaxws.ws.test.jboss.org/",
"TestEndpointService");
TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
TestEndpoint port = service.getTestEndpointPort();
-
+
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
@@ -92,11 +97,11 @@
public void testJSEEndpoint() throws Exception
{
- URL wsdlURL = new URL ("http://" + getServerHost() +
":8080/earjse/JSEBean?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/earjse/JSEBean?wsdl");
QName serviceName = new
QName("http://eardeployment.jaxws.ws.test.jboss.org/",
"TestEndpointService");
TestEndpointService service = new TestEndpointService(wsdlURL, serviceName);
TestEndpoint port = service.getTestEndpointPort();
-
+
String helloWorld = "Hello world!";
String retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
Added:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
===================================================================
---
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml 2006-12-24
00:55:22 UTC (rev 1772)
+++
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml 2006-12-24
00:55:26 UTC (rev 1773)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This is only needed for JBoss-4.2 deployments -->
+
+<application
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/application_1_4.xsd"
+ version="1.4">
+
+ <module>
+ <web>
+ <web-uri>jaxws-eardeployment.war</web-uri>
+ <context-root>earjse</context-root>
+ </web>
+ </module>
+ <module>
+ <java>jaxws-eardeployment.jar</java>
+ </module>
+
+</application>
\ No newline at end of file
Property changes on:
branches/tdiesler/trunk/jbossws-tests/src/main/resources/jaxws/eardeployment/META-INF/application.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-24
00:55:22 UTC (rev 1772)
+++ branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-24
00:55:26 UTC (rev 1773)
@@ -1 +0,0 @@
-org/jboss/test/ws/*/benchmark/**
\ No newline at end of file
Copied: branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt
(from rev 1762,
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt)
===================================================================
--- branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-excludes.txt 2006-12-23
19:20:31 UTC (rev 1762)
+++
branches/tdiesler/trunk/jbossws-tests/src/main/resources/tests-no-excludes.txt 2006-12-24
00:55:26 UTC (rev 1773)
@@ -0,0 +1 @@
+nothing-to-exclude/**
\ No newline at end of file