From 0466c15606e9100b3196777609d56083df116d51 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Fri, 7 Dec 2012 16:40:06 +0000
Subject: [PATCH 001/133] Prevent the echo-sample tests from creating a
server-config.wsdd file in the source tree without changing the working
directory.
---
.../tools/maven/wsdd/GenerateWSDDMojo.java | 23 +++++++++++--------
samples/echo-sample/pom.xml | 23 +++++++++++++++++--
2 files changed, 34 insertions(+), 12 deletions(-)
diff --git a/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java b/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
index f05434d82..f2fba7d46 100644
--- a/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
+++ b/maven/maven-wsdd-plugin/src/main/java/org/apache/axis/tools/maven/wsdd/GenerateWSDDMojo.java
@@ -71,10 +71,11 @@ public class GenerateWSDDMojo extends AbstractMojo {
private String type;
/**
- *
+ * A set of WSDD files (typically generated by maven-wsdl2java-plugin) to be merged into the
+ * output WSDD. If this parameter is not set, then the plug-in will just generate a default
+ * configuration file.
*
* @parameter
- * @required
*/
private File[] files;
@@ -148,14 +149,16 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}
}
- // Load WSDD files from plug-in configuration
- for (int i=0; i
+
+ ${project.groupId}
+ maven-wsdd-plugin
+ ${project.version}
+
+
+
+ generate-test-sources
+
+ generate-wsdd
+
+
+ server
+
+
+
+
+ maven-surefire-plugindefault-test
-
- ${project.build.directory}/work
+
+ ${project.build.directory}/server-config.wsdd
+
From 9e16c3376ccf88df9dafa30b68e2ca7405355756 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Fri, 7 Dec 2012 17:02:31 +0000
Subject: [PATCH 002/133] Simplified unit tests. Surefire/failsafe correctly
sets the current working directory by default, so that we don't need to check
the basedir system property. Ensure that we use the default everywhere.
---
.../ant/wsdl/CustomGeneratorFactoryTest.java | 2 +-
.../test/wsdl/clash/VerifyFilesTestCase.java | 3 +--
.../test/wsdl/extra/ExtraClassesTestCase.java | 3 +--
.../test/wsdl/filegen/AllOptionTestCase.java | 3 +--
.../test/wsdl/filegen/FileGenTestCase.java | 3 +--
.../java/test/wsdl/groups/GroupsTestCase.java | 3 +--
.../test/wsdl/header/VerifyFilesTestCase.java | 3 +--
.../SalesRankNPrice_ServiceTestCase.java | 3 +--
.../multibinding/VerifyFilesTestCase.java | 3 +--
.../schemaImport/SchemaImportTestCase.java | 3 +--
.../java/test/wsdl/split/SplitTestCase.java | 3 +--
.../test/java/test/utils/TestMessages.java | 3 +--
.../test/java/test/utils/TestSrcContent.java | 3 +--
.../test/java/test/utils/TestXMLUtils.java | 2 +-
.../java/test/functional/TestAutoTypes.java | 4 ++--
.../wsdl/query/FileGenWrappedTestCase.java | 3 +--
.../test/wsdl/types/DynamicProxyTestCase.java | 4 +++-
.../functional/TestAttachmentsSample.java | 10 ++++-----
.../java/test/functional/TestEchoSample.java | 2 +-
.../example1/VerifyFilesTest.java | 2 +-
.../example2/VerifyFilesTest.java | 2 +-
samples/transport-sample/pom.xml | 21 +++++++++++++++++--
.../functional/TestTCPTransportSample.java | 2 +-
.../test/functional/TestTransportSample.java | 2 +-
24 files changed, 49 insertions(+), 43 deletions(-)
diff --git a/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java b/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java
index d76c49616..e73afa950 100644
--- a/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java
+++ b/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java
@@ -26,7 +26,7 @@
public class CustomGeneratorFactoryTest extends TestCase {
public void test() throws Exception {
- File file = new File(System.getProperty("basedir", "."), "target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java");
+ File file = new File("target/work/com/example/stockquote_wsdl/StockQuoteServiceLocator.java");
assertTrue(FileUtils.readFileToString(file).contains("My header comment"));
}
}
\ No newline at end of file
diff --git a/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java
index 29983c463..5b5e8f790 100644
--- a/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/clash/VerifyFilesTestCase.java
@@ -66,8 +66,7 @@ protected Set mayExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"clash";
} // rootDir
diff --git a/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java b/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java
index 8216feb74..d4afa27a3 100644
--- a/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/extra/ExtraClassesTestCase.java
@@ -59,8 +59,7 @@ protected Set mayExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"extra";
} // rootDir
diff --git a/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java b/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java
index 50ba645c0..c58244c42 100644
--- a/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/filegen/AllOptionTestCase.java
@@ -48,8 +48,7 @@ protected Set shouldExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"filegenAll";
} // rootDir
diff --git a/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java b/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java
index 6dae4483d..ec18f6fa4 100644
--- a/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/filegen/FileGenTestCase.java
@@ -62,8 +62,7 @@ protected Set mayExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"filegen";
}
diff --git a/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java b/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java
index 3bee29918..adfcb75a0 100644
--- a/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/groups/GroupsTestCase.java
@@ -56,8 +56,7 @@ protected Set shouldNotExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"groups";
}
diff --git a/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java
index 4d3edb471..e4a1db31d 100644
--- a/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/header/VerifyFilesTestCase.java
@@ -58,8 +58,7 @@ protected Set shouldExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"header";
} // rootDir
diff --git a/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java b/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java
index 33eec8267..64bbdb9e5 100644
--- a/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/literal/SalesRankNPrice_ServiceTestCase.java
@@ -54,8 +54,7 @@ public class SalesRankNPrice_ServiceTestCase extends junit.framework.TestCase {
};
public void testFileGen() throws IOException {
- String rootDir = System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ String rootDir = "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator + "literal";
// open up the output directory and check what files exist.
File outputDir = new File(rootDir);
diff --git a/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java b/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java
index 9521f6a49..ad40882b3 100644
--- a/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/multibinding/VerifyFilesTestCase.java
@@ -58,8 +58,7 @@ protected Set shouldExist() {
* The directory containing the files that should exist.
*/
protected String rootDir() {
- return System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ return "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"multibinding";
} // rootDir
diff --git a/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java b/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java
index 689bc1889..cb82eec65 100644
--- a/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/schemaImport/SchemaImportTestCase.java
@@ -42,8 +42,7 @@ public SchemaImportTestCase(String name) {
}
public void testSchemaImport() {
- String path = System.getProperty("basedir", ".") + File.separator +
- "target" + File.separator + "work" + File.separator +
+ String path = "target" + File.separator + "work" + File.separator +
"test" + File.separator + "wsdl" + File.separator +
"schemaImport" + File.separator + "foo.wsdl";
Document doc = null;
diff --git a/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java b/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java
index 784aab8f9..bc6fe1e04 100644
--- a/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java
+++ b/axis-ant/src/test/java/test/wsdl/split/SplitTestCase.java
@@ -33,8 +33,7 @@
public class SplitTestCase extends TestCase {
public void testValidateWSDL() throws Exception {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
- Definition definition = reader.readWSDL(new File(System.getProperty("basedir", ".")
- + "/target/work/test/wsdl/split/SplitTestImpl.wsdl").toURI().toString());
+ Definition definition = reader.readWSDL(new File("target/work/test/wsdl/split/SplitTestImpl.wsdl").getAbsoluteFile().toURI().toString());
Service service = definition.getService(new QName("http://split.wsdl.test", "MyPortTypeService"));
Port port = service.getPort("SplitTest");
// This is the critical part: the binding is defined in the imported WSDL
diff --git a/axis-rt-core/src/test/java/test/utils/TestMessages.java b/axis-rt-core/src/test/java/test/utils/TestMessages.java
index 8ffcd473a..dc32db794 100644
--- a/axis-rt-core/src/test/java/test/utils/TestMessages.java
+++ b/axis-rt-core/src/test/java/test/utils/TestMessages.java
@@ -125,9 +125,8 @@ public void testTestExtendedMessages() {
* matches the excpected number of parameters (in the source code).
*/
public void testForMissingMessages() {
- String baseDir = System.getProperty("basedir");
char sep = File.separatorChar;
- String srcDirStr = baseDir + sep + "src" + sep + "main" + sep + "java";
+ String srcDirStr = "src" + sep + "main" + sep + "java";
File srcDir = new File(srcDirStr);
if (srcDir.exists()) {
diff --git a/axis-rt-core/src/test/java/test/utils/TestSrcContent.java b/axis-rt-core/src/test/java/test/utils/TestSrcContent.java
index a9e731552..89c29b4fd 100644
--- a/axis-rt-core/src/test/java/test/utils/TestSrcContent.java
+++ b/axis-rt-core/src/test/java/test/utils/TestSrcContent.java
@@ -44,8 +44,7 @@ public class TestSrcContent extends TestCase {
* tree (xml-axis/java/src), calling checkFile for each file.
*/
public void testSourceFiles() {
- String baseDir = System.getProperty("basedir");
- File srcDir = new File(baseDir, "src/main/java");
+ File srcDir = new File("src/main/java");
if (srcDir.exists()) {
walkTree(srcDir);
diff --git a/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java b/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java
index fe38606bc..4f0e9bb36 100644
--- a/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java
+++ b/axis-rt-core/src/test/java/test/utils/TestXMLUtils.java
@@ -303,7 +303,7 @@ public void testDOMXXE() throws Exception
String msg = "" +
"" +
+ "" +
"]>" +
"
+
+ ${project.groupId}
+ maven-wsdd-plugin
+ ${project.version}
+
+
+
+ pre-integration-test
+
+ generate-wsdd
+
+
+ server
+
+
+
+
+ maven-failsafe-plugin
@@ -115,9 +133,8 @@
**/Test*.java
-
- ${project.build.directory}/work
+ ${project.build.directory}/server-config.wsdd${test.functional.TCPListenerPort}
diff --git a/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java b/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java
index 8de7b5e2f..da7c322e0 100644
--- a/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java
+++ b/samples/transport-sample/src/test/java/test/functional/TestTCPTransportSample.java
@@ -48,7 +48,7 @@ public TestTCPTransportSample(String name) {
}
public void doTestDeploy () throws Exception {
- String[] args = { "-l" + uri, System.getProperty("basedir", ".") + "/src/main/wsdd/deploy.wsdd" };
+ String[] args = { "-l" + uri, "src/main/wsdd/deploy.wsdd" };
AdminClient.main(args);
}
diff --git a/samples/transport-sample/src/test/java/test/functional/TestTransportSample.java b/samples/transport-sample/src/test/java/test/functional/TestTransportSample.java
index 6ada54094..d45efde1f 100644
--- a/samples/transport-sample/src/test/java/test/functional/TestTransportSample.java
+++ b/samples/transport-sample/src/test/java/test/functional/TestTransportSample.java
@@ -35,7 +35,7 @@ public TestTransportSample(String name) {
}
public void doTestDeploy () throws Exception {
- String[] args = { "-llocal:", System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
+ String[] args = { "-llocal:", "src/main/wsdd/deploy.wsdd" };
AdminClient.main(args);
}
From 851431baa0235f4e1095ec272ccb8ae631e53268 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Fri, 7 Dec 2012 18:54:39 +0000
Subject: [PATCH 003/133] Added a Maven profile to make it easier to generate
Eclipse project metadata and to work around an issue that occurs when
maven-eclipse-plugin and maven-shade-plugin are used together.
---
pom.xml | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/pom.xml b/pom.xml
index c410f0c84..3029a347a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -227,6 +227,10 @@
maven-shade-plugin2.0
+
+ maven-eclipse-plugin
+ 2.9
+
@@ -306,6 +310,38 @@
+
+
+
+ eclipse
+
+ true
+
+
+ install
+
+
+ maven-eclipse-plugin
+
+
+
+ prepare-package
+
+ eclipse
+
+
+ true
+
+
+
+
+
+
+
+
From e78e99fcdef2da3c2b1e2f8b36148b481b839470 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sat, 8 Dec 2012 15:38:24 +0000
Subject: [PATCH 004/133] Mavenized the JMS sample and added the necessary
stuff to perform an integration test with ActiveMQ.
---
.../apache/axis/testutils/daemon/Daemon.java | 24 +-
.../axis/testutils/daemon/Launcher.java | 56 +++++
distribution/src/main/assembly/bin.xml | 12 +
.../server/AbstractStartProcessMojo.java | 5 +-
...ion.java => AxisServerProcessControl.java} | 14 +-
.../maven/server/DaemonProcessControl.java | 74 ++++++
.../maven/server/DefaultProcessManager.java | 10 +-
.../tools/maven/server/ManagedProcess.java | 10 +-
...essStopAction.java => ProcessControl.java} | 32 ++-
.../tools/maven/server/ProcessManager.java | 2 +-
.../tools/maven/server/StartDaemonMojo.java | 77 +++++++
.../tools/maven/server/StartProcessMojo.java | 10 +-
.../tools/maven/server/StartServerMojo.java | 7 +-
.../wsdl2java/AbstractWsdl2JavaMojo.java | 9 +-
samples/jms-sample/pom.xml | 213 ++++++++++++++++++
.../src/main/java}/samples/jms/JMSTest.java | 1 +
.../java}/samples/jms/dii/JMSURLTest.java | 29 +--
.../samples/jms/stub/JMSURLStubTest.java | 21 +-
.../src/main/wsdd}/client-config.wsdd | 0
.../src/main/wsdd}/server-config.wsdd | 0
.../jms-sample/src/main/wsdl}/GetQuote.wsdl | 0
.../activemq-connection-factory.properties | 3 +
.../test/java/samples/jms/ActiveMQDaemon.java | 28 +--
samples/pom.xml | 1 +
24 files changed, 546 insertions(+), 92 deletions(-)
rename maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java => axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java (54%)
create mode 100644 axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
rename maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/{AxisServerStartAction.java => AxisServerProcessControl.java} (82%)
create mode 100644 maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonProcessControl.java
rename maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/{ProcessStopAction.java => ProcessControl.java} (62%)
create mode 100644 maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
create mode 100644 samples/jms-sample/pom.xml
rename {distribution/src/main/files => samples/jms-sample/src/main/java}/samples/jms/JMSTest.java (99%)
rename {distribution/src/main/files => samples/jms-sample/src/main/java}/samples/jms/dii/JMSURLTest.java (84%)
rename {distribution/src/main/files => samples/jms-sample/src/main/java}/samples/jms/stub/JMSURLStubTest.java (87%)
rename {distribution/src/main/files/samples/jms => samples/jms-sample/src/main/wsdd}/client-config.wsdd (100%)
rename {distribution/src/main/files/samples/jms => samples/jms-sample/src/main/wsdd}/server-config.wsdd (100%)
rename {distribution/src/main/files/samples/jms/stub => samples/jms-sample/src/main/wsdl}/GetQuote.wsdl (100%)
create mode 100644 samples/jms-sample/src/test/conf/activemq-connection-factory.properties
rename maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java => samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java (60%)
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java b/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java
similarity index 54%
rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java
rename to axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java
index 51b08ce7b..4ac087046 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStopAction.java
+++ b/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java
@@ -16,25 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis.tools.maven.server;
+package org.apache.axis.testutils.daemon;
-import java.io.File;
-
-import org.apache.axis.client.AdminClient;
-import org.codehaus.plexus.logging.Logger;
-
-public class AxisServerStopAction implements ProcessStopAction {
- private final AdminClient adminClient;
- private final File[] undeployments;
-
- public AxisServerStopAction(AdminClient adminClient, File[] undeployments) {
- this.adminClient = adminClient;
- this.undeployments = undeployments;
- }
-
- public int execute(Logger logger) throws Exception {
- AdminClientUtils.process(logger, adminClient, undeployments);
- adminClient.quit();
- return STOPPING;
- }
+public interface Daemon {
+ void start(String[] args) throws Exception;
+ void stop() throws Exception;
}
diff --git a/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java b/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
new file mode 100644
index 000000000..36bb2c6eb
--- /dev/null
+++ b/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.testutils.daemon;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+public class Launcher {
+ public static void main(String[] args) throws Exception {
+ String daemonClass = args[0];
+ int controlPort = Integer.parseInt(args[1]);
+ String[] daemonArgs = new String[args.length-2];
+ System.arraycopy(args, 2, daemonArgs, 0, args.length-2);
+ ServerSocket controlServerSocket = new ServerSocket();
+ controlServerSocket.bind(new InetSocketAddress(InetAddress.getByName("localhost"), controlPort));
+ Socket controlSocket = controlServerSocket.accept();
+ BufferedReader controlIn = new BufferedReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII"));
+ Writer controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII");
+ Daemon daemon = (Daemon)Class.forName(daemonClass).newInstance();
+ daemon.start(daemonArgs);
+ controlOut.write("READY\r\n");
+ controlOut.flush();
+ String request = controlIn.readLine();
+ if (request == null) {
+ System.err.println("Control connection unexpectedly closed");
+ } else if (request.equals("STOP")) {
+ daemon.stop();
+ controlOut.write("STOPPED\r\n");
+ controlOut.flush();
+ } else {
+ System.err.println("Unexpected request: " + request);
+ }
+ }
+}
diff --git a/distribution/src/main/assembly/bin.xml b/distribution/src/main/assembly/bin.xml
index 175ad2588..49a7f3a18 100644
--- a/distribution/src/main/assembly/bin.xml
+++ b/distribution/src/main/assembly/bin.xml
@@ -112,6 +112,18 @@
../samples/jaxrpc-sample/src/main/wsddsamples/jaxrpc
+
+ ../samples/jms-sample/src/main/java
+ /
+
+
+ ../samples/jms-sample/src/main/wsdl
+ samples/jms/stub
+
+
+ ../samples/jms-sample/src/main/wsdd
+ samples/jms
+ ../samples/message-sample/src/main/java/
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
index 7dd6f75e8..49bd75d32 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
@@ -102,7 +102,7 @@ protected boolean isDebug() {
return debug;
}
- protected void startJavaProcess(String description, String mainClass, String[] args, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws MojoExecutionException, MojoFailureException {
+ protected void startJavaProcess(String description, String mainClass, String[] args, File workDir, ProcessControl processControl) throws MojoExecutionException, MojoFailureException {
Log log = getLog();
// Locate java executable to use
@@ -155,8 +155,7 @@ protected void startJavaProcess(String description, String mainClass, String[] a
description,
(String[])cmdline.toArray(new String[cmdline.size()]),
workDir,
- startAction,
- stopAction);
+ processControl);
} catch (Exception ex) {
throw new MojoFailureException("Failed to start server", ex);
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerProcessControl.java
similarity index 82%
rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java
rename to maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerProcessControl.java
index a937f8158..b4a8b147a 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerStartAction.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AxisServerProcessControl.java
@@ -28,20 +28,22 @@
import org.apache.axis.client.Call;
import org.codehaus.plexus.logging.Logger;
-public class AxisServerStartAction implements ProcessStartAction {
+public class AxisServerProcessControl implements ProcessControl {
private final int port;
private final AdminClient adminClient;
private final File[] deployments;
+ private final File[] undeployments;
private final int timeout;
- public AxisServerStartAction(int port, AdminClient adminClient, File[] deployments, int timeout) {
+ public AxisServerProcessControl(int port, AdminClient adminClient, File[] deployments, File[] undeployments, int timeout) {
this.port = port;
this.adminClient = adminClient;
this.deployments = deployments;
+ this.undeployments = undeployments;
this.timeout = timeout;
}
- public void execute(Logger logger, Process process) throws Exception {
+ public void initializeProcess(Logger logger, Process process) throws Exception {
// Wait for server to become ready
String versionUrl = "http://localhost:" + port + "/axis/services/Version";
Call call = new Call(new URL(versionUrl));
@@ -70,4 +72,10 @@ public void execute(Logger logger, Process process) throws Exception {
// Deploy services
AdminClientUtils.process(logger, adminClient, deployments);
}
+
+ public int shutdownProcess(Logger logger) throws Exception {
+ AdminClientUtils.process(logger, adminClient, undeployments);
+ adminClient.quit();
+ return STOPPING;
+ }
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonProcessControl.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonProcessControl.java
new file mode 100644
index 000000000..2e0767239
--- /dev/null
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DaemonProcessControl.java
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.server;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.InetAddress;
+import java.net.Socket;
+
+import org.codehaus.plexus.logging.Logger;
+
+public class DaemonProcessControl implements ProcessControl {
+ private final int controlPort;
+ private BufferedReader controlIn;
+ private Writer controlOut;
+
+ public DaemonProcessControl(int controlPort) {
+ this.controlPort = controlPort;
+ }
+
+ public void initializeProcess(Logger logger, Process process) throws Exception {
+ logger.debug("Attempting to establish control connection on port " + controlPort);
+ Socket controlSocket;
+ while (true) {
+ try {
+ controlSocket = new Socket(InetAddress.getByName("localhost"), controlPort);
+ break;
+ } catch (IOException ex) {
+ Thread.sleep(100);
+ }
+ }
+ logger.debug("Control connection established");
+ controlIn = new BufferedReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII"));
+ controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII");
+ logger.debug("Waiting for daemon to become ready");
+ expectStatus("READY");
+ logger.debug("Daemon is ready");
+ }
+
+ public int shutdownProcess(Logger logger) throws Exception {
+ controlOut.write("STOP\r\n");
+ controlOut.flush();
+ expectStatus("STOPPED");
+ return STOPPING;
+ }
+
+ private void expectStatus(String expectedStatus) throws IOException {
+ String status = controlIn.readLine();
+ if (status == null) {
+ throw new IllegalStateException("Control connection unexpectedly closed");
+ } else if (!status.equals(expectedStatus)) {
+ throw new IllegalStateException("Unexpected status: " + status);
+ }
+ }
+}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java
index 14046b0ab..7b8bc79b0 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/DefaultProcessManager.java
@@ -36,15 +36,15 @@ public void enableLogging(Logger logger) {
this.logger = logger;
}
- public void startProcess(String description, String[] cmdline, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws Exception {
+ public void startProcess(String description, String[] cmdline, File workDir, ProcessControl processControl) throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("Starting process with command line: " + Arrays.asList(cmdline));
}
Process process = Runtime.getRuntime().exec(cmdline, null, workDir);
- managedProcesses.add(new ManagedProcess(process, description, stopAction));
+ managedProcesses.add(new ManagedProcess(process, description, processControl));
new Thread(new StreamPump(process.getInputStream(), System.out)).start();
new Thread(new StreamPump(process.getErrorStream(), System.err)).start();
- startAction.execute(logger, process);
+ processControl.initializeProcess(logger, process);
}
public void stopAll() throws Exception {
@@ -54,7 +54,7 @@ public void stopAll() throws Exception {
int result;
logger.debug("Executing stop action");
try {
- result = managedProcess.getStopAction().execute(logger);
+ result = managedProcess.getProcessControl().shutdownProcess(logger);
} catch (Exception ex) {
if (savedException == null) {
savedException = ex;
@@ -64,7 +64,7 @@ public void stopAll() throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("result = " + result);
}
- if (result == ProcessStopAction.STOPPING) {
+ if (result == ProcessControl.STOPPING) {
managedProcess.getProcess().waitFor();
} else {
managedProcess.getProcess().destroy();
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ManagedProcess.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ManagedProcess.java
index e8d7d23cb..2237691a4 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ManagedProcess.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ManagedProcess.java
@@ -21,12 +21,12 @@
public class ManagedProcess {
private final Process process;
private final String description;
- private final ProcessStopAction stopAction;
+ private final ProcessControl processControl;
- public ManagedProcess(Process process, String description, ProcessStopAction stopAction) {
+ public ManagedProcess(Process process, String description, ProcessControl processControl) {
this.process = process;
this.description = description;
- this.stopAction = stopAction;
+ this.processControl = processControl;
}
public Process getProcess() {
@@ -37,7 +37,7 @@ public String getDescription() {
return description;
}
- public ProcessStopAction getStopAction() {
- return stopAction;
+ public ProcessControl getProcessControl() {
+ return processControl;
}
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessControl.java
similarity index 62%
rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java
rename to maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessControl.java
index 299c8da75..4eb70bc40 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStopAction.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessControl.java
@@ -21,18 +21,12 @@
import org.codehaus.plexus.logging.Logger;
/**
- * Action to be executed when a process is stopped. Typically (but not necessarily) this involves
- * sending a request to initiate a clean shutdown of the process.
+ * Defines the actions to be executed after a given process has been started and when a process is
+ * stopped.
*
* @author Andreas Veithen
*/
-public interface ProcessStopAction {
- ProcessStopAction NOP = new ProcessStopAction() {
- public int execute(Logger logger) throws Exception {
- return RUNNING;
- }
- };
-
+public interface ProcessControl {
/**
* Indicates that the process is expected to be still running after the action is completed.
*/
@@ -44,5 +38,23 @@ public int execute(Logger logger) throws Exception {
*/
int STOPPING = 2;
- int execute(Logger logger) throws Exception;
+ /**
+ * Initialize the process. This typically involves waiting for the process to be completely
+ * started and to configure the server process, e.g. to deploy services.
+ *
+ * @param logger
+ * @param process
+ * @throws Exception
+ */
+ void initializeProcess(Logger logger, Process process) throws Exception;
+
+ /**
+ * Prepare the process for shutdown. Typically (but not necessarily) this involves sending a
+ * request to initiate a clean shutdown of the process.
+ *
+ * @param logger
+ * @return
+ * @throws Exception
+ */
+ int shutdownProcess(Logger logger) throws Exception;
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java
index cfa7db04e..d0ffadea5 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessManager.java
@@ -21,6 +21,6 @@
import java.io.File;
public interface ProcessManager {
- void startProcess(String description, String[] cmdline, File workDir, ProcessStartAction startAction, ProcessStopAction stopAction) throws Exception;
+ void startProcess(String description, String[] cmdline, File workDir, ProcessControl processControl) throws Exception;
void stopAll() throws Exception;
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
new file mode 100644
index 000000000..286b57f03
--- /dev/null
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.maven.server;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Start a daemon.
+ *
+ * @goal start-daemon
+ * @phase pre-integration-test
+ * @requiresDependencyResolution test
+ */
+public class StartDaemonMojo extends AbstractStartProcessMojo {
+ /**
+ * The daemon class.
+ *
+ * @parameter
+ * @required
+ */
+ private String daemonClass;
+
+ /**
+ * The arguments to be passed to the main class.
+ *
+ * @parameter
+ */
+ private String[] args;
+
+ /**
+ * The working directory for the process.
+ *
+ * @parameter default-value="${project.build.directory}/work"
+ * @required
+ */
+ private File workDir;
+
+ protected void doExecute() throws MojoExecutionException, MojoFailureException {
+ int controlPort;
+ try {
+ ServerSocket ss = new ServerSocket(0);
+ controlPort = ss.getLocalPort();
+ ss.close();
+ } catch (IOException ex) {
+ throw new MojoFailureException("Failed to allocate port number", ex);
+ }
+ workDir.mkdirs();
+ String[] vmArgs = new String[args != null ? args.length + 2 : 2];
+ vmArgs[0] = daemonClass;
+ vmArgs[1] = String.valueOf(controlPort);
+ if (args != null) {
+ System.arraycopy(args, 0, vmArgs, 2, args.length);
+ }
+ startJavaProcess(daemonClass, "org.apache.axis.testutils.daemon.Launcher", vmArgs, workDir, new DaemonProcessControl(controlPort));
+ }
+}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
index 3777a9e0f..b9e5993e1 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
@@ -22,6 +22,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.codehaus.plexus.logging.Logger;
/**
* Start an arbitrary Java process.
@@ -56,6 +57,13 @@ public class StartProcessMojo extends AbstractStartProcessMojo {
protected void doExecute() throws MojoExecutionException, MojoFailureException {
workDir.mkdirs();
- startJavaProcess(mainClass, mainClass, args != null ? args : new String[0], workDir, ProcessStartAction.NOP, ProcessStopAction.NOP);
+ startJavaProcess(mainClass, mainClass, args != null ? args : new String[0], workDir, new ProcessControl() {
+ public void initializeProcess(Logger logger, Process process) throws Exception {
+ }
+
+ public int shutdownProcess(Logger logger) throws Exception {
+ return RUNNING;
+ }
+ });
}
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
index f0953d4b0..e986eb0bd 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
@@ -219,11 +219,10 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
"org.apache.axis.server.standalone.StandaloneAxisServer",
(String[])args.toArray(new String[args.size()]),
workDir,
- new AxisServerStartAction(actualPort, adminClient,
+ new AxisServerProcessControl(actualPort, adminClient,
(File[])deployments.toArray(new File[deployments.size()]),
- isDebug() || foreground ? Integer.MAX_VALUE : 20000),
- new AxisServerStopAction(adminClient,
- (File[])undeployments.toArray(new File[undeployments.size()])));
+ (File[])undeployments.toArray(new File[undeployments.size()]),
+ isDebug() || foreground ? Integer.MAX_VALUE : 20000));
} catch (Exception ex) {
throw new MojoFailureException("Failed to start server", ex);
}
diff --git a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java b/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
index cfbebaea2..21f83c89c 100644
--- a/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
+++ b/maven/maven-wsdl2java-plugin/src/main/java/org/apache/axis/tools/maven/wsdl2java/AbstractWsdl2JavaMojo.java
@@ -179,6 +179,13 @@ public abstract class AbstractWsdl2JavaMojo extends AbstractMojo {
*/
private boolean helperGen;
+ /**
+ *
+ *
+ * @parameter default-value="false"
+ */
+ private boolean allowInvalidURL;
+
/**
* The location of the deployment WSDD file to be generated. This parameter is ignored if
* {@link #generate} is set to client. If this parameter is not specified, then no
@@ -269,7 +276,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
// emitter.setQuiet(quiet);
emitter.setTypeMappingVersion(typeMappingVersion);
emitter.setNowrap(noWrapped);
-// emitter.setAllowInvalidURL(allowInvalidURL);
+ emitter.setAllowInvalidURL(allowInvalidURL);
emitter.setWrapArrays(wrapArrays);
// if (namespaceMappingFile != null) {
// emitter.setNStoPkg(namespaceMappingFile.toString());
diff --git a/samples/jms-sample/pom.xml b/samples/jms-sample/pom.xml
new file mode 100644
index 000000000..fb2038bf7
--- /dev/null
+++ b/samples/jms-sample/pom.xml
@@ -0,0 +1,213 @@
+
+
+
+ 4.0.0
+
+ org.apache.axis
+ samples
+ 1.4.1-SNAPSHOT
+ ../pom.xml
+
+ jms-sample
+ JMS Sample
+
+
+ ${project.groupId}
+ axis-rt-core
+ ${project.version}
+
+
+ ${project.groupId}
+ axis-rt-transport-jms
+ ${project.version}
+
+
+ ${project.groupId}
+ stock-sample
+ ${project.version}
+
+
+ junit
+ junit
+
+
+ org.apache.activemq
+ activemq-core
+ 5.6.0
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ 1.6.4
+
+
+ ${project.groupId}
+ axis-testutils
+ ${project.version}
+ test
+
+
+
+
+
+ ${project.groupId}
+ maven-wsdl2java-plugin
+ ${project.version}
+
+
+
+ generate-sources
+
+
+ src/main/wsdl/GetQuote.wsdl
+ client
+ 1.1
+ session
+ true
+
+
+ urn:xmltoday-delayed-quotes
+ samples.jms.stub.xmltoday_delayed_quotes
+
+
+ urn:xmltoday-delayed-quotes
+ samples.jms.stub.xmltoday_delayed_quotes
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+
+
+ pre-integration-test
+
+ reserve-network-port
+
+
+
+ test.brokerPort
+
+
+
+
+
+
+ maven-resources-plugin
+
+
+ pre-integration-test
+
+ copy-resources
+
+
+
+
+ src/test/conf
+ true
+
+
+ ${project.build.directory}/conf
+
+
+
+
+
+ ${project.groupId}
+ maven-axis-server-plugin
+ ${project.version}
+
+
+ start-broker
+
+ start-daemon
+
+
+ samples.jms.ActiveMQDaemon
+
+ ${test.brokerPort}
+
+
+
+
+ stop-broker
+
+ stop-all
+
+
+
+
+
+ maven-antrun-plugin
+
+
+ integration-test
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/distribution/src/main/files/samples/jms/JMSTest.java b/samples/jms-sample/src/main/java/samples/jms/JMSTest.java
similarity index 99%
rename from distribution/src/main/files/samples/jms/JMSTest.java
rename to samples/jms-sample/src/main/java/samples/jms/JMSTest.java
index 07389e0c0..45adbc657 100644
--- a/distribution/src/main/files/samples/jms/JMSTest.java
+++ b/samples/jms-sample/src/main/java/samples/jms/JMSTest.java
@@ -120,6 +120,7 @@ public static void main(String args[]) throws Exception {
catch(AxisFault af)
{
System.out.println(af.dumpToString());
+ System.exit(1);
}
}
diff --git a/distribution/src/main/files/samples/jms/dii/JMSURLTest.java b/samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java
similarity index 84%
rename from distribution/src/main/files/samples/jms/dii/JMSURLTest.java
rename to samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java
index 31b12cd1e..409ba464e 100644
--- a/distribution/src/main/files/samples/jms/dii/JMSURLTest.java
+++ b/samples/jms-sample/src/main/java/samples/jms/dii/JMSURLTest.java
@@ -6,7 +6,6 @@
import org.apache.axis.configuration.XMLStringProvider;
import org.apache.axis.deployment.wsdd.WSDDConstants;
import org.apache.axis.encoding.XMLType;
-import org.apache.axis.transport.jms.JMSConstants;
import org.apache.axis.transport.jms.JMSTransport;
import org.apache.axis.transport.jms.SimpleJMSListener;
import org.apache.axis.utils.Options;
@@ -36,24 +35,7 @@ public class JMSURLTest {
"";
// the JMS URL target endpoint address
- static String sampleJmsUrl = "jms:/MyQ?" +
- "vendor=JNDI" +
- "&java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory" +
- "&java.naming.provider.url=file:///c:/JNDIStore" +
- "&ConnectionFactoryJNDIName=MyCF" +
- "&deliveryMode=persistent" +
- "&priority=5" +
- "&ttl=10000" +
- "&debug=true";
- /*
- // example using Sonic
- static String sampleJmsUrl = "jms:/SampleQ1?" +
- "vendor=SonicMQ" +
- "&brokerURL=localhost:2506" +
- "&deliveryMode=persistent" +
- "&priority=5" +
- "&ttl=10000";
- */
+ static String sampleJmsUrl;
public static void main(String args[]) throws Exception {
Options opts = new Options( args );
@@ -69,6 +51,11 @@ public static void main(String args[]) throws Exception {
HashMap cfMap = SimpleJMSListener.createCFMap(opts);
String destination = opts.isValueSet('d');
+ sampleJmsUrl = opts.isValueSet('e');
+ if (sampleJmsUrl == null) {
+ printUsage();
+ }
+
// create the jms listener
SimpleJMSListener listener = new SimpleJMSListener(connectorMap,
cfMap,
@@ -92,6 +79,7 @@ public static void main(String args[]) throws Exception {
catch(AxisFault af)
{
System.out.println(af.dumpToString());
+ System.exit(1);
}
}
@@ -102,7 +90,7 @@ public static void main(String args[]) throws Exception {
// note: this is optional, as all connectors will be closed upon exit
JMSTransport.closeMatchingJMSConnectors(sampleJmsUrl, username, password);
- System.exit(1);
+ System.exit(0);
}
public static Float getQuote(String ticker, String username, String password)
@@ -151,6 +139,7 @@ public static void printUsage()
System.out.println(" -c connection factory properties filename");
System.out.println(" -d destination");
System.out.println(" -t topic [absence of -t indicates queue]");
+ System.out.println(" -e the JMS endpoint URL to use for the client");
System.out.println();
System.out.println(" -u username");
System.out.println(" -w password");
diff --git a/distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java b/samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java
similarity index 87%
rename from distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java
rename to samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java
index 58814a4ca..be4402dad 100644
--- a/distribution/src/main/files/samples/jms/stub/JMSURLStubTest.java
+++ b/samples/jms-sample/src/main/java/samples/jms/stub/JMSURLStubTest.java
@@ -25,6 +25,8 @@
import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
@@ -44,17 +46,23 @@ public JMSURLStubTest(String name) {
super(name);
}
- public static Float getQuote(String ticker) throws AxisFault {
+ public static Float getQuote(String endptAddr, String ticker) throws AxisFault {
float quote = -1.0F;
GetQuoteServiceLocator locator = new GetQuoteServiceLocator();
GetQuote getQuote;
+ if (endptAddr == null) {
+ endptAddr = locator.getGetQuoteAddress();
+ }
+
try {
- getQuote = locator.getGetQuote();
+ getQuote = locator.getGetQuote(new URL(endptAddr));
}
catch (ServiceException e) {
throw new AxisFault("JAX-RPC ServiceException caught: ", e);
+ } catch (MalformedURLException e) {
+ throw new AxisFault("MalformedURLException caught: ", e);
}
assertTrue("getQuote is null", getQuote != null);
@@ -64,7 +72,6 @@ public static Float getQuote(String ticker) throws AxisFault {
// close matching connectors
// note: this is optional, as all connectors will be closed upon exit
- String endptAddr = locator.getGetQuoteAddress();
JMSTransport.closeMatchingJMSConnectors(endptAddr, null, null);
}
catch (RemoteException e) {
@@ -82,6 +89,7 @@ public static void printUsage()
System.out.println(" -c connection factory properties filename");
System.out.println(" -d destination");
System.out.println(" -t topic [absence of -t indicates queue]");
+ System.out.println(" -e the JMS endpoint URL to use for the client");
System.out.println();
System.out.println(" -u username");
System.out.println(" -w password");
@@ -110,6 +118,8 @@ public static void main(String[] args) throws Exception
HashMap cfMap = SimpleJMSListener.createCFMap(opts);
String destination = opts.isValueSet('d');
+ String endptAddr = opts.isValueSet('e');
+
args = opts.getRemainingArgs();
if ( args == null || args.length == 0)
printUsage();
@@ -129,17 +139,18 @@ public static void main(String[] args) throws Exception
{
try
{
- Float quote = stubTest.getQuote(args[i]);
+ Float quote = stubTest.getQuote(endptAddr, args[i]);
System.out.println(args[i] + ": " + quote);
}
catch(AxisFault af)
{
System.out.println(af.dumpToString());
+ System.exit(1);
}
}
listener.shutdown();
- System.exit(1);
+ System.exit(0);
}
}
diff --git a/distribution/src/main/files/samples/jms/client-config.wsdd b/samples/jms-sample/src/main/wsdd/client-config.wsdd
similarity index 100%
rename from distribution/src/main/files/samples/jms/client-config.wsdd
rename to samples/jms-sample/src/main/wsdd/client-config.wsdd
diff --git a/distribution/src/main/files/samples/jms/server-config.wsdd b/samples/jms-sample/src/main/wsdd/server-config.wsdd
similarity index 100%
rename from distribution/src/main/files/samples/jms/server-config.wsdd
rename to samples/jms-sample/src/main/wsdd/server-config.wsdd
diff --git a/distribution/src/main/files/samples/jms/stub/GetQuote.wsdl b/samples/jms-sample/src/main/wsdl/GetQuote.wsdl
similarity index 100%
rename from distribution/src/main/files/samples/jms/stub/GetQuote.wsdl
rename to samples/jms-sample/src/main/wsdl/GetQuote.wsdl
diff --git a/samples/jms-sample/src/test/conf/activemq-connection-factory.properties b/samples/jms-sample/src/test/conf/activemq-connection-factory.properties
new file mode 100644
index 000000000..e00afa0de
--- /dev/null
+++ b/samples/jms-sample/src/test/conf/activemq-connection-factory.properties
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory
+java.naming.provider.url=tcp://localhost:${test.brokerPort}
+transport.jms.ConnectionFactoryJNDIName=ConnectionFactory
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
similarity index 60%
rename from maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java
rename to samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
index 3dddd0790..ea790354e 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/ProcessStartAction.java
+++ b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
@@ -16,21 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis.tools.maven.server;
+package samples.jms;
-import org.codehaus.plexus.logging.Logger;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.axis.testutils.daemon.Daemon;
-/**
- * Action to be executed after a given process has been started. This is typically used to configure
- * the server process, e.g. to deploy services.
- *
- * @author Andreas Veithen
- */
-public interface ProcessStartAction {
- ProcessStartAction NOP = new ProcessStartAction() {
- public void execute(Logger logger, Process process) throws Exception {
- }
- };
+public class ActiveMQDaemon implements Daemon {
+ private BrokerService broker;
- void execute(Logger logger, Process process) throws Exception;
+ public void start(String[] args) throws Exception {
+ broker = BrokerFactory.createBroker("broker:(tcp://localhost:" + args[0] + ")?useJmx=false&persistent=false");
+ broker.start();
+ }
+
+ public void stop() throws Exception {
+ broker.stop();
+ }
}
diff --git a/samples/pom.xml b/samples/pom.xml
index 92da41690..9c7d2908e 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -42,6 +42,7 @@
integrationguide-samplejaxm-samplejaxrpc-sample
+ jms-samplemessage-samplemtomstub-samplemisc-sample
From 27fb034a11d4cdfea6679702da8d1e02722da0a2 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sat, 8 Dec 2012 18:25:02 +0000
Subject: [PATCH 005/133] Fixed some build issues.
---
samples/jms-sample/pom.xml | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/samples/jms-sample/pom.xml b/samples/jms-sample/pom.xml
index fb2038bf7..b63d9e3f0 100644
--- a/samples/jms-sample/pom.xml
+++ b/samples/jms-sample/pom.xml
@@ -50,14 +50,9 @@
org.apache.activemqactivemq-core
- 5.6.0
+ 5.4.3test
-
- org.slf4j
- slf4j-simple
- 1.6.4
- ${project.groupId}axis-testutils
@@ -167,7 +162,7 @@
run
-
+
From a170c458754dddb24b4d53b433c396c63798f332 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sun, 9 Dec 2012 09:45:08 +0000
Subject: [PATCH 006/133] Let maven-axis-server-plugin automatically add
axis-standalone-server to the classpath so that it is no longer required to
declare it as a dependency.
---
axis-rt-transport-http-javanet/pom.xml | 6 -
integration/pom.xml | 6 -
.../server/AbstractStartProcessMojo.java | 133 +++++++++++++++++-
.../tools/maven/server/StartDaemonMojo.java | 2 +-
.../tools/maven/server/StartProcessMojo.java | 2 +-
.../tools/maven/server/StartServerMojo.java | 13 ++
samples/addr-sample/pom.xml | 6 -
samples/attachments-sample/pom.xml | 5 -
samples/bidbuy-sample/pom.xml | 5 -
samples/encoding-sample/pom.xml | 5 -
samples/faults-sample/pom.xml | 5 -
samples/handler-sample/pom.xml | 5 -
samples/jaxrpc-sample/pom.xml | 5 -
samples/message-sample/pom.xml | 5 -
samples/misc-sample/pom.xml | 5 -
samples/proxy-sample/pom.xml | 5 -
samples/stock-sample/pom.xml | 5 -
17 files changed, 142 insertions(+), 76 deletions(-)
diff --git a/axis-rt-transport-http-javanet/pom.xml b/axis-rt-transport-http-javanet/pom.xml
index d23c1c8e0..4a68e9089 100644
--- a/axis-rt-transport-http-javanet/pom.xml
+++ b/axis-rt-transport-http-javanet/pom.xml
@@ -51,12 +51,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
- test
- ${project.groupId}interop-mock
diff --git a/integration/pom.xml b/integration/pom.xml
index d61c89c9a..1875db263 100644
--- a/integration/pom.xml
+++ b/integration/pom.xml
@@ -43,12 +43,6 @@
axis-codegen${project.version}
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
- test
- ${project.groupId}axis-testutils
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
index 49bd75d32..7f7674871 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/AbstractStartProcessMojo.java
@@ -21,19 +21,37 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
+import java.util.Set;
-import org.apache.maven.artifact.DependencyResolutionRequiredException;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.resolver.DebugResolutionListener;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.toolchain.Toolchain;
import org.apache.maven.toolchain.ToolchainManager;
+import org.codehaus.plexus.logging.LogEnabled;
+import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils;
-public abstract class AbstractStartProcessMojo extends AbstractServerMojo {
+public abstract class AbstractStartProcessMojo extends AbstractServerMojo implements LogEnabled {
/**
* The maven project.
*
@@ -52,6 +70,49 @@ public abstract class AbstractStartProcessMojo extends AbstractServerMojo {
*/
private MavenSession session;
+ /**
+ * @component
+ */
+ private MavenProjectBuilder projectBuilder;
+
+ /**
+ * Local maven repository.
+ *
+ * @parameter expression="${localRepository}"
+ * @required
+ * @readonly
+ */
+ private ArtifactRepository localRepository;
+
+ /**
+ * Remote repositories.
+ *
+ * @parameter expression="${project.remoteArtifactRepositories}"
+ * @required
+ * @readonly
+ */
+ private List remoteArtifactRepositories;
+
+ /**
+ * @component
+ */
+ protected ArtifactFactory artifactFactory;
+
+ /**
+ * @component
+ */
+ private ArtifactResolver artifactResolver;
+
+ /**
+ * @component
+ */
+ private ArtifactCollector artifactCollector;
+
+ /**
+ * @component
+ */
+ private ArtifactMetadataSource artifactMetadataSource;
+
/**
* @component
*/
@@ -98,11 +159,71 @@ public abstract class AbstractStartProcessMojo extends AbstractServerMojo {
*/
private String argLine;
+ private Logger logger;
+
+ public void enableLogging(Logger logger) {
+ this.logger = logger;
+ }
+
protected boolean isDebug() {
return debug;
}
- protected void startJavaProcess(String description, String mainClass, String[] args, File workDir, ProcessControl processControl) throws MojoExecutionException, MojoFailureException {
+ private List/**/ buildClasspath(Set/**/ additionalArtifacts) throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException, ArtifactNotFoundException {
+ final Log log = getLog();
+
+ // We need dependencies in scope test. Since this is the largest scope, we don't need
+ // to do any additional filtering based on dependency scope.
+ Set projectDependencies = project.getArtifacts();
+
+ final Set artifacts = new HashSet(projectDependencies);
+
+ if (additionalArtifacts != null) {
+ for (Iterator it = additionalArtifacts.iterator(); it.hasNext(); ) {
+ Artifact a = (Artifact)it.next();
+ if (log.isDebugEnabled()) {
+ log.debug("Resolving artifact to be added to classpath: " + a);
+ }
+ ArtifactFilter filter = new ArtifactFilter() {
+ public boolean include(Artifact artifact) {
+ String id = artifact.getDependencyConflictId();
+ for (Iterator it = artifacts.iterator(); it.hasNext(); ) {
+ if (id.equals(((Artifact)it.next()).getDependencyConflictId())) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+ MavenProject p = projectBuilder.buildFromRepository(a, remoteArtifactRepositories, localRepository);
+ if (filter.include(p.getArtifact())) {
+ Set s = p.createArtifacts(artifactFactory, Artifact.SCOPE_RUNTIME, filter);
+ artifacts.addAll(artifactCollector.collect(s,
+ p.getArtifact(), p.getManagedVersionMap(),
+ localRepository, remoteArtifactRepositories, artifactMetadataSource, filter,
+ Collections.singletonList(new DebugResolutionListener(logger))).getArtifacts());
+ artifacts.add(p.getArtifact());
+ }
+ }
+ }
+
+ List/**/ cp = new ArrayList();
+ cp.add(project.getBuild().getTestOutputDirectory());
+ cp.add(project.getBuild().getOutputDirectory());
+ for (Iterator it = artifacts.iterator(); it.hasNext(); ) {
+ Artifact a = (Artifact)it.next();
+ if (a.getArtifactHandler().isAddedToClasspath()) {
+ if (a.getFile() == null) {
+ artifactResolver.resolve(a, remoteArtifactRepositories, localRepository);
+ }
+ cp.add(a.getFile());
+ }
+ }
+
+ return cp;
+ }
+
+ protected final void startJavaProcess(String description, String mainClass, Set additionalDependencies, String[] args, File workDir, ProcessControl processControl) throws MojoExecutionException, MojoFailureException {
Log log = getLog();
// Locate java executable to use
@@ -120,9 +241,9 @@ protected void startJavaProcess(String description, String mainClass, String[] a
// Get class path
List classpath;
try {
- classpath = project.getTestClasspathElements();
- } catch (DependencyResolutionRequiredException ex) {
- throw new MojoExecutionException("Unexpected exception", ex);
+ classpath = buildClasspath(additionalDependencies);
+ } catch (Exception ex) {
+ throw new MojoExecutionException("Failed to build classpath", ex);
}
if (log.isDebugEnabled()) {
log.debug("Class path elements: " + classpath);
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
index 286b57f03..3b95b18f0 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
@@ -72,6 +72,6 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
if (args != null) {
System.arraycopy(args, 0, vmArgs, 2, args.length);
}
- startJavaProcess(daemonClass, "org.apache.axis.testutils.daemon.Launcher", vmArgs, workDir, new DaemonProcessControl(controlPort));
+ startJavaProcess(daemonClass, "org.apache.axis.testutils.daemon.Launcher", null, vmArgs, workDir, new DaemonProcessControl(controlPort));
}
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
index b9e5993e1..33935f8b4 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
@@ -57,7 +57,7 @@ public class StartProcessMojo extends AbstractStartProcessMojo {
protected void doExecute() throws MojoExecutionException, MojoFailureException {
workDir.mkdirs();
- startJavaProcess(mainClass, mainClass, args != null ? args : new String[0], workDir, new ProcessControl() {
+ startJavaProcess(mainClass, mainClass, null, args != null ? args : new String[0], workDir, new ProcessControl() {
public void initializeProcess(Logger logger, Process process) throws Exception {
}
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
index e986eb0bd..9edf7a6eb 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartServerMojo.java
@@ -22,7 +22,9 @@
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -30,6 +32,7 @@
import org.apache.axis.client.AdminClient;
import org.apache.axis.deployment.wsdd.WSDDConstants;
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.logging.Log;
@@ -47,6 +50,13 @@
* @requiresDependencyResolution test
*/
public class StartServerMojo extends AbstractStartProcessMojo {
+ /**
+ * @parameter default-value="${plugin.version}"
+ * @required
+ * @readonly
+ */
+ private String axisVersion;
+
/**
* @parameter default-value="${project.build.directory}/axis-server"
* @required
@@ -214,9 +224,12 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
try {
AdminClient adminClient = new AdminClient(true);
adminClient.setTargetEndpointAddress(new URL("http://localhost:" + actualPort + "/axis/services/AdminService"));
+ Set additionalDependencies = new HashSet();
+ additionalDependencies.add(artifactFactory.createArtifact("org.apache.axis", "axis-standalone-server", axisVersion, Artifact.SCOPE_TEST, "jar"));
startJavaProcess(
"Server on port " + actualPort,
"org.apache.axis.server.standalone.StandaloneAxisServer",
+ additionalDependencies,
(String[])args.toArray(new String[args.size()]),
workDir,
new AxisServerProcessControl(actualPort, adminClient,
diff --git a/samples/addr-sample/pom.xml b/samples/addr-sample/pom.xml
index 4c859bfa6..6194ef949 100644
--- a/samples/addr-sample/pom.xml
+++ b/samples/addr-sample/pom.xml
@@ -38,12 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
- test
-
diff --git a/samples/attachments-sample/pom.xml b/samples/attachments-sample/pom.xml
index d4c434337..7cb2b3da6 100644
--- a/samples/attachments-sample/pom.xml
+++ b/samples/attachments-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/bidbuy-sample/pom.xml b/samples/bidbuy-sample/pom.xml
index 878bb3815..835d27fd4 100644
--- a/samples/bidbuy-sample/pom.xml
+++ b/samples/bidbuy-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/encoding-sample/pom.xml b/samples/encoding-sample/pom.xml
index d9edb8b7b..7821b8722 100644
--- a/samples/encoding-sample/pom.xml
+++ b/samples/encoding-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/faults-sample/pom.xml b/samples/faults-sample/pom.xml
index 2e07be096..ceaceca9e 100644
--- a/samples/faults-sample/pom.xml
+++ b/samples/faults-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/handler-sample/pom.xml b/samples/handler-sample/pom.xml
index 8e2f55979..ab4e7e5f7 100644
--- a/samples/handler-sample/pom.xml
+++ b/samples/handler-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/jaxrpc-sample/pom.xml b/samples/jaxrpc-sample/pom.xml
index c73141415..c4d2bd0bd 100644
--- a/samples/jaxrpc-sample/pom.xml
+++ b/samples/jaxrpc-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
- ${project.groupId}stock-sample
diff --git a/samples/message-sample/pom.xml b/samples/message-sample/pom.xml
index d14d8d562..9721884d5 100644
--- a/samples/message-sample/pom.xml
+++ b/samples/message-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/misc-sample/pom.xml b/samples/misc-sample/pom.xml
index 5e16a465e..7dd9b8477 100644
--- a/samples/misc-sample/pom.xml
+++ b/samples/misc-sample/pom.xml
@@ -38,11 +38,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/proxy-sample/pom.xml b/samples/proxy-sample/pom.xml
index b54470db9..964fd727f 100644
--- a/samples/proxy-sample/pom.xml
+++ b/samples/proxy-sample/pom.xml
@@ -49,11 +49,6 @@
${project.version}test
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
diff --git a/samples/stock-sample/pom.xml b/samples/stock-sample/pom.xml
index f6d1c8295..e924835a4 100644
--- a/samples/stock-sample/pom.xml
+++ b/samples/stock-sample/pom.xml
@@ -43,11 +43,6 @@
junittest
-
- ${project.groupId}
- axis-standalone-server
- ${project.version}
-
From 86a2ef39dfe3a5ebe73d6ce991243ed66e0a234a Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sun, 9 Dec 2012 12:08:15 +0000
Subject: [PATCH 007/133] * Use the Daemon interface defined by commons-daemon
instead of our own Daemon interface. * Improved the management of the child
process lifecycle.
---
.../axis/testutils/daemon/Launcher.java | 56 ----------
daemon-launcher/pom.xml | 50 +++++++++
.../tools/daemon/ControlConnectionReader.java | 76 +++++++++++++
.../axis/tools/daemon/DaemonContextImpl.java | 38 +++++++
.../apache/axis/tools/daemon/Launcher.java | 101 ++++++++++++++++++
.../axis/tools/daemon/LauncherException.java | 11 +-
maven/maven-axis-server-plugin/pom.xml | 17 +++
.../tools/maven/server/StartDaemonMojo.java | 14 ++-
pom.xml | 6 ++
samples/jms-sample/pom.xml | 5 +-
.../test/java/samples/jms/ActiveMQDaemon.java | 15 ++-
11 files changed, 322 insertions(+), 67 deletions(-)
delete mode 100644 axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
create mode 100644 daemon-launcher/pom.xml
create mode 100644 daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java
create mode 100644 daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java
create mode 100644 daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java
rename axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java => daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java (77%)
diff --git a/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java b/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
deleted file mode 100644
index 36bb2c6eb..000000000
--- a/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Launcher.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.axis.testutils.daemon;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-public class Launcher {
- public static void main(String[] args) throws Exception {
- String daemonClass = args[0];
- int controlPort = Integer.parseInt(args[1]);
- String[] daemonArgs = new String[args.length-2];
- System.arraycopy(args, 2, daemonArgs, 0, args.length-2);
- ServerSocket controlServerSocket = new ServerSocket();
- controlServerSocket.bind(new InetSocketAddress(InetAddress.getByName("localhost"), controlPort));
- Socket controlSocket = controlServerSocket.accept();
- BufferedReader controlIn = new BufferedReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII"));
- Writer controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII");
- Daemon daemon = (Daemon)Class.forName(daemonClass).newInstance();
- daemon.start(daemonArgs);
- controlOut.write("READY\r\n");
- controlOut.flush();
- String request = controlIn.readLine();
- if (request == null) {
- System.err.println("Control connection unexpectedly closed");
- } else if (request.equals("STOP")) {
- daemon.stop();
- controlOut.write("STOPPED\r\n");
- controlOut.flush();
- } else {
- System.err.println("Unexpected request: " + request);
- }
- }
-}
diff --git a/daemon-launcher/pom.xml b/daemon-launcher/pom.xml
new file mode 100644
index 000000000..20b600295
--- /dev/null
+++ b/daemon-launcher/pom.xml
@@ -0,0 +1,50 @@
+
+
+
+ 4.0.0
+
+ org.apache.axis
+ axis-project
+ 1.4.1-SNAPSHOT
+ ../pom.xml
+
+ daemon-launcher
+ Daemon Launcher
+
+ Used by maven-axis-server-plugin to launch a Commons Daemon implementation.
+
+
+
+ commons-daemon
+ commons-daemon
+
+
+
+
+
+ maven-site-plugin
+
+ true
+ true
+
+
+
+
+
diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java
new file mode 100644
index 000000000..da8f3417a
--- /dev/null
+++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/ControlConnectionReader.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.daemon;
+
+import java.io.BufferedReader;
+import java.io.Reader;
+import java.util.LinkedList;
+
+import org.apache.commons.daemon.Daemon;
+
+/**
+ * Reads messages from the control connection. The main purpose of this is to detect as soon as
+ * possible when the control connection is closed by the parent process and to terminate the child
+ * process if that is unexpected. To achieve this we need to read the messages eagerly and place
+ * them into a queue. In particular this covers the case where the child process has received a
+ * STOP message and {@link Daemon#stop()} or {@link Daemon#destroy()} hangs. In this case,
+ * if the parent process is terminated (or stops waiting for the STOPPED message and closes
+ * the control connection), we can stop the child process immediately.
+ *
+ * @author Andreas Veithen
+ */
+final class ControlConnectionReader implements Runnable {
+ private final BufferedReader in;
+ private final LinkedList queue = new LinkedList();
+ private boolean expectClose;
+
+ ControlConnectionReader(Reader in) {
+ this.in = new BufferedReader(in);
+ }
+
+ synchronized String awaitMessage() throws InterruptedException {
+ while (queue.isEmpty()) {
+ wait();
+ }
+ return (String)queue.removeFirst();
+ }
+
+ synchronized void expectClose() {
+ this.expectClose = true;
+ }
+
+ public void run() {
+ try {
+ String message;
+ while ((message = in.readLine()) != null) {
+ synchronized (this) {
+ queue.add(message);
+ notify();
+ }
+ }
+ if (!expectClose) {
+ System.err.println("Control connection unexpectedly closed; terminating.");
+ System.exit(1);
+ }
+ } catch (Throwable ex) {
+ ex.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java
new file mode 100644
index 000000000..414690a7e
--- /dev/null
+++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/DaemonContextImpl.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.daemon;
+
+import org.apache.commons.daemon.DaemonContext;
+import org.apache.commons.daemon.DaemonController;
+
+final class DaemonContextImpl implements DaemonContext {
+ private final String[] args;
+
+ public DaemonContextImpl(String[] args) {
+ this.args = args;
+ }
+
+ public DaemonController getController() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String[] getArguments() {
+ return args;
+ }
+}
diff --git a/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java
new file mode 100644
index 000000000..35c15f5b0
--- /dev/null
+++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/Launcher.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.tools.daemon;
+
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+
+import org.apache.commons.daemon.Daemon;
+import org.apache.commons.daemon.DaemonContext;
+
+/**
+ * Main class to launch and control a {@link Daemon} implementation. This class is typically
+ * executed in a child JVM and allows the parent process to control the lifecycle of the daemon
+ * instance. The main method takes the following arguments:
+ *
+ *
The class name of the {@link Daemon} implementation.
+ *
A TCP port number to use for the control connection.
+ *
+ * All remaining arguments are passed to the {@link Daemon} implementation.
+ *
+ * The class uses the following protocol to allow the parent process to control the lifecycle of the
+ * daemon:
+ *
+ *
The parent process spawns a new child JVM with this class as main class. It passes the class
+ * name of the {@link Daemon} implementation and the control port as arguments (see above).
+ *
The child process opens the specified TCP port and waits for the control connection to be
+ * established.
+ *
The parent process connects to the control port.
+ *
The child process {@link Daemon#init(DaemonContext) initializes} and {@link Daemon#start()
+ * starts} the daemon.
+ *
The child process sends a READY message over the control connection to the parent
+ * process.
+ *
When the parent process no longer needs the daemon, it sends a STOP message to the
+ * child process.
+ *
The child process {@link Daemon#stop() stops} and {@link Daemon#destroy() destroys} the
+ * daemon.
+ *
The child process sends a STOPPED message to the parent process, closes the control
+ * connection and terminates itself.
+ *
The parent process closes the control connection.
+ *
+ *
+ * @author Andreas Veithen
+ */
+public class Launcher {
+ public static void main(String[] args) {
+ try {
+ String daemonClass = args[0];
+ int controlPort = Integer.parseInt(args[1]);
+ String[] daemonArgs = new String[args.length-2];
+ System.arraycopy(args, 2, daemonArgs, 0, args.length-2);
+ ServerSocket controlServerSocket = new ServerSocket();
+ controlServerSocket.bind(new InetSocketAddress(InetAddress.getByName("localhost"), controlPort));
+ Socket controlSocket = controlServerSocket.accept();
+ // We only accept a single connection; therefore we can close the ServerSocket here
+ controlServerSocket.close();
+ ControlConnectionReader controlIn = new ControlConnectionReader(new InputStreamReader(controlSocket.getInputStream(), "ASCII"));
+ new Thread(controlIn).start();
+ Writer controlOut = new OutputStreamWriter(controlSocket.getOutputStream(), "ASCII");
+ Daemon daemon = (Daemon)Class.forName(daemonClass).newInstance();
+ daemon.init(new DaemonContextImpl(daemonArgs));
+ daemon.start();
+ controlOut.write("READY\r\n");
+ controlOut.flush();
+ String request = controlIn.awaitMessage();
+ if (request.equals("STOP")) {
+ daemon.stop();
+ daemon.destroy();
+ controlIn.expectClose();
+ controlOut.write("STOPPED\r\n");
+ controlOut.flush();
+ System.exit(0);
+ } else {
+ throw new LauncherException("Unexpected request: " + request);
+ }
+ } catch (Throwable ex) {
+ ex.printStackTrace();
+ System.exit(1);
+ }
+ }
+}
diff --git a/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java
similarity index 77%
rename from axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java
rename to daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java
index 4ac087046..5d177c273 100644
--- a/axis-testutils/src/main/java/org/apache/axis/testutils/daemon/Daemon.java
+++ b/daemon-launcher/src/main/java/org/apache/axis/tools/daemon/LauncherException.java
@@ -16,9 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axis.testutils.daemon;
+package org.apache.axis.tools.daemon;
-public interface Daemon {
- void start(String[] args) throws Exception;
- void stop() throws Exception;
+final class LauncherException extends Exception {
+ private static final long serialVersionUID = 9049901854635661634L;
+
+ public LauncherException(String msg) {
+ super(msg);
+ }
}
diff --git a/maven/maven-axis-server-plugin/pom.xml b/maven/maven-axis-server-plugin/pom.xml
index 95b149834..099c4eacb 100644
--- a/maven/maven-axis-server-plugin/pom.xml
+++ b/maven/maven-axis-server-plugin/pom.xml
@@ -60,6 +60,23 @@
maven-toolchain1.0
+
+
+
+ ${project.groupId}
+ daemon-launcher
+ ${project.version}
+ pom
+
+
+ ${project.groupId}
+ axis-standalone-server
+ ${project.version}
+ pom
+
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
index 3b95b18f0..fedcac2dd 100644
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
+++ b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartDaemonMojo.java
@@ -21,7 +21,10 @@
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@@ -33,6 +36,13 @@
* @requiresDependencyResolution test
*/
public class StartDaemonMojo extends AbstractStartProcessMojo {
+ /**
+ * @parameter default-value="${plugin.version}"
+ * @required
+ * @readonly
+ */
+ private String axisVersion;
+
/**
* The daemon class.
*
@@ -72,6 +82,8 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
if (args != null) {
System.arraycopy(args, 0, vmArgs, 2, args.length);
}
- startJavaProcess(daemonClass, "org.apache.axis.testutils.daemon.Launcher", null, vmArgs, workDir, new DaemonProcessControl(controlPort));
+ Set additionalDependencies = new HashSet();
+ additionalDependencies.add(artifactFactory.createArtifact("org.apache.axis", "daemon-launcher", axisVersion, Artifact.SCOPE_TEST, "jar"));
+ startJavaProcess(daemonClass, "org.apache.axis.tools.daemon.Launcher", additionalDependencies, vmArgs, workDir, new DaemonProcessControl(controlPort));
}
}
diff --git a/pom.xml b/pom.xml
index 3029a347a..43ec7afc5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -79,6 +79,7 @@
axis-testutilsaxis-toolsaxis-war
+ daemon-launcherdistributionintegrationinterop-mock
@@ -131,6 +132,11 @@
commons-lang2.6
+
+ commons-daemon
+ commons-daemon
+ 1.0.10
+
diff --git a/samples/jms-sample/pom.xml b/samples/jms-sample/pom.xml
index b63d9e3f0..485a45caa 100644
--- a/samples/jms-sample/pom.xml
+++ b/samples/jms-sample/pom.xml
@@ -54,9 +54,8 @@
test
- ${project.groupId}
- axis-testutils
- ${project.version}
+ commons-daemon
+ commons-daemontest
diff --git a/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
index ea790354e..db1978294 100644
--- a/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
+++ b/samples/jms-sample/src/test/java/samples/jms/ActiveMQDaemon.java
@@ -20,17 +20,26 @@
import org.apache.activemq.broker.BrokerFactory;
import org.apache.activemq.broker.BrokerService;
-import org.apache.axis.testutils.daemon.Daemon;
+import org.apache.commons.daemon.Daemon;
+import org.apache.commons.daemon.DaemonContext;
+import org.apache.commons.daemon.DaemonInitException;
public class ActiveMQDaemon implements Daemon {
private BrokerService broker;
- public void start(String[] args) throws Exception {
- broker = BrokerFactory.createBroker("broker:(tcp://localhost:" + args[0] + ")?useJmx=false&persistent=false");
+ public void init(DaemonContext context) throws DaemonInitException, Exception {
+ broker = BrokerFactory.createBroker("broker:(tcp://localhost:" + context.getArguments()[0] + ")?useJmx=false&persistent=false");
+ }
+
+ public void start() throws Exception {
broker.start();
}
public void stop() throws Exception {
broker.stop();
}
+
+ public void destroy() {
+ broker = null;
+ }
}
From 00847d6e706ce200029bc271afe1dde5b16198c2 Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sun, 9 Dec 2012 13:32:22 +0000
Subject: [PATCH 008/133] Removed the start-process goal and always use a
Daemon implementation. This ensures that the process is fully initialized
when the integration tests start.
---
.../tools/maven/server/StartProcessMojo.java | 69 -------------------
samples/transport-sample/pom.xml | 9 ++-
.../samples/transport/tcp/TCPListener.java | 6 +-
.../transport/tcp/TCPListenerDaemon.java | 43 ++++++++++++
4 files changed, 55 insertions(+), 72 deletions(-)
delete mode 100644 maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
create mode 100644 samples/transport-sample/src/test/java/samples/transport/tcp/TCPListenerDaemon.java
diff --git a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java b/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
deleted file mode 100644
index 33935f8b4..000000000
--- a/maven/maven-axis-server-plugin/src/main/java/org/apache/axis/tools/maven/server/StartProcessMojo.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.axis.tools.maven.server;
-
-import java.io.File;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * Start an arbitrary Java process.
- *
- * @goal start-process
- * @phase pre-integration-test
- * @requiresDependencyResolution test
- */
-public class StartProcessMojo extends AbstractStartProcessMojo {
- /**
- * The main class.
- *
- * @parameter
- * @required
- */
- private String mainClass;
-
- /**
- * The arguments to be passed to the main class.
- *
- * @parameter
- */
- private String[] args;
-
- /**
- * The working directory for the process.
- *
- * @parameter default-value="${project.build.directory}/work"
- * @required
- */
- private File workDir;
-
- protected void doExecute() throws MojoExecutionException, MojoFailureException {
- workDir.mkdirs();
- startJavaProcess(mainClass, mainClass, null, args != null ? args : new String[0], workDir, new ProcessControl() {
- public void initializeProcess(Logger logger, Process process) throws Exception {
- }
-
- public int shutdownProcess(Logger logger) throws Exception {
- return RUNNING;
- }
- });
- }
-}
diff --git a/samples/transport-sample/pom.xml b/samples/transport-sample/pom.xml
index 8d1b15524..591c975ad 100644
--- a/samples/transport-sample/pom.xml
+++ b/samples/transport-sample/pom.xml
@@ -44,6 +44,11 @@
${project.version}test
+
+ commons-daemon
+ commons-daemon
+ test
+
@@ -84,10 +89,10 @@
start-server
- start-process
+ start-daemon
- samples.transport.tcp.TCPListener
+ samples.transport.tcp.TCPListenerDaemon-p${test.functional.TCPListenerPort}
diff --git a/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java b/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
index 35b517d4c..9035184df 100644
--- a/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
+++ b/samples/transport-sample/src/main/java/samples/transport/tcp/TCPListener.java
@@ -59,7 +59,7 @@ public class TCPListener implements Runnable {
private AxisEngine engine = null ;
// becomes true when we want to quit
- private boolean done = false;
+ private volatile boolean done = false;
static final String wsdd =
"
Date: Sun, 9 Dec 2012 17:22:05 +0000
Subject: [PATCH 009/133] Added support for the deprecated languageSpecificType
attribute.
---
.../axis/model/wsdd/WSDDExtendedMetaData.java | 37 ++++++++++++
.../org/apache/axis/model/wsdd/WSDDUtil.java | 58 ++++++++++++++++++-
.../axis/model/wsdd/DeprecationTest.java | 35 +++++++++++
.../axis/model/wsdd/languageSpecificType.wsdd | 8 +++
4 files changed, 136 insertions(+), 2 deletions(-)
create mode 100644 axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java
create mode 100644 axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java
create mode 100644 axis-model/src/test/resources/org/apache/axis/model/wsdd/languageSpecificType.wsdd
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java
new file mode 100644
index 000000000..1f5f4726e
--- /dev/null
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDExtendedMetaData.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.model.wsdd;
+
+import org.apache.axis.model.wsdd.impl.WSDDPackageImpl;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.BasicExtendedMetaData;
+
+final class WSDDExtendedMetaData extends BasicExtendedMetaData {
+ private static final EClass mapping = WSDDPackageImpl.eINSTANCE.getMapping();
+
+ public EStructuralFeature getAttribute(EClass eClass, String namespace, String name) {
+ if (mapping.isSuperTypeOf(eClass) && namespace == null && name.equals("languageSpecificType")) {
+ // TODO: emit warning
+ return mapping.getEStructuralFeature(WSDDPackageImpl.MAPPING__TYPE);
+ } else {
+ return super.getAttribute(eClass, namespace, name);
+ }
+ }
+}
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java
index 47e5e6f8f..86d71e57c 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDUtil.java
@@ -19,31 +19,85 @@
package org.apache.axis.model.wsdd;
import java.io.IOException;
+import java.io.InputStream;
import java.io.OutputStream;
import java.io.Writer;
+import java.net.URL;
+import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.configuration.DefaultConfiguration;
import org.apache.axis.model.util.AxisXMLResource;
import org.apache.axis.model.wsdd.impl.WSDDPackageImpl;
-import org.eclipse.emf.ecore.util.ExtendedMetaData;
+import org.apache.commons.logging.Log;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
import org.xml.sax.InputSource;
public final class WSDDUtil {
+ private static final Log log = LogFactory.getLog(WSDDUtil.class.getName());
+
private WSDDUtil() {}
public static Deployment load(InputSource is) throws IOException {
WSDDPackageImpl.eINSTANCE.eClass();
AxisXMLResource resource = new AxisXMLResource();
Map options = new HashMap();
- options.put(XMLResource.OPTION_EXTENDED_META_DATA, ExtendedMetaData.INSTANCE);
+ options.put(XMLResource.OPTION_EXTENDED_META_DATA, new WSDDExtendedMetaData());
options.put(AxisXMLResource.OPTION_IGNORE_NAMESPACE_FOR_UNQUALIFIED_QNAME, WSDDPackageImpl.eNS_URI);
resource.load(is, options);
return (Deployment)resource.getContents().get(0);
}
+ /**
+ * Load the default Axis configuration. This method implements the same algorithm as
+ * {@link DefaultConfiguration}.
+ *
+ * @param cl
+ * the class loader to load the configuration from
+ * @param type
+ * the type of configuration (client or server)
+ * @return the default configuration
+ * @throws IOException
+ */
+ public static Deployment buildDefaultConfiguration(ClassLoader cl, String type) throws IOException {
+ // Load the base configuration
+ String resourceName = "org/apache/axis/" + type + "/" + type + "-config.wsdd";
+ InputStream in = cl.getResourceAsStream(resourceName);
+ if (in == null) {
+ throw new IOException("Resource " + resourceName + " not found");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Loading resource " + resourceName);
+ }
+ Deployment deployment;
+ try {
+ deployment = WSDDUtil.load(new InputSource(in));
+ } finally {
+ in.close();
+ }
+
+ // Discover and load additional default configuration fragments
+ resourceName = "META-INF/axis/default-" + type + "-config.wsdd";
+ Enumeration resources = cl.getResources(resourceName);
+ while (resources.hasMoreElements()) {
+ URL url = (URL)resources.nextElement();
+ if (log.isDebugEnabled()) {
+ log.debug("Loading " + url);
+ }
+ in = url.openStream();
+ try {
+ deployment.merge(WSDDUtil.load(new InputSource(in)));
+ } finally {
+ in.close();
+ }
+ }
+
+ return deployment;
+ }
+
public static void save(Deployment deployment, OutputStream out) throws IOException {
AxisXMLResource resource = new AxisXMLResource();
XMLProcessor processor = new XMLProcessor();
diff --git a/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java b/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java
new file mode 100644
index 000000000..cd805b4c4
--- /dev/null
+++ b/axis-model/src/test/java/org/apache/axis/model/wsdd/DeprecationTest.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axis.model.wsdd;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.deployment.wsdd.WSDDConstants;
+import org.xml.sax.InputSource;
+
+public class DeprecationTest extends TestCase {
+ public void testLanguageSpecificType() throws Exception {
+ Deployment deployment = WSDDUtil.load(new InputSource(DeprecationTest.class.getResource("languageSpecificType.wsdd").toString()));
+ Service service = (Service)deployment.getServices().get(0);
+ BeanMapping beanMapping = (BeanMapping)service.getBeanMappings().get(0);
+ assertEquals(new QName(WSDDConstants.URI_WSDD_JAVA, "test.rpc.Bean"), beanMapping.getType());
+ }
+}
diff --git a/axis-model/src/test/resources/org/apache/axis/model/wsdd/languageSpecificType.wsdd b/axis-model/src/test/resources/org/apache/axis/model/wsdd/languageSpecificType.wsdd
new file mode 100644
index 000000000..13fcaf49f
--- /dev/null
+++ b/axis-model/src/test/resources/org/apache/axis/model/wsdd/languageSpecificType.wsdd
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
From c8c4a20860f206d3be4e9883d1cd245d795d6bff Mon Sep 17 00:00:00 2001
From: Andreas Veithen
Date: Sun, 9 Dec 2012 18:17:44 +0000
Subject: [PATCH 010/133] Added support for globally defined type mappings.
---
axis-model/model/wsdd.ecore | 54 +--
.../apache/axis/model/wsdd/Deployment.java | 2 +-
.../axis/model/wsdd/MappingContainer.java | 77 ++++
.../org/apache/axis/model/wsdd/Service.java | 53 +--
.../apache/axis/model/wsdd/WSDDFactory.java | 9 +
.../axis/model/wsdd/impl/DeploymentImpl.java | 4 +-
.../model/wsdd/impl/MappingContainerImpl.java | 223 +++++++++++
.../axis/model/wsdd/impl/ServiceImpl.java | 171 +++++----
.../axis/model/wsdd/impl/WSDDFactoryImpl.java | 11 +
.../axis/model/wsdd/impl/WSDDPackageImpl.java | 363 ++++++++++++------
axis-model/src/test/wsdd/bidbuy.wsdd | 23 ++
11 files changed, 713 insertions(+), 277 deletions(-)
create mode 100644 axis-model/src/main/java/org/apache/axis/model/wsdd/MappingContainer.java
create mode 100644 axis-model/src/main/java/org/apache/axis/model/wsdd/impl/MappingContainerImpl.java
create mode 100644 axis-model/src/test/wsdd/bidbuy.wsdd
diff --git a/axis-model/model/wsdd.ecore b/axis-model/model/wsdd.ecore
index b45cc822f..42df32adb 100644
--- a/axis-model/model/wsdd.ecore
+++ b/axis-model/model/wsdd.ecore
@@ -25,6 +25,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -118,7 +144,7 @@
-
+
@@ -139,32 +165,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/Deployment.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/Deployment.java
index 827362b8a..3efe9fb8d 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/Deployment.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/Deployment.java
@@ -27,7 +27,7 @@
* @model extendedMetaData="name='deployment' kind='element'"
* @generated
*/
-public interface Deployment {
+public interface Deployment extends MappingContainer {
/**
* Returns the value of the 'Name' attribute.
*
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/MappingContainer.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/MappingContainer.java
new file mode 100644
index 000000000..93f83221e
--- /dev/null
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/MappingContainer.java
@@ -0,0 +1,77 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.apache.axis.model.wsdd;
+
+import java.util.List;
+
+/**
+ *
+ * A representation of the model object 'Mapping Container'.
+ *
+ *
+ *
+ * The following features are supported:
+ *
+ *
{@link org.apache.axis.model.wsdd.MappingContainer#getTypeMappings Type Mappings}
+ *
+ * @model
+ * @generated
+ */
+public interface MappingContainer {
+ /**
+ * Returns the value of the 'Type Mappings' containment reference list.
+ * The list contents are of type {@link org.apache.axis.model.wsdd.TypeMapping}.
+ *
+ *
+ * If the meaning of the 'Type Mappings' containment reference list isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Type Mappings' containment reference list.
+ * @model type="org.apache.axis.model.wsdd.TypeMapping" containment="true"
+ * extendedMetaData="kind='element' name='typeMapping' namespace='##targetNamespace'"
+ * @generated
+ */
+ List getTypeMappings();
+
+ /**
+ * Returns the value of the 'Bean Mappings' containment reference list.
+ * The list contents are of type {@link org.apache.axis.model.wsdd.BeanMapping}.
+ *
+ *
+ * If the meaning of the 'Bean Mappings' containment reference list isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Bean Mappings' containment reference list.
+ * @model type="org.apache.axis.model.wsdd.BeanMapping" containment="true"
+ * extendedMetaData="kind='element' name='beanMapping' namespace='##targetNamespace'"
+ * @generated
+ */
+ List getBeanMappings();
+
+ /**
+ * Returns the value of the 'Array Mappings' containment reference list.
+ * The list contents are of type {@link org.apache.axis.model.wsdd.ArrayMapping}.
+ *
+ *
+ * If the meaning of the 'Array Mappings' containment reference list isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Array Mappings' containment reference list.
+ * @model type="org.apache.axis.model.wsdd.ArrayMapping" containment="true"
+ * extendedMetaData="kind='element' name='arrayMapping' namespace='##targetNamespace'"
+ * @generated
+ */
+ List getArrayMappings();
+
+} // MappingContainer
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/Service.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/Service.java
index e15265256..3146ae25c 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/Service.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/Service.java
@@ -25,16 +25,13 @@
*
*
*
*
* @model
* @generated
*/
-public interface Service extends DeployableItem {
+public interface Service extends DeployableItem, MappingContainer {
/**
* Returns the value of the 'Name' attribute.
*
@@ -166,52 +163,4 @@ public interface Service extends DeployableItem {
*/
List getOperations();
- /**
- * Returns the value of the 'Type Mappings' containment reference list.
- * The list contents are of type {@link org.apache.axis.model.wsdd.TypeMapping}.
- *
- *
- * If the meaning of the 'Type Mappings' containment reference list isn't clear,
- * there really should be more of a description here...
- *
- *
- * @return the value of the 'Type Mappings' containment reference list.
- * @model type="org.apache.axis.model.wsdd.TypeMapping" containment="true"
- * extendedMetaData="kind='element' name='typeMapping' namespace='##targetNamespace'"
- * @generated
- */
- List getTypeMappings();
-
- /**
- * Returns the value of the 'Bean Mappings' containment reference list.
- * The list contents are of type {@link org.apache.axis.model.wsdd.BeanMapping}.
- *
- *
- * If the meaning of the 'Bean Mappings' containment reference list isn't clear,
- * there really should be more of a description here...
- *
- *
- * @return the value of the 'Bean Mappings' containment reference list.
- * @model type="org.apache.axis.model.wsdd.BeanMapping" containment="true"
- * extendedMetaData="kind='element' name='beanMapping' namespace='##targetNamespace'"
- * @generated
- */
- List getBeanMappings();
-
- /**
- * Returns the value of the 'Array Mappings' containment reference list.
- * The list contents are of type {@link org.apache.axis.model.wsdd.ArrayMapping}.
- *
- *
- * If the meaning of the 'Array Mappings' containment reference list isn't clear,
- * there really should be more of a description here...
- *
- *
- * @return the value of the 'Array Mappings' containment reference list.
- * @model type="org.apache.axis.model.wsdd.ArrayMapping" containment="true"
- * extendedMetaData="kind='element' name='arrayMapping' namespace='##targetNamespace'"
- * @generated
- */
- List getArrayMappings();
-
} // Service
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDFactory.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDFactory.java
index aea67e665..466fb79a0 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDFactory.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/WSDDFactory.java
@@ -66,6 +66,15 @@ public interface WSDDFactory {
*/
BeanMapping createBeanMapping();
+ /**
+ * Returns a new object of class 'Mapping Container'.
+ *
+ *
+ * @return a new object of class 'Mapping Container'.
+ * @generated
+ */
+ MappingContainer createMappingContainer();
+
/**
* Returns a new object of class 'Operation Parameter'.
*
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/DeploymentImpl.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/DeploymentImpl.java
index 6f6452a19..aa4fae9d9 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/DeploymentImpl.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/DeploymentImpl.java
@@ -22,8 +22,6 @@
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
import org.eclipse.emf.ecore.util.BasicInternalEList;
import org.eclipse.emf.ecore.util.InternalEList;
@@ -44,7 +42,7 @@
*
* @generated
*/
-public class DeploymentImpl extends EObjectImpl implements Deployment {
+public class DeploymentImpl extends MappingContainerImpl implements Deployment {
/**
* The default value of the '{@link #getName() Name}' attribute.
*
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/MappingContainerImpl.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/MappingContainerImpl.java
new file mode 100644
index 000000000..ec705b905
--- /dev/null
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/MappingContainerImpl.java
@@ -0,0 +1,223 @@
+/**
+ *
+ *
+ *
+ * $Id$
+ */
+package org.apache.axis.model.wsdd.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.axis.model.wsdd.ArrayMapping;
+import org.apache.axis.model.wsdd.BeanMapping;
+import org.apache.axis.model.wsdd.MappingContainer;
+import org.apache.axis.model.wsdd.TypeMapping;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.ecore.util.BasicInternalEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+/**
+ *
+ * An implementation of the model object 'Mapping Container'.
+ *
+ *
+ * The following features are implemented:
+ *
+ *
{@link org.apache.axis.model.wsdd.impl.MappingContainerImpl#getTypeMappings Type Mappings}
*
@@ -26,6 +29,56 @@
*/
public interface Chain {
+ /**
+ * Returns the value of the 'Name' attribute.
+ *
+ *
+ * If the meaning of the 'Name' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Name' attribute.
+ * @see #setName(String)
+ * @model
+ * @generated
+ */
+ String getName();
+
+ /**
+ * Sets the value of the '{@link org.apache.axis.model.wsdd.Chain#getName Name}' attribute.
+ *
+ *
+ * @param value the new value of the 'Name' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(String value);
+
+ /**
+ * Returns the value of the 'Type' attribute.
+ *
+ *
+ * If the meaning of the 'Type' attribute isn't clear,
+ * there really should be more of a description here...
+ *
+ *
+ * @return the value of the 'Type' attribute.
+ * @see #setType(QName)
+ * @model dataType="org.apache.axis.model.xml.QName"
+ * @generated
+ */
+ QName getType();
+
+ /**
+ * Sets the value of the '{@link org.apache.axis.model.wsdd.Chain#getType Type}' attribute.
+ *
+ *
+ * @param value the new value of the 'Type' attribute.
+ * @see #getType()
+ * @generated
+ */
+ void setType(QName value);
+
/**
* Returns the value of the 'Handlers' containment reference list.
* The list contents are of type {@link org.apache.axis.model.wsdd.Handler}.
diff --git a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/ChainImpl.java b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/ChainImpl.java
index 93b3fad1c..76afa77b4 100644
--- a/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/ChainImpl.java
+++ b/axis-model/src/main/java/org/apache/axis/model/wsdd/impl/ChainImpl.java
@@ -8,6 +8,7 @@
import java.util.Collection;
import java.util.List;
+import javax.xml.namespace.QName;
import org.apache.axis.model.wsdd.Chain;
import org.apache.axis.model.wsdd.Handler;
@@ -27,6 +28,8 @@
*