JBossWS SVN: r14327 - stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2011-05-09 09:26:25 -0400 (Mon, 09 May 2011)
New Revision: 14327
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
Log:
[JBPAPP-6436] Avoid useless lookups of SOAPFactory
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2011-05-09 13:13:38 UTC (rev 14326)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPFactoryImpl.java 2011-05-09 13:26:25 UTC (rev 14327)
@@ -118,8 +118,7 @@
String prefix = domElement.getPrefix() != null ? domElement.getPrefix() : "";
String nsURI = domElement.getNamespaceURI() != null ? domElement.getNamespaceURI() : "";
- SOAPFactory factory = SOAPFactory.newInstance();
- SOAPElement soapElement = factory.createElement(localName, prefix, nsURI);
+ SOAPElement soapElement = this.createElement(localName, prefix, nsURI);
DOMUtils.copyAttributes(soapElement, domElement);
13 years, 10 months
JBossWS SVN: r14326 - in stack/native/trunk: modules/testsuite/shared-tests and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 09:13:38 -0400 (Mon, 09 May 2011)
New Revision: 14326
Modified:
stack/native/trunk/modules/testsuite/shared-tests/pom.xml
stack/native/trunk/pom.xml
Log:
shared-testsuite have to have test scope
Modified: stack/native/trunk/modules/testsuite/shared-tests/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/shared-tests/pom.xml 2011-05-09 11:47:36 UTC (rev 14325)
+++ stack/native/trunk/modules/testsuite/shared-tests/pom.xml 2011-05-09 13:13:38 UTC (rev 14326)
@@ -86,24 +86,6 @@
</artifactItems>
</configuration>
</execution>
- <execution> <!-- This is used by WSRunClientTestCase -->
- <id>copy-junit</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <type>jar</type>
- <outputDirectory>${basedir}/target/junit-libs</outputDirectory>
- <destFileName>junit.jar</destFileName>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
</executions>
</plugin>
<plugin>
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2011-05-09 11:47:36 UTC (rev 14325)
+++ stack/native/trunk/pom.xml 2011-05-09 13:13:38 UTC (rev 14326)
@@ -107,17 +107,6 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-shared-testsuite</artifactId>
- <version>${jbossws.shared.testsuite.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
- <artifactId>jbossws-shared-testsuite</artifactId>
- <version>${jbossws.shared.testsuite.version}</version>
- <type>zip</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-jboss600</artifactId>
<version>${jbossws.jboss600.version}</version>
</dependency>
@@ -420,8 +409,20 @@
</exclusion>
</exclusions>
</dependency>
-
<dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ <version>${jbossws.shared.testsuite.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ <version>${jbossws.shared.testsuite.version}</version>
+ <type>zip</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
13 years, 10 months
JBossWS SVN: r14325 - in shared-testsuite/trunk/testsuite/src/test: resources/jaxws/smoke/tools and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 07:47:36 -0400 (Mon, 09 May 2011)
New Revision: 14325
Removed:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
shared-testsuite/trunk/testsuite/src/test/resources/jaxws/smoke/tools/wsrunclient/
Log:
wsrunclient.sh(.bat) no more supported on AS7
Deleted: shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2011-05-09 11:24:41 UTC (rev 14324)
+++ shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/smoke/tools/WSRunClientTestCase.java 2011-05-09 11:47:36 UTC (rev 14325)
@@ -1,179 +0,0 @@
-package org.jboss.test.ws.jaxws.smoke.tools;
-
-import java.io.File;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * [JBWS-2327] Provide tests for wsrunclient shell script
- *
- * @author richard.opalka(a)jboss.com
- */
-public final class WSRunClientTestCase extends JBossWSTest
-{
-
- private static final String FS = System.getProperty("file.separator");
- private static final String PS = System.getProperty("path.separator");
- private static final boolean isUnix = ":".equals( PS );
- private static final String SP = " ";
- private static final String EXT = isUnix ? ".sh" : ".bat";
- private String commandLineProperties;
- private String additionalClasspath;
- private List<String> testsToExecute;
- private String jbossHome = System.getProperty("jboss.home");
-
- /**
- * Initialization
- */
- public void setUp() throws Exception
- {
- List<String> properties = getContent("jaxws/smoke/tools/wsrunclient/properties.txt");
- assertTrue(properties.size() > 0);
- this.commandLineProperties = prepareEnvProperties(properties);
- this.testsToExecute = getContent("jaxws/smoke/tools/wsrunclient/tests.txt");
- assertTrue(this.testsToExecute.size() > 0);
- this.additionalClasspath = prepareAdditionalClasspath();
- }
-
- /**
- * Executing wsrunclient commandline script.
- * We're using simple trick here as we're running
- * junit tests via wsrunclient here.
- * The reason is we don't need to touch any test case
- * plus we can add any test case to the execution anytime.
- * Plus invoking the test classes via main method vs. junit runner is equivalent
- * from wsrunclient point of view.
- * @throws Exception if any error occurs
- */
- public void test() throws Exception
- {
- if (!isTargetJBoss6()) return; // wsrunclient not available since AS7x
-
- StringBuilder sb = new StringBuilder();
- Map<String, String> env = new HashMap<String, String>();
- env.put("WSRUNCLIENT_CLASSPATH", additionalClasspath);
- env.put("JAVA_OPTS", commandLineProperties);
-
- sb.append(jbossHome).append(FS).append("bin").append(FS).append("wsrunclient").append(EXT);
- sb.append(SP).append("junit.textui.TestRunner").append(SP);
- String commandWithoutTestParam = sb.toString();
- for (String test : testsToExecute)
- {
- executeCommand(commandWithoutTestParam + test, null, "wsrunclient", env);
- // There's no need to verify the test output.
- // If test that is executed fails executeCommand will fail (because of SC != 0)
- // The same applies to wrongly configured wsrunclient classpath.
- }
- }
-
- /**
- * Cleanup
- */
- public void tearDown() throws Exception
- {
- this.additionalClasspath = null;
- this.commandLineProperties = null;
- this.jbossHome = null;
- this.testsToExecute = null;
- }
-
- /**
- * Prepares additional classpath containing junit lib, test classes directory and jbossws integration jars.
- * The junit is needed, because we're running junit samples tests via wsrunclient.
- * Test classes directory contains test cases we're executing via wsrunclient.
- * Finally integration jars are needed because every test case extends JBossWSTest and it needs integration
- * jars to deploy tested archives to the server programatically. Generally, users of wsrunclient
- * will usually specify just test classes directory and test class to invoke main method on.
- */
- private String prepareAdditionalClasspath()
- {
- StringBuilder sb = new StringBuilder();
-
- // setup test classes dir
- sb.append(PS).append(System.getProperty("test.classes.directory"));
-
- // setup junit lib
- if (isDistroTest())
- {
- sb.append(PS).append(System.getProperty("user.dir")).append(FS).append("..");
- sb.append(FS).append("deploy").append(FS).append("lib").append(FS).append("junit.jar");
- }
- else
- {
- sb.append(PS).append(System.getProperty("basedir"));
- sb.append(FS).append("target").append(FS).append("junit-libs").append(FS).append("junit.jar");
- }
- //integration jars required just because we're running our tests that need to deploy archives
- sb.append(PS).append(jbossHome).append(FS).append("lib").append(FS).append("jboss-system.jar");
-
- return sb.toString();
- }
-
- /**
- * Prepares properties list for commandline execution
- * @param properties to be configured
- * @return commandline ready list of properties
- */
- private String prepareEnvProperties(List<String> properties)
- {
- StringBuilder sb = new StringBuilder();
-
- for (String key : properties)
- {
- String value = System.getProperty(key);
- assertNotNull("Undefined property '" + key + "'", value);
- assertFalse("Space found in property '" + key + "'", value.contains(SP));
- sb.append("-D").append(key).append("=").append(value).append(SP);
- }
-
- return sb.toString();
- }
-
- /**
- * Returns content of text file
- * @param resource to be parsed
- * @return list of values
- * @throws Exception if any I/O error ocurs
- */
- private List<String> getContent(String resource) throws Exception
- {
- File f = getResourceFile(resource);
- assertTrue(f.exists());
- List<String> retVal = new LinkedList<String>();
- BufferedReader br = null;
- try
- {
- br = new BufferedReader(new FileReader(f));
- String line = null;
- while ((line = br.readLine()) != null)
- {
- retVal.add(line.trim());
- }
- }
- finally
- {
- if (br != null)
- {
- br.close();
- }
- }
-
- return retVal;
- }
-
- /**
- * Detects whether we're running the distribution tests
- * @return true if distro tests are executed, false otherwise
- */
- private boolean isDistroTest()
- {
- return Boolean.getBoolean("binary.distribution");
- }
-
-}
13 years, 10 months
JBossWS SVN: r14324 - in shared-testsuite/trunk: src and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 07:24:41 -0400 (Mon, 09 May 2011)
New Revision: 14324
Added:
shared-testsuite/trunk/src/
shared-testsuite/trunk/src/main/
shared-testsuite/trunk/src/main/java/
shared-testsuite/trunk/src/main/java/org/
shared-testsuite/trunk/src/main/java/org/jboss/
shared-testsuite/trunk/src/main/java/org/jboss/wsf/
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/DeployerJBoss6.java
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/XOPTestSupport.java
shared-testsuite/trunk/src/main/java/pom.xml
Modified:
shared-testsuite/trunk/pom.xml
shared-testsuite/trunk/testsuite/src/test/scripts/assembly-testsuite.xml
Log:
[JBWS-3289] refactoring test support classes to shared-testsuite SVN module
Modified: shared-testsuite/trunk/pom.xml
===================================================================
--- shared-testsuite/trunk/pom.xml 2011-05-09 11:22:03 UTC (rev 14323)
+++ shared-testsuite/trunk/pom.xml 2011-05-09 11:24:41 UTC (rev 14324)
@@ -4,7 +4,6 @@
<name>JBoss Web Services - Stack Agnostic Test Suite</name>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-shared-testsuite</artifactId>
- <packaging>pom</packaging>
<description>JBossWS Stack Agnostic Testsuite</description>
<version>4.0.0-SNAPSHOT</version>
@@ -23,7 +22,33 @@
<url>http://fisheye.jboss.com/viewrep/JBossWS/shared-testsuite/trunk</url>
</scm>
- <!-- Plugins -->
+ <properties>
+ <jbossws.common.version>2.0.0-SNAPSHOT</jbossws.common.version>
+ <jboss.logging.version>2.0.5.GA</jboss.logging.version>
+ <junit.version>3.8.2</junit.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-common</artifactId>
+ <version>${jbossws.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>${jboss.logging.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
<build>
<plugins>
<plugin>
@@ -36,7 +61,7 @@
</goals>
<configuration>
<descriptors>
- <descriptor>src/test/scripts/assembly-testsuite.xml</descriptor>
+ <descriptor>testsuite/src/test/scripts/assembly-testsuite.xml</descriptor>
</descriptors>
</configuration>
</execution>
Added: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/DeployerJBoss6.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/DeployerJBoss6.java (rev 0)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/DeployerJBoss6.java 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
+ * as indicated by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.wsf.test;
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.jboss.wsf.spi.deployer.Deployer;
+
+/**
+ * A JBossWS test helper that deals with test deployment/undeployment, etc.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class DeployerJBoss6 implements Deployer
+{
+
+ private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+ private MBeanServerConnection server;
+
+ public DeployerJBoss6()
+ {
+ this.server = JBossWSTestHelper.getServer();
+ }
+
+ public void deploy(final URL url) throws Exception
+ {
+ invokeMainDeployer("deploy", url);
+ }
+
+ public void undeploy(final URL url) throws Exception
+ {
+ invokeMainDeployer("undeploy", url);
+ }
+
+ private void invokeMainDeployer(final String methodName, final URL url) throws Exception
+ {
+ server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[]
+ {url}, new String[]
+ {"java.net.URL"});
+ }
+
+}
Added: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java (rev 0)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,461 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.DOMWriter;
+import org.jboss.ws.common.concurrent.CopyJob;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Base class for JBossWS test cases.
+ *
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public abstract class JBossWSTest extends TestCase
+{
+ protected static Logger log = Logger.getLogger(JBossWSTest.class.getName());
+ //private static JBossWSTestHelper delegate = new JBossWSTestHelper();
+
+ public JBossWSTest()
+ {
+ }
+
+ public JBossWSTest(String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Execute <b>command</b> in separate process.
+ * @param command command to execute
+ * @throws IOException if I/O error occurs
+ */
+ public static void executeCommand(String command) throws IOException
+ {
+ executeCommand(command, null, null, null);
+ }
+
+ /**
+ * Execute <b>command</b> in separate process. If process will fail, display custom <b>message</b> in assertion.
+ * @param command command to execute
+ * @param message message to display if assertion fails
+ * @throws IOException if I/O error occurs
+ */
+ public static void executeCommand(String command, String message) throws IOException
+ {
+ executeCommand(command, null, message, null);
+ }
+
+ /**
+ * Execute <b>command</b> in separate process, copy process input to <b>os</b>.
+ * @param command command to execute
+ * @param os output stream to copy process input to. If null, <b>System.out</b> will be used
+ * @throws IOException if I/O error occurs
+ */
+ public static void executeCommand(String command, OutputStream os) throws IOException
+ {
+ executeCommand(command, os, null, null);
+ }
+
+ /**
+ * Execute <b>command</b> in separate process, copy process input to <b>os</b>. If process will fail, display custom <b>message</b> in assertion.
+ * @param command command to execute
+ * @param os output stream to copy process input to. If null, <b>System.out</b> will be used
+ * @param message message to display if assertion fails
+ * @throws IOException if I/O error occurs
+ */
+ public static void executeCommand(String command, OutputStream os, String message) throws IOException
+ {
+ executeCommand(command, os, message, null);
+ }
+
+ /**
+ * Execute <b>command</b> in separate process, copy process input to <b>os</b>. If process will fail, display custom <b>message</b> in assertion.
+ * @param command command to execute
+ * @param os output stream to copy process input to. If null, <b>System.out</b> will be used
+ * @param message message to display if assertion fails
+ * @param env environment
+ * @throws IOException if I/O error occurs
+ */
+ public static void executeCommand(String command, OutputStream os, String message, Map<String, String> env) throws IOException
+ {
+ if (command == null)
+ throw new NullPointerException( "Command cannot be null" );
+
+ System.out.println("Executing command: " + command);
+ log.debug("Executing command: " + command);
+
+ StringTokenizer st = new StringTokenizer(command, " \t\r");
+ List<String> tokenizedCommand = new LinkedList<String>();
+ while (st.hasMoreTokens())
+ {
+ // PRECONDITION: command doesn't contain whitespaces in the paths
+ tokenizedCommand.add(st.nextToken());
+ }
+
+ try
+ {
+ executeCommand(tokenizedCommand, os, message, env);
+ }
+ catch (IOException e)
+ {
+ log.warn("Make sure there are no whitespaces in command paths", e);
+ throw e;
+ }
+ }
+
+ /**
+ * Execute <b>command</b> in separate process, copy process input to <b>os</b>. If process will fail, display custom <b>message</b> in assertion.
+ * @param command command to execute
+ * @param os output stream to copy process input to. If null, <b>System.out</b> will be used
+ * @param message message to display if assertion fails
+ * @param env environment
+ * @throws IOException if I/O error occurs
+ */
+ private static void executeCommand(List<String> command, OutputStream os, String message, Map<String, String> env) throws IOException
+ {
+ ProcessBuilder pb = new ProcessBuilder(command);
+ if (env != null)
+ {
+ for (String variable : env.keySet())
+ {
+ pb.environment().put(variable, env.get(variable));
+ }
+ }
+ Process p = pb.start();
+ CopyJob inputStreamJob = new CopyJob(p.getInputStream(), os == null ? System.out : os);
+ CopyJob errorStreamJob = new CopyJob(p.getErrorStream(), System.err);
+ // unfortunately the following threads are needed because of Windows behavior
+ System.out.println("Process input stream:");
+ System.err.println("Process error stream:");
+ Thread inputJob = new Thread(inputStreamJob);
+ Thread outputJob = new Thread(errorStreamJob);
+ try
+ {
+ inputJob.start();
+ inputJob.join(5000);
+ outputJob.start();
+ outputJob.join(5000);
+ int statusCode = p.waitFor();
+ String fallbackMessage = "Process did exit with status " + statusCode;
+ assertTrue(message != null ? message : fallbackMessage, statusCode == 0);
+ }
+ catch (InterruptedException ie)
+ {
+ ie.printStackTrace(System.err);
+ }
+ finally
+ {
+ inputStreamJob.kill();
+ errorStreamJob.kill();
+ p.destroy();
+ }
+ }
+
+ public static MBeanServerConnection getServer() throws NamingException
+ {
+ return JBossWSTestHelper.getServer();
+ }
+
+ public static boolean isTargetJBoss5()
+ {
+ return JBossWSTestHelper.isTargetJBoss5();
+ }
+
+ public static boolean isTargetJBoss51()
+ {
+ return JBossWSTestHelper.isTargetJBoss51();
+ }
+
+ public static boolean isTargetJBoss50()
+ {
+ return JBossWSTestHelper.isTargetJBoss50();
+ }
+
+ public static boolean isTargetJBoss6()
+ {
+ return JBossWSTestHelper.isTargetJBoss6();
+ }
+
+ public static boolean isTargetJBoss61()
+ {
+ return JBossWSTestHelper.isTargetJBoss61();
+ }
+
+ public static boolean isTargetJBoss60()
+ {
+ return JBossWSTestHelper.isTargetJBoss60();
+ }
+
+ public static boolean isIntegrationNative()
+ {
+ return JBossWSTestHelper.isIntegrationNative();
+ }
+
+ public static boolean isIntegrationMetro()
+ {
+ return JBossWSTestHelper.isIntegrationMetro();
+ }
+
+ public static boolean isIntegrationCXF()
+ {
+ return JBossWSTestHelper.isIntegrationCXF();
+ }
+
+ /** Deploy the given archive
+ */
+ public static void deploy(String archive) throws Exception
+ {
+ JBossWSTestHelper.deploy(archive);
+ }
+
+ /** Undeploy the given archive
+ */
+ public static void undeploy(String archive) throws Exception
+ {
+ JBossWSTestHelper.undeploy(archive);
+ }
+
+ public static String getServerHost()
+ {
+ return JBossWSTestHelper.getServerHost();
+ }
+
+ public static File getArchiveFile(String archive)
+ {
+ return JBossWSTestHelper.getArchiveFile(archive);
+ }
+
+ public static URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return JBossWSTestHelper.getArchiveURL(archive);
+ }
+
+ public static File getResourceFile(String resource)
+ {
+ return JBossWSTestHelper.getResourceFile(resource);
+ }
+
+ public static URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return JBossWSTestHelper.getResourceURL(resource);
+ }
+
+ public static File createResourceFile(String filename)
+ {
+ File resDir = new File(JBossWSTestHelper.getTestResourcesDir());
+ return new File(resDir.getAbsolutePath() + File.separator + filename);
+ }
+
+ public static File createResourceFile(File parent, String filename)
+ {
+ return new File(parent, filename);
+ }
+
+ /** Get the client's env context for a given name.
+ */
+ @SuppressWarnings("unchecked")
+ protected static InitialContext getInitialContext(String clientName) throws NamingException
+ {
+ InitialContext iniCtx = new InitialContext();
+ Hashtable env = iniCtx.getEnvironment();
+ env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
+ env.put("j2ee.clientName", clientName);
+ return new InitialContext(env);
+ }
+
+ /** Get the client's env context
+ */
+ protected static InitialContext getInitialContext() throws NamingException
+ {
+ return getInitialContext("jbossws-client");
+ }
+
+ public static void assertEquals(Element expElement, Element wasElement, boolean ignoreWhitespace)
+ {
+ normalizeWhitespace(expElement, ignoreWhitespace);
+ normalizeWhitespace(wasElement, ignoreWhitespace);
+ String expStr = DOMWriter.printNode(expElement, false);
+ String wasStr = DOMWriter.printNode(wasElement, false);
+ if (expStr.equals(wasStr) == false)
+ {
+ System.out.println("\nExp: " + expStr + "\nWas: " + wasStr);
+ }
+ assertEquals(expStr, wasStr);
+ }
+
+ public static void assertEquals(Element expElement, Element wasElement)
+ {
+ assertEquals(expElement, wasElement, false);
+ }
+
+ public static void assertEquals(Object exp, Object was)
+ {
+ if (exp instanceof Object[] && was instanceof Object[])
+ assertEqualsArray((Object[])exp, (Object[])was);
+ else if (exp instanceof byte[] && was instanceof byte[])
+ assertEqualsArray((byte[])exp, (byte[])was);
+ else if (exp instanceof boolean[] && was instanceof boolean[])
+ assertEqualsArray((boolean[])exp, (boolean[])was);
+ else if (exp instanceof short[] && was instanceof short[])
+ assertEqualsArray((short[])exp, (short[])was);
+ else if (exp instanceof int[] && was instanceof int[])
+ assertEqualsArray((int[])exp, (int[])was);
+ else if (exp instanceof long[] && was instanceof long[])
+ assertEqualsArray((long[])exp, (long[])was);
+ else if (exp instanceof float[] && was instanceof float[])
+ assertEqualsArray((float[])exp, (float[])was);
+ else if (exp instanceof double[] && was instanceof double[])
+ assertEqualsArray((double[])exp, (double[])was);
+ else
+ TestCase.assertEquals(exp, was);
+ }
+
+ private static void assertEqualsArray(Object[] exp, Object[] was)
+ {
+ if (exp == null && was == null)
+ return;
+
+ if (exp != null && was != null)
+ {
+ if (exp.length != was.length)
+ {
+ fail("Expected <" + exp.length + "> array items, but was <" + was.length + ">");
+ }
+ else
+ {
+ for (int i = 0; i < exp.length; i++)
+ {
+
+ Object compExp = exp[i];
+ Object compWas = was[i];
+ assertEquals(compExp, compWas);
+ }
+ }
+ }
+ else if (exp == null)
+ {
+ fail("Expected a null array, but was: " + Arrays.asList(was));
+ }
+ else if (was == null)
+ {
+ fail("Expected " + Arrays.asList(exp) + ", but was: null");
+ }
+ }
+
+ private static void assertEqualsArray(byte[] exp, byte[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(boolean[] exp, boolean[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(short[] exp, short[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(int[] exp, int[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(long[] exp, long[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(float[] exp, float[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ private static void assertEqualsArray(double[] exp, double[] was)
+ {
+ assertTrue("Arrays don't match", Arrays.equals(exp, was));
+ }
+
+ /** Removes whitespace text nodes if they have an element sibling.
+ */
+ private static void normalizeWhitespace(Element element, boolean ignoreWhitespace)
+ {
+ boolean hasChildElement = false;
+ ArrayList<Node> toDetach = new ArrayList<Node>();
+
+ NodeList childNodes = element.getChildNodes();
+ for (int i = 0; i < childNodes.getLength(); i++)
+ {
+ Node node = childNodes.item(i);
+ if (node.getNodeType() == Node.TEXT_NODE)
+ {
+ String nodeValue = node.getNodeValue();
+ if (nodeValue.trim().length() == 0)
+ toDetach.add(node);
+ }
+ if (node.getNodeType() == Node.ELEMENT_NODE)
+ {
+ normalizeWhitespace((Element)node, ignoreWhitespace);
+ hasChildElement = true;
+ }
+ }
+
+ // remove whitespace nodes
+ if (hasChildElement || ignoreWhitespace)
+ {
+ Iterator<Node> it = toDetach.iterator();
+ while (it.hasNext())
+ {
+ Node whiteSpaceNode = it.next();
+ element.removeChild(whiteSpaceNode);
+ }
+ }
+ }
+
+}
Added: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java (rev 0)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestHelper.java 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,365 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.Inet6Address;
+import java.net.InetAddress;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.Hashtable;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployer.Deployer;
+
+/**
+ * A JBossWS test helper that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author ropalka(a)redhat.com
+ */
+public class JBossWSTestHelper
+{
+ private static final Logger LOGGER = Logger.getLogger(JBossWSTestHelper.class);
+
+ private static final String SYSPROP_JBOSSWS_INTEGRATION_TARGET = "jbossws.integration.target";
+ private static final String SYSPROP_JBOSS_BIND_ADDRESS = "jboss.bind.address";
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+ private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final boolean DEPLOY_PROCESS_ENABLED = !Boolean.getBoolean("test.disable.deployment");
+ private static final Deployer DEPLOYER;
+
+ private static MBeanServerConnection server;
+ private static String integrationTarget;
+ private static String implVendor;
+ private static String implTitle;
+ private static String implVersion;
+ private static String testArchiveDir;
+ private static String testResourcesDir;
+
+ static
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DEPLOYER = spiProvider.getSPI(Deployer.class);
+ }
+
+ /** Deploy the given archive
+ */
+ public static void deploy(String archive) throws Exception
+ {
+ if ( DEPLOY_PROCESS_ENABLED )
+ {
+ URL archiveURL = getArchiveFile(archive).toURI().toURL();
+ DEPLOYER.deploy(archiveURL);
+ }
+ }
+
+ /** Undeploy the given archive
+ */
+ public static void undeploy(String archive) throws Exception
+ {
+ if ( DEPLOY_PROCESS_ENABLED )
+ {
+ URL archiveURL = getArchiveFile(archive).toURI().toURL();
+ DEPLOYER.undeploy(archiveURL);
+ }
+ }
+
+ /** True, if -Djbossws.integration.target=jboss5x */
+ public static boolean isTargetJBoss5()
+ {
+ return isTargetJBoss51() || isTargetJBoss50();
+ }
+
+ /** True, if -Djbossws.integration.target=jboss50x */
+ public static boolean isTargetJBoss50()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss50");
+ }
+
+ /** True, if -Djbossws.integration.target=jboss51x */
+ public static boolean isTargetJBoss51()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss51");
+ }
+
+ /** True, if -Djbossws.integration.target=jboss6x */
+ public static boolean isTargetJBoss6()
+ {
+ return isTargetJBoss61() || isTargetJBoss60();
+ }
+
+ /** True, if -Djbossws.integration.target=jboss60x */
+ public static boolean isTargetJBoss60()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss60");
+ }
+
+ /** True, if -Djbossws.integration.target=jboss61x */
+ public static boolean isTargetJBoss61()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss61");
+ }
+
+ public static boolean isIntegrationNative()
+ {
+ String vendor = getImplementationVendor();
+ return vendor.toLowerCase().indexOf("jboss") != -1;
+ }
+
+ public static boolean isIntegrationMetro()
+ {
+ String vendor = getImplementationVendor();
+ return vendor.toLowerCase().indexOf("sun") != -1;
+ }
+
+ public static boolean isIntegrationCXF()
+ {
+ String vendor = getImplementationVendor();
+ return vendor.toLowerCase().indexOf("apache") != -1;
+ }
+
+ private static String getImplementationVendor()
+ {
+ if (implVendor == null)
+ {
+ Object obj = getImplementationObject();
+ implVendor = obj.getClass().getPackage().getImplementationVendor();
+ if (implVendor == null)
+ implVendor = getImplementationPackage();
+
+ implTitle = obj.getClass().getPackage().getImplementationTitle();
+ implVersion = obj.getClass().getPackage().getImplementationVersion();
+
+ System.out.println(implVendor + ", " + implTitle + ", " + implVersion);
+ }
+ return implVendor;
+ }
+
+ private static Object getImplementationObject()
+ {
+ Service service = Service.create(new QName("dummyService"));
+ Object obj = service.getHandlerResolver();
+ if (obj == null)
+ {
+ service.addPort(new QName("dummyPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://dummy-address");
+ obj = service.createDispatch(new QName("dummyPort"), Source.class, Mode.PAYLOAD);
+ }
+ return obj;
+ }
+
+ private static String getImplementationPackage()
+ {
+ return getImplementationObject().getClass().getPackage().getName();
+ }
+
+ /**
+ * Get the JBoss server host from system property "jboss.bind.address"
+ * This defaults to "localhost"
+ */
+ public static String getServerHost()
+ {
+ final String host = System.getProperty(SYSPROP_JBOSS_BIND_ADDRESS, "localhost");
+ return toIPv6URLFormat(host);
+ }
+
+ private static String toIPv6URLFormat(final String host)
+ {
+ try
+ {
+ final boolean isIPv6Address = InetAddress.getByName(host) instanceof Inet6Address;
+ final boolean isIPv6Formatted = isIPv6Address && host.startsWith("[");
+ return isIPv6Address && !isIPv6Formatted ? "[" + host + "]" : host;
+ }
+ catch (final UnknownHostException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public static MBeanServerConnection getServer()
+ {
+ if (server == null)
+ {
+ if (getIntegrationTarget().startsWith("jboss7"))
+ {
+ server = getAS7ServerConnection();
+ }
+ else
+ {
+ server = getAS6ServerConnection();
+ }
+ }
+ return server;
+ }
+
+ private static MBeanServerConnection getAS7ServerConnection()
+ {
+ String host = getServerHost();
+ String urlString = System.getProperty("jmx.service.url", "service:jmx:rmi:///jndi/rmi://" + host + ":" + 1090 + "/jmxrmi");
+ try {
+ JMXServiceURL serviceURL = new JMXServiceURL(urlString);
+ return JMXConnectorFactory.connect(serviceURL, null).getMBeanServerConnection();
+ } catch (IOException ex) {
+ throw new IllegalStateException("Cannot obtain MBeanServerConnection to: " + urlString, ex);
+ }
+ }
+
+ private static MBeanServerConnection getAS6ServerConnection()
+ {
+ Hashtable jndiEnv = null;
+ try
+ {
+ InitialContext iniCtx = new InitialContext();
+ jndiEnv = iniCtx.getEnvironment();
+ return (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+ }
+ }
+
+ public static String getIntegrationTarget()
+ {
+ if (integrationTarget == null)
+ {
+ integrationTarget = System.getProperty(SYSPROP_JBOSSWS_INTEGRATION_TARGET);
+
+ if (integrationTarget == null)
+ throw new IllegalStateException("Cannot obtain system property: " + SYSPROP_JBOSSWS_INTEGRATION_TARGET);
+
+ LOGGER.fatal("TODO: remove this ugly hack");
+ if (!integrationTarget.startsWith("jboss7"))
+ {
+ // Read the JBoss SpecificationVersion
+ String jbossVersion = null;
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=Server");
+ jbossVersion = (String)getServer().getAttribute(oname, "VersionNumber");
+ if (jbossVersion == null)
+ throw new IllegalStateException("Cannot obtain jboss version");
+
+ if (jbossVersion.startsWith("5.1"))
+ jbossVersion = "jboss51";
+ else if (jbossVersion.startsWith("5.0"))
+ jbossVersion = "jboss50";
+ else if (jbossVersion.startsWith("6.1"))
+ jbossVersion = "jboss61";
+ else if (jbossVersion.startsWith("6.0"))
+ jbossVersion = "jboss60";
+ else throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException(ex);
+ }
+
+ if (integrationTarget.startsWith(jbossVersion) == false)
+ throw new IllegalStateException("Integration target mismatch: " + integrationTarget + ".startsWith(" + jbossVersion + ")");
+ }
+ }
+
+ return integrationTarget;
+ }
+
+ /** Try to discover the URL for the deployment archive */
+ public static URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return getArchiveFile(archive).toURI().toURL();
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public static File getArchiveFile(String archive)
+ {
+ File file = new File(archive);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestArchiveDir() + "/" + archive);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
+ throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
+ }
+
+ /** Try to discover the URL for the test resource */
+ public static URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return getResourceFile(resource).toURI().toURL();
+ }
+
+ /** Try to discover the File for the test resource */
+ public static File getResourceFile(String resource)
+ {
+ File file = new File(resource);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestResourcesDir() + "/" + resource);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestResourcesDir() == null ? " System property '" + SYSPROP_TEST_RESOURCES_DIRECTORY + "' not set." : "");
+ throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'." + notSet);
+ }
+
+ public static String getTestArchiveDir()
+ {
+ if (testArchiveDir == null)
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY);
+
+ return testArchiveDir;
+ }
+
+ public static String getTestResourcesDir()
+ {
+ if (testResourcesDir == null)
+ testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY);
+
+ return testResourcesDir;
+ }
+}
Added: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java (rev 0)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/JBossWSTestSetup.java 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.test;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.NamingException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A test setup that deploys/undeploys archives
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class JBossWSTestSetup extends TestSetup
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(JBossWSTestSetup.class);
+
+ private JBossWSTestHelper delegate = new JBossWSTestHelper();
+ private String[] archives = new String[0];
+ private ClassLoader originalClassLoader;
+
+ public JBossWSTestSetup(Class<?> testClass, String archiveList)
+ {
+ super(new TestSuite(testClass));
+ getArchiveArray(archiveList);
+ }
+
+ public JBossWSTestSetup(Test test, String archiveList)
+ {
+ super(test);
+ getArchiveArray(archiveList);
+ }
+
+ public JBossWSTestSetup(Test test)
+ {
+ super(test);
+ }
+
+ public File getArchiveFile(String archive)
+ {
+ return delegate.getArchiveFile(archive);
+ }
+
+ public URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getArchiveFile(archive).toURI().toURL();
+ }
+
+ public File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ public URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return delegate.getResourceFile(resource).toURI().toURL();
+ }
+
+ private void getArchiveArray(String archiveList)
+ {
+ if (archiveList != null)
+ {
+ StringTokenizer st = new StringTokenizer(archiveList, ", ");
+ archives = new String[st.countTokens()];
+
+ for (int i = 0; i < archives.length; i++)
+ archives[i] = st.nextToken();
+ }
+ }
+
+ protected void setUp() throws Exception
+ {
+ // verify integration target
+ String integrationTarget = delegate.getIntegrationTarget();
+ log.debug("Integration target: " + integrationTarget);
+
+ List<URL> clientJars = new ArrayList<URL>();
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[i];
+ try
+ {
+ delegate.deploy(archive);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ delegate.undeploy(archive);
+ }
+
+ if (archive.endsWith("-client.jar"))
+ {
+ URL archiveURL = getArchiveURL(archive);
+ clientJars.add(archiveURL);
+ }
+ }
+
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ originalClassLoader = parent;
+ // add client jars to the class loader
+ if (!clientJars.isEmpty())
+ {
+ URL[] urls = new URL[clientJars.size()];
+ for (int i = 0; i < clientJars.size(); i++)
+ {
+ urls[i] = clientJars.get(i);
+ }
+ URLClassLoader cl = new URLClassLoader(urls, parent);
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[archives.length - i - 1];
+ delegate.undeploy(archive);
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+ }
+ }
+
+ public MBeanServerConnection getServer() throws NamingException
+ {
+ return JBossWSTestHelper.getServer();
+ }
+}
Added: shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/XOPTestSupport.java
===================================================================
--- shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/XOPTestSupport.java (rev 0)
+++ shared-testsuite/trunk/src/main/java/org/jboss/wsf/test/XOPTestSupport.java 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.test;
+
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.ws.common.IOUtils;
+
+/**
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @since 22-Sep-2006
+ */
+public class XOPTestSupport
+{
+
+ public static byte[] getBytesFromFile(File file) throws IOException
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ IOUtils.copyStream(baos, new FileInputStream(file));
+ return baos.toByteArray();
+ }
+
+ public static Image createTestImage(File imgFile)
+ {
+ Image image = null;
+ try
+ {
+ URL url = imgFile.toURI().toURL();
+
+ image = null;
+ try
+ {
+ image = Toolkit.getDefaultToolkit().createImage(url);
+ }
+ catch (Throwable th)
+ {
+ //log.warn("Cannot create Image: " + th);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ return image;
+ }
+
+ public static StreamSource createTestSource()
+ {
+ return new StreamSource(new ByteArrayInputStream("<some><nestedXml/></some>".getBytes()));
+ }
+
+ public static DataHandler createDataHandler(File imgFile)
+ {
+ try
+ {
+ URL url = imgFile.toURI().toURL();
+ return new DataHandler(url);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added: shared-testsuite/trunk/src/main/java/pom.xml
===================================================================
--- shared-testsuite/trunk/src/main/java/pom.xml (rev 0)
+++ shared-testsuite/trunk/src/main/java/pom.xml 2011-05-09 11:24:41 UTC (rev 14324)
@@ -0,0 +1,86 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBoss Web Services - Stack Agnostic Test Suite</name>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ <description>JBossWS Stack Agnostic Testsuite</description>
+
+ <version>4.0.0-SNAPSHOT</version>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-parent</artifactId>
+ <version>1.0.10-SNAPSHOT</version>
+ </parent>
+
+ <!-- Source Control Management -->
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossws/shared-testsuite/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossws/shared-testsuite/trunk</developerConnection>
+ <url>http://fisheye.jboss.com/viewrep/JBossWS/shared-testsuite/trunk</url>
+ </scm>
+
+ <properties>
+ <jbossws.common.version>2.0.0-SNAPSHOT</jbossws.common.version>
+ <jboss.logging.version>2.0.5.GA</jboss.logging.version>
+ <junit.version>3.8.2</junit.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-common</artifactId>
+ <version>${jbossws.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>${jboss.logging.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/test/scripts/assembly-testsuite.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0-beta-8</version>
+ <configuration>
+ <scmCommentPrefix>[${jira.issue}] :</scmCommentPrefix>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Modified: shared-testsuite/trunk/testsuite/src/test/scripts/assembly-testsuite.xml
===================================================================
--- shared-testsuite/trunk/testsuite/src/test/scripts/assembly-testsuite.xml 2011-05-09 11:22:03 UTC (rev 14323)
+++ shared-testsuite/trunk/testsuite/src/test/scripts/assembly-testsuite.xml 2011-05-09 11:24:41 UTC (rev 14324)
@@ -6,7 +6,7 @@
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
- <directory>src/test</directory>
+ <directory>testsuite/src/test</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
13 years, 10 months
JBossWS SVN: r14323 - in stack/cxf/trunk: modules/testsuite and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 07:22:03 -0400 (Mon, 09 May 2011)
New Revision: 14323
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-3289] refactoring test support classes to shared-testsuite SVN module
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2011-05-09 11:21:10 UTC (rev 14322)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2011-05-09 11:22:03 UTC (rev 14323)
@@ -46,6 +46,10 @@
<artifactId>jbossws-common-tools</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ </dependency>
+ <dependency>
<groupId>gnu-getopt</groupId>
<artifactId>getopt</artifactId>
<version>1.0.13</version>
@@ -633,7 +637,7 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <compilerArgument>-Djava.endorsed.dirs=${jboss600.home}/lib/endorsed</compilerArgument>
+ <compilerArgument>-Djava.endorsed.dirs=${jboss600.home}/lib/endorsed -Dorg.jboss.wsf.spi.deployer.Deployer=org.jboss.wsf.test.DeployerJBoss6</compilerArgument>
</configuration>
</plugin>
<plugin>
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2011-05-09 11:21:10 UTC (rev 14322)
+++ stack/cxf/trunk/pom.xml 2011-05-09 11:22:03 UTC (rev 14323)
@@ -117,6 +117,11 @@
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-shared-testsuite</artifactId>
<version>${jbossws.shared.testsuite.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ <version>${jbossws.shared.testsuite.version}</version>
<type>zip</type>
</dependency>
<dependency>
13 years, 10 months
JBossWS SVN: r14322 - in stack/native/trunk: modules/testsuite and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 07:21:10 -0400 (Mon, 09 May 2011)
New Revision: 14322
Modified:
stack/native/trunk/modules/testsuite/pom.xml
stack/native/trunk/pom.xml
Log:
[JBWS-3289] refactoring test support classes to shared-testsuite SVN module
Modified: stack/native/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/native/trunk/modules/testsuite/pom.xml 2011-05-09 11:18:18 UTC (rev 14321)
+++ stack/native/trunk/modules/testsuite/pom.xml 2011-05-09 11:21:10 UTC (rev 14322)
@@ -52,6 +52,10 @@
<artifactId>jbossws-common-tools</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ </dependency>
+ <dependency>
<groupId>gnu-getopt</groupId>
<artifactId>getopt</artifactId>
<version>1.0.13</version>
@@ -521,7 +525,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${endorsed.dirs}</argLine>
+ <argLine>${surefire.jvm.args} ${surefire.jvm.management.args} -Djava.endorsed.dirs=${endorsed.dirs} -Dorg.jboss.wsf.spi.deployer.Deployer=org.jboss.wsf.test.DeployerJBoss6</argLine>
<excludes>
<!--# UsernameTokenHTTPSTestCase requires keystore & trustore in jboss-web tomcat configuration-->
<exclude>org/jboss/test/ws/interop/nov2007/wsse/UsernameTokenHTTPSTestCase.*</exclude>
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2011-05-09 11:18:18 UTC (rev 14321)
+++ stack/native/trunk/pom.xml 2011-05-09 11:21:10 UTC (rev 14322)
@@ -109,6 +109,11 @@
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-shared-testsuite</artifactId>
<version>${jbossws.shared.testsuite.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-shared-testsuite</artifactId>
+ <version>${jbossws.shared.testsuite.version}</version>
<type>zip</type>
</dependency>
<dependency>
13 years, 10 months
JBossWS SVN: r14321 - in common/trunk/src/main/java/org/jboss: ws/common/spi and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 07:18:18 -0400 (Mon, 09 May 2011)
New Revision: 14321
Removed:
common/trunk/src/main/java/org/jboss/wsf/
Modified:
common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
Log:
[JBWS-3289] refactoring test support classes to shared-testsuite SVN module
Modified: common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2011-05-09 09:44:31 UTC (rev 14320)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2011-05-09 11:18:18 UTC (rev 14321)
@@ -32,7 +32,6 @@
import org.jboss.ws.common.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
-import org.jboss.wsf.spi.deployer.Deployer;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
@@ -41,7 +40,6 @@
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
import org.jboss.wsf.spi.management.JMSEndpointResolver;
import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
-import org.jboss.wsf.test.DeployerJBoss6;
/**
* @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
@@ -86,10 +84,6 @@
{
returnType = loadService(spiType, DefaultEndpointRegistryFactory.class, loader);
}
- else if (Deployer.class.equals(spiType))
- {
- returnType = loadService(spiType, DeployerJBoss6.class, loader);
- }
else if (JMSEndpointResolver.class.equals(spiType))
{
returnType = loadService(spiType, DefaultJMSEndpointResolver.class, loader);
13 years, 10 months
JBossWS SVN: r14319 - shared-testsuite/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 05:42:35 -0400 (Mon, 09 May 2011)
New Revision: 14319
Added:
shared-testsuite/trunk/testsuite/
Log:
refactoring
13 years, 10 months
JBossWS SVN: r14318 - common/trunk/src/main/java/org/jboss/ws.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2011-05-09 05:25:44 -0400 (Mon, 09 May 2011)
New Revision: 14318
Removed:
common/trunk/src/main/java/org/jboss/ws/Constants.java
Log:
[JBWS-3289] removing org.jboss.ws.Contants
Deleted: common/trunk/src/main/java/org/jboss/ws/Constants.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/Constants.java 2011-05-09 09:18:32 UTC (rev 14317)
+++ common/trunk/src/main/java/org/jboss/ws/Constants.java 2011-05-09 09:25:44 UTC (rev 14318)
@@ -1,336 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPConstants;
-import javax.xml.ws.http.HTTPBinding;
-import javax.xml.ws.soap.SOAPBinding;
-
-/**
- * A collection of constants relevant to JBossWS
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author Anil.Saldhana(a)jboss.org
- * @author richard.opalka(a)jboss.org
- * @since 10-Oct-2004
- */
-public interface Constants
-{
- /** Header for XML Documents */
- static final String XML_HEADER = "<?xml version='1.0' encoding='UTF-8'?>";
- /** Default charset for XML Documents */
- static final String DEFAULT_XML_CHARSET = "UTF-8";
- /** JBossWS namespace URI */
- static final String NS_JBOSSWS_URI = "http://www.jboss.org/jbossws";
- /** XML Namespace */
- static final String NS_XML = "http://www.w3.org/XML/1998/namespace";
- /** XML namespace declaration namespace */
- static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
- /** XMLSchema namespace http://www.w3.org/2001/XMLSchema */
- static final String NS_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema";
- /** XMLSchema instance namespace http://www.w3.org/2001/XMLSchema-instance */
- static final String NS_SCHEMA_XSI = "http://www.w3.org/2001/XMLSchema-instance";
- /** SOAP-1.1 namespace http://schemas.xmlsoap.org/wsdl/soap/ */
- static final String NS_SOAP11 = "http://schemas.xmlsoap.org/wsdl/soap/";
- /** SOAP-1.1 envelope namespace http://schemas.xmlsoap.org/soap/envelope/ */
- static final String NS_SOAP11_ENV = SOAPConstants.URI_NS_SOAP_ENVELOPE;
- /** SOAP-1.2 namespace http://schemas.xmlsoap.org/wsdl/soap12/ */
- static final String NS_SOAP12 = "http://schemas.xmlsoap.org/wsdl/soap12/";
- /** HTTP binding namespace http://schemas.xmlsoap.org/wsdl/http/ */
- static final String NS_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
- /** SOAP-1.2 envelope namespace http://www.w3.org/2003/05/soap-envelope */
- static final String NS_SOAP12_ENV = SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE;
- /** The namespace for the SwA mime type */
- static final String NS_SWA_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
- /** Default namespace for WSDL-1.1 http://schemas.xmlsoap.org/wsdl/ */
- static final String NS_WSDL11 = "http://schemas.xmlsoap.org/wsdl/";
- /** The namespace for the MTOM content type attribute. */
- static final String NS_XML_MIME = "http://www.w3.org/2005/05/xmlmime";
- /** The namespace for XOP. */
- static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
-
- /** A constant representing the identity of the SOAP 1.1 over HTTP binding. */
- public static final String SOAP11HTTP_BINDING = SOAPBinding.SOAP11HTTP_BINDING;
- /** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
- public static final String SOAP12HTTP_BINDING = SOAPBinding.SOAP12HTTP_BINDING;
- /** A constant representing the identity of the SOAP 1.1 over HTTP binding with MTOM enabled by default. */
- public static final String SOAP11HTTP_MTOM_BINDING = SOAPBinding.SOAP11HTTP_MTOM_BINDING;
- /** A constant representing the identity of the SOAP 1.2 over HTTP binding with MTOM enabled by default. */
- public static final String SOAP12HTTP_MTOM_BINDING = SOAPBinding.SOAP12HTTP_MTOM_BINDING;
- /** A constant representing the identity of the XML/HTTP binding. */
- public static final String HTTP_BINDING = HTTPBinding.HTTP_BINDING;
-
- /** SOAP-1.1 encoding URI */
- static final String URI_SOAP11_ENC = SOAPConstants.URI_NS_SOAP_ENCODING;
- /** SOAP-1.2 encoding URI */
- static final String URI_SOAP12_ENC = SOAPConstants.URI_NS_SOAP_1_2_ENCODING;
- /** SOAP HTTP transport URI in wsdl soap binding */
- static final String URI_SOAP_HTTP = "http://schemas.xmlsoap.org/soap/http";
- /** Literal encoding URI */
- static final String URI_LITERAL_ENC = "";
- /** WSDL 2.0 Encoding Rules */
- static final String URI_STYLE_RPC = "http://www.w3.org/2004/03/wsdl/style/rpc";
- static final String URI_STYLE_DOCUMENT = "http://www.w3.org/2004/03/wsdl/style/iri";
-
- /** WS-Eventing namespace uri **/
- static final String URI_WS_EVENTING = "http://schemas.xmlsoap.org/ws/2004/08/eventing";
-
- /** WS-Policy namespace uri **/
- static final String URI_WS_POLICY = "http://schemas.xmlsoap.org/ws/2004/09/policy";
-
- /** WS-Addressing namespace uri **/
- static final String URI_WS_ADDRESSING = "http://www.w3.org/2005/08/addressing";
-
- /** JAX-WS binding customizations namespace uri **/
- static final String URI_JAXWS_WSDL_CUSTOMIZATIONS = "http://java.sun.com/xml/ns/jaxws";
-
- /**Style of WSDL */
- static final String RPC_LITERAL = "RPC/Literal";
- static final String DOCUMENT_LITERAL = "Document/Literal";
-
- // Some prefixes
- static final String PREFIX_ENV = SOAPConstants.SOAP_ENV_PREFIX;
- static final String PREFIX_XMIME = "xmime";
- static final String PREFIX_SOAP11 = "soap";
- static final String PREFIX_SOAP11_ENC = "soap11-enc";
- static final String PREFIX_TNS = "tns";
- static final String PREFIX_WSDL = "wsdl";
- static final String PREFIX_XOP = "xop";
- static final String PREFIX_XSD = "xsd";
- static final String PREFIX_XSI = "xsi";
- static final String PREFIX_XML = "xml";
-
- /** XOP Include */
- static final QName NAME_XOP_INCLUDE = new QName(NS_XOP, "Include", PREFIX_XOP);
-
- /** SOAP-1.1 roles */
- static final String URI_SOAP11_NEXT_ACTOR = "http://schemas.xmlsoap.org/soap/actor/next";
-
- /** SOAP-1.1 attributes */
- static final String SOAP11_ATTR_ACTOR = "actor";
- static final String SOAP11_ATTR_MUST_UNDERSTAND = "mustUnderstand";
-
- /** SOAP-1.1 fault codes */
- static final QName SOAP11_FAULT_CODE_CLIENT = new QName(NS_SOAP11_ENV, "Client", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_SERVER = new QName(NS_SOAP11_ENV, "Server", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_VERSION_MISMATCH = new QName(NS_SOAP11_ENV, "VersionMismatch", PREFIX_ENV);
- static final QName SOAP11_FAULT_CODE_MUST_UNDERSTAND = new QName(NS_SOAP11_ENV, "MustUnderstand", PREFIX_ENV);
-
- /** SOAP-1.1 elements */
- static final QName SOAP11_FAULTCODE = new QName("faultcode");
- static final QName SOAP11_FAULTSTRING = new QName("faultstring");
- static final QName SOAP11_FAULTACTOR = new QName("faultactor");
- static final QName SOAP11_DETAIL = new QName("detail");
-
- /** SOAP-1.2 attributes */
- static final String SOAP12_ATTR_ROLE = "role";
- static final String SOAP12_ATTR_RELAY = "relay";
-
- /**SOAP-1.2 elements */
- static final QName SOAP12_CODE = new QName(NS_SOAP12_ENV, "Code", PREFIX_ENV);
- static final QName SOAP12_VALUE = new QName(NS_SOAP12_ENV, "Value", PREFIX_ENV);
- static final QName SOAP12_SUBCODE = new QName(NS_SOAP12_ENV, "Subcode", PREFIX_ENV);
- static final QName SOAP12_REASON = new QName(NS_SOAP12_ENV, "Reason", PREFIX_ENV);
- static final QName SOAP12_TEXT = new QName(NS_SOAP12_ENV, "Text", PREFIX_ENV);
- static final QName SOAP12_ROLE = new QName(NS_SOAP12_ENV, "Role", PREFIX_ENV);
- static final QName SOAP12_NODE = new QName(NS_SOAP12_ENV, "Node", PREFIX_ENV);
- static final QName SOAP12_DETAIL = new QName(NS_SOAP12_ENV, "Detail", PREFIX_ENV);
-
- /** The default RPC return parameter name */
- static final String DEFAULT_RPC_RETURN_NAME = "result"; // FIXME: According to JSR-181 this should be 'return'
-
- /** Standard Literal XML types */
- static final QName TYPE_LITERAL_ANYSIMPLETYPE = new QName(NS_SCHEMA_XSD, "anySimpleType", PREFIX_XSD);
- static final QName TYPE_LITERAL_ANYTYPE = new QName(NS_SCHEMA_XSD, "anyType", PREFIX_XSD);
- static final QName TYPE_LITERAL_ANYURI = new QName(NS_SCHEMA_XSD, "anyURI", PREFIX_XSD);
- static final QName TYPE_LITERAL_BASE64BINARY = new QName(NS_SCHEMA_XSD, "base64Binary", PREFIX_XSD);
- static final QName TYPE_LITERAL_BOOLEAN = new QName(NS_SCHEMA_XSD, "boolean", PREFIX_XSD);
- static final QName TYPE_LITERAL_BYTE = new QName(NS_SCHEMA_XSD, "byte", PREFIX_XSD);
- static final QName TYPE_LITERAL_DATE = new QName(NS_SCHEMA_XSD, "date", PREFIX_XSD);
- static final QName TYPE_LITERAL_DATETIME = new QName(NS_SCHEMA_XSD, "dateTime", PREFIX_XSD);
- static final QName TYPE_LITERAL_DECIMAL = new QName(NS_SCHEMA_XSD, "decimal", PREFIX_XSD);
- static final QName TYPE_LITERAL_DOUBLE = new QName(NS_SCHEMA_XSD, "double", PREFIX_XSD);
- static final QName TYPE_LITERAL_DURATION = new QName(NS_SCHEMA_XSD, "duration", PREFIX_XSD);
- static final QName TYPE_LITERAL_FLOAT = new QName(NS_SCHEMA_XSD, "float", PREFIX_XSD);
- static final QName TYPE_LITERAL_GDAY = new QName(NS_SCHEMA_XSD, "gDay", PREFIX_XSD);
- static final QName TYPE_LITERAL_GMONTH = new QName(NS_SCHEMA_XSD, "gMonth", PREFIX_XSD);
- static final QName TYPE_LITERAL_GMONTHDAY = new QName(NS_SCHEMA_XSD, "gMonthDay", PREFIX_XSD);
- static final QName TYPE_LITERAL_GYEAR = new QName(NS_SCHEMA_XSD, "gYear", PREFIX_XSD);
- static final QName TYPE_LITERAL_GYEARMONTH = new QName(NS_SCHEMA_XSD, "gYearMonth", PREFIX_XSD);
- static final QName TYPE_LITERAL_HEXBINARY = new QName(NS_SCHEMA_XSD, "hexBinary", PREFIX_XSD);
- static final QName TYPE_LITERAL_ID = new QName(NS_SCHEMA_XSD, "ID", PREFIX_XSD);
- static final QName TYPE_LITERAL_INT = new QName(NS_SCHEMA_XSD, "int", PREFIX_XSD);
- static final QName TYPE_LITERAL_INTEGER = new QName(NS_SCHEMA_XSD, "integer", PREFIX_XSD);
- static final QName TYPE_LITERAL_LANGUAGE = new QName(NS_SCHEMA_XSD, "language", PREFIX_XSD);
- static final QName TYPE_LITERAL_LONG = new QName(NS_SCHEMA_XSD, "long", PREFIX_XSD);
- static final QName TYPE_LITERAL_NAME = new QName(NS_SCHEMA_XSD, "Name", PREFIX_XSD);
- static final QName TYPE_LITERAL_NCNAME = new QName(NS_SCHEMA_XSD, "NCName", PREFIX_XSD);
- static final QName TYPE_LITERAL_NEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "negativeInteger", PREFIX_XSD);
- static final QName TYPE_LITERAL_NMTOKEN = new QName(NS_SCHEMA_XSD, "NMTOKEN", PREFIX_XSD);
- static final QName TYPE_LITERAL_NMTOKENS = new QName(NS_SCHEMA_XSD, "NMTOKENS", PREFIX_XSD);
- static final QName TYPE_LITERAL_NONNEGATIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonNegativeInteger", PREFIX_XSD);
- static final QName TYPE_LITERAL_NONPOSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "nonPositiveInteger", PREFIX_XSD);
- static final QName TYPE_LITERAL_NORMALIZEDSTRING = new QName(NS_SCHEMA_XSD, "normalizedString", PREFIX_XSD);
- static final QName TYPE_LITERAL_POSITIVEINTEGER = new QName(NS_SCHEMA_XSD, "positiveInteger", PREFIX_XSD);
- static final QName TYPE_LITERAL_QNAME = new QName(NS_SCHEMA_XSD, "QName", PREFIX_XSD);
- static final QName TYPE_LITERAL_SHORT = new QName(NS_SCHEMA_XSD, "short", PREFIX_XSD);
- static final QName TYPE_LITERAL_STRING = new QName(NS_SCHEMA_XSD, "string", PREFIX_XSD);
- static final QName TYPE_LITERAL_TIME = new QName(NS_SCHEMA_XSD, "time", PREFIX_XSD);
- static final QName TYPE_LITERAL_TOKEN = new QName(NS_SCHEMA_XSD, "token", PREFIX_XSD);
- static final QName TYPE_LITERAL_UNSIGNEDBYTE = new QName(NS_SCHEMA_XSD, "unsignedByte", PREFIX_XSD);
- static final QName TYPE_LITERAL_UNSIGNEDINT = new QName(NS_SCHEMA_XSD, "unsignedInt", PREFIX_XSD);
- static final QName TYPE_LITERAL_UNSIGNEDLONG = new QName(NS_SCHEMA_XSD, "unsignedLong", PREFIX_XSD);
- static final QName TYPE_LITERAL_UNSIGNEDSHORT = new QName(NS_SCHEMA_XSD, "unsignedShort", PREFIX_XSD);
-
- /** Standard SOAP-1.1 encoded XML types */
- static final QName TYPE_SOAP11_ANYSIMPLETYPE = new QName(URI_SOAP11_ENC, "anySimpleType", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_ANYTYPE = new QName(URI_SOAP11_ENC, "anyType", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_ANYURI = new QName(URI_SOAP11_ENC, "anyURI", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_BASE64 = new QName(URI_SOAP11_ENC, "base64", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_BASE64BINARY = new QName(URI_SOAP11_ENC, "base64Binary", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_BOOLEAN = new QName(URI_SOAP11_ENC, "boolean", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_BYTE = new QName(URI_SOAP11_ENC, "byte", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_DATE = new QName(URI_SOAP11_ENC, "date", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_DATETIME = new QName(URI_SOAP11_ENC, "dateTime", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_DECIMAL = new QName(URI_SOAP11_ENC, "decimal", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_DOUBLE = new QName(URI_SOAP11_ENC, "double", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_DURATION = new QName(URI_SOAP11_ENC, "duration", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_FLOAT = new QName(URI_SOAP11_ENC, "float", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_GDAY = new QName(URI_SOAP11_ENC, "gDay", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_GMONTH = new QName(URI_SOAP11_ENC, "gMonth", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_GMONTHDAY = new QName(URI_SOAP11_ENC, "gMonthDay", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_GYEAR = new QName(URI_SOAP11_ENC, "gYear", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_GYEARMONTH = new QName(URI_SOAP11_ENC, "gYearMonth", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_HEXBINARY = new QName(URI_SOAP11_ENC, "hexBinary", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_ID = new QName(URI_SOAP11_ENC, "ID", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_INT = new QName(URI_SOAP11_ENC, "int", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_INTEGER = new QName(URI_SOAP11_ENC, "integer", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_LANGUAGE = new QName(URI_SOAP11_ENC, "language", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_LONG = new QName(URI_SOAP11_ENC, "long", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NAME = new QName(URI_SOAP11_ENC, "Name", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NCNAME = new QName(URI_SOAP11_ENC, "NCName", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "negativeInteger", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NMTOKEN = new QName(URI_SOAP11_ENC, "NMTOKEN", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NMTOKENS = new QName(URI_SOAP11_ENC, "NMTOKENS", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NONNEGATIVEINTEGER = new QName(URI_SOAP11_ENC, "nonNegativeInteger", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NONPOSITIVEINTEGER = new QName(URI_SOAP11_ENC, "nonPositiveInteger", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_NORMALIZEDSTRING = new QName(URI_SOAP11_ENC, "normalizedString", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_POSITIVEINTEGER = new QName(URI_SOAP11_ENC, "positiveInteger", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_QNAME = new QName(URI_SOAP11_ENC, "QName", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_SHORT = new QName(URI_SOAP11_ENC, "short", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_STRING = new QName(URI_SOAP11_ENC, "string", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_TIME = new QName(URI_SOAP11_ENC, "time", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_TOKEN = new QName(URI_SOAP11_ENC, "token", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_UNSIGNEDBYTE = new QName(URI_SOAP11_ENC, "unsignedByte", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_UNSIGNEDINT = new QName(URI_SOAP11_ENC, "unsignedInt", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_UNSIGNEDLONG = new QName(URI_SOAP11_ENC, "unsignedLong", PREFIX_SOAP11_ENC);
- static final QName TYPE_SOAP11_UNSIGNEDSHORT = new QName(URI_SOAP11_ENC, "unsignedShort", PREFIX_SOAP11_ENC);
-
- /** Encoded mime type namespace for internall and DII use */
- static final String NS_ATTACHMENT_MIME_TYPE = "http://www.jboss.org/jbossws/attachment/mimetype";
-
- /** Attachment Types */
- static final QName TYPE_MIME_APPLICATION_XML = new QName(NS_ATTACHMENT_MIME_TYPE, "application_xml");
- static final QName TYPE_MIME_IMAGE_JPEG = new QName(NS_ATTACHMENT_MIME_TYPE, "image_jpeg");
- static final QName TYPE_MIME_IMAGE_GIF = new QName(NS_ATTACHMENT_MIME_TYPE, "image_gif");
- static final QName TYPE_MIME_MULTIPART_MIXED = new QName(NS_ATTACHMENT_MIME_TYPE, "multipart_mixed");
- static final QName TYPE_MIME_TEXT_PLAIN = new QName(NS_ATTACHMENT_MIME_TYPE, "text_plain");
- static final QName TYPE_MIME_TEXT_XML = new QName(NS_ATTACHMENT_MIME_TYPE, "text_xml");
-
- static final QName TYPE_XMIME_DEFAULT = new QName(NS_XML_MIME, "base64Binary");
-
- /** For out of bound transport (i.e. in headers); http://www.w3.org/2004/08/wsdl/feature/AD/data */
- static final String WSDL_PROPERTY_APPLICATION_DATA = "http://www.w3.org/2004/08/wsdl/feature/AD/data";
- /** The key to the original message part name */
- static final String WSDL_PROPERTY_MESSAGE_NAME = "http://www.jboss.org/jbossws/messagename";
- /** Key to the inbound message name */
- static final String WSDL_PROPERTY_MESSAGE_NAME_IN = "http://www.jboss.org/jbossws/messagename/in";
- /** Key to the outbound message name */
- static final String WSDL_PROPERTY_MESSAGE_NAME_OUT = "http://www.jboss.org/jbossws/messagename/out";
- /** Key to the inbound message name */
- static final String WSDL_PROPERTY_MESSAGE_NAME_FAULT = "http://www.jboss.org/jbossws/messagename/fault";
- /** Key to the inbound wsa action */
- static final String WSDL_PROPERTY_ACTION_IN = "http://www.jboss.org/jbossws/wsa/actionIn";
- /** Key to the outbound wsa action */
- static final String WSDL_PROPERTY_ACTION_OUT = "http://www.jboss.org/jbossws/wsa/actionOut";
- /** Key to the fault wsa action */
- static final String WSDL_PROPERTY_ACTION_FAULT = "http://www.jboss.org/jbossws/wsa/actionFault";
-
- static final String WSDL_PROPERTY_EVENTSOURCE = "http://www.jboss.org/jbossws/wse/isEventSource";
-
- static final String WSDL_ELEMENT_EPR = "http://www.jboss.org/jbossws/epr";
- static final String WSDL_ELEMENT_POLICY = "http://www.jboss.org/jbossws/wsp/policy";
- static final String WSDL_PROPERTY_POLICYURIS = "http://www.jboss.org/jbossws/wsp/policyURIs";
- static final String WSDL_ELEMENT_POLICYREFERENCE = "http://www.jboss.org/jbossws/wsp/policyReference";
-
- /** The key to the original message part name */
- static final String WSDL_PROPERTY_PART_NAME = "http://www.jboss.org/jbossws/partname";
- /** The key to the message part type in case a part does not reference an element; http://www.jboss.org/jbossws/part/xmltype */
- static final String WSDL_PROPERTY_PART_XMLTYPE = "http://www.jboss.org/jbossws/part/xmltype";
- /** Used as WSDL 2.0 property string to provide support for WSDL 1.1 mime types */
- static final String WSDL_PROPERTY_WSDL11_MIME_TYPE = NS_ATTACHMENT_MIME_TYPE;
- /** Indicate that the operation has zero arguments */
- static final String WSDL_PROPERTY_ZERO_ARGS = "http://www.jboss.org/jbossws/zero-args";
- /** Indicate that the operation has a void return*/
- static final String WSDL_PROPERTY_VOID_RETURN = "http://www.jboss.org/jbossws/void-return";
- /** Indicates that an output is a return parameter */
- static final String WSDL_PROPERTY_RETURN_PART = "http://www.jboss.org/jbossws/return-part";
-
- static final QName WSDL_ATTRIBUTE_WSA_ACTION = new QName(URI_WS_ADDRESSING, "Action");
-
- static final QName WSDL_ATTRIBUTE_WSE_EVENTSOURCE = new QName(URI_WS_EVENTING, "EventSource");
-
- static final QName WSDL_ATTRIBUTE_WSP_POLICYURIS = new QName(URI_WS_POLICY, "PolicyURIs");
- static final QName WSDL_ELEMENT_WSP_POLICYREFERENCE = new QName(URI_WS_POLICY, "PolicyReference");
- static final QName WSDL_ELEMENT_JAXWS_BINDINGS = new QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "bindings");
- static final QName WSDL_ELEMENT_JAXWS_CLASS = new QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "class");
- static final QName WSDL_ELEMENT_JAXWS_METHOD = new QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "method");
- static final QName WSDL_ELEMENT_JAXWS_JAVADOC = new QName(URI_JAXWS_WSDL_CUSTOMIZATIONS, "javadoc");
-
- /** WSDL-2.0 exchange patterns */
- static final String WSDL20_PATTERN_IN_ONLY = "http://www.w3.org/2004/08/wsdl/in-only";
- static final String WSDL20_PATTERN_ROUST_IN_ONLY = "http://www.w3.org/2004/08/wsdl/robust-in-only";
- static final String WSDL20_PATTERN_IN_OUT = "http://www.w3.org/2004/08/wsdl/in-out";
- static final String WSDL20_PATTERN_IN_OPTIONAL_OUT = "http://www.w3.org/2004/08/wsdl/in-opt-out";
- static final String WSDL20_PATTERN_OUT_ONLY = "http://www.w3.org/2004/08/wsdl/out-only";
- static final String WSDL20_PATTERN_ROBUST_OUT_ONLY = "http://www.w3.org/2004/08/wsdl/robust-out-only";
- static final String WSDL20_PATTERN_OUT_IN = "http://www.w3.org/2004/08/wsdl/out-in";
- static final String WSDL20_PATTERN_OUT_OPT_IN = "http://www.w3.org/2004/08/wsdl/out-opt-in";
-
- static final String ASYNC_METHOD_SUFFIX = "Async";
-
- static final String EAGER_INITIALIZE_JAXB_CONTEXT_CACHE = "org.jboss.ws.eagerInitializeJAXBContextCache";
-
- static final String DOM_CONTENT_CANONICAL_NORMALIZATION = "org.jboss.ws.DOMContentCanonicalNormalization";
-
- static final String ALWAYS_RESOLVE_DOCUMENT_BUILDER_FACTORY = "org.jboss.ws.alwaysResolveDocumentBuilderFactory";
-
- static final String HTTP_KEEP_ALIVE = "org.jboss.ws.http.keepAlive";
-
- static final String HTTP_MAX_CONNECTIONS = "org.jboss.ws.http.maxConnections";
-
- static final String NETTY_MESSAGE = "org.jboss.ws.http.netty.Message";
-
- static final boolean BC_CONTEXT_MODE = Boolean.parseBoolean(System.getProperty("org.jboss.ws.backward_compatible_context_creator", "false"));
-}
13 years, 10 months