From 074cc3cff2f00457318bd322a6bd58f65686ae5c Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 16 Nov 2010 10:40:14 +0000 Subject: Tag for 1.6.1-RC2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035578 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/anotherpackage/BBean.java | 42 +++ .../src/main/java/anotherpackage/CBean.java | 45 +++ .../wsdlgen/src/main/java/helloworld/ABean.java | 55 ++++ .../main/java/helloworld/HelloWorldClientImpl.java | 68 ++++ .../src/main/java/helloworld/HelloWorldImpl.java | 69 +++++ .../main/java/helloworld/HelloWorldService.java | 45 +++ .../src/main/java/helloworld/package-info.java | 20 ++ .../src/main/java/yetanotherpackage/DBean.java | 53 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++ .../wsdlgen/src/main/resources/definitions.xml | 66 ++++ .../src/main/resources/helloworld.composite | 71 +++++ .../src/main/resources/helloworld1.composite | 43 +++ .../wsdl/HelloWorldService_TuscanyGen.wsdl | 343 +++++++++++++++++++++ .../java/helloworld/HttpTransportTestCase.java | 122 ++++++++ .../test/java/helloworld/JmsTransportTestCase.java | 121 ++++++++ .../test/resources/wsdl/HelloWorldImplService.wsdl | 137 ++++++++ .../wsdl/HelloWorldImplService_schema1.xsd | 14 + .../wsdl/HelloWorldImplService_schema2.xsd | 124 ++++++++ .../itest/wsdlgen/src/test/resources/wsdl/README | 6 + 19 files changed, 1467 insertions(+) create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/BBean.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/CBean.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/ABean.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/package-info.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/yetanotherpackage/DBean.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/definitions.xml create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld.composite create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld1.composite create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/JmsTransportTestCase.java create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema1.xsd create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd create mode 100644 sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/README (limited to 'sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src') diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/BBean.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/BBean.java new file mode 100644 index 0000000000..f9578a5f92 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/BBean.java @@ -0,0 +1,42 @@ +/* + * 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 anotherpackage; + +public class BBean { + + protected String field1; + protected String field2; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + + public String getField2() { + return field2; + } + + public void setField2(String field2) { + this.field2 = field2; + } +} + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/CBean.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/CBean.java new file mode 100644 index 0000000000..b1b3801210 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/anotherpackage/CBean.java @@ -0,0 +1,45 @@ +/* + * 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 anotherpackage; + +import javax.xml.bind.annotation.XmlType; + +@XmlType(name="") +public class CBean { + + protected String field1; + protected String field2; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + + public String getField2() { + return field2; + } + + public void setField2(String field2) { + this.field2 = field2; + } +} + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/ABean.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/ABean.java new file mode 100644 index 0000000000..bcfa0f8be7 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/ABean.java @@ -0,0 +1,55 @@ +/* + * 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 helloworld; + +import anotherpackage.BBean; + + + +public class ABean { + + protected String field1; + protected String field2; + protected BBean field3; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + + public String getField2() { + return field2; + } + + public void setField2(String field2) { + this.field2 = field2; + } + + public BBean getField3() { + return field3; + } + + public void setField3(BBean field3) { + this.field3 = field3; + } +} + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java new file mode 100644 index 0000000000..04fbe6934a --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldClientImpl.java @@ -0,0 +1,68 @@ +/* + * 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 helloworld; + + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +import yetanotherpackage.DBean; + +import anotherpackage.BBean; +import anotherpackage.CBean; + +/** + * This class implements the HelloWorld service. + */ +@Service(HelloWorldService.class) +public class HelloWorldClientImpl implements HelloWorldService { + + @Reference + protected HelloWorldService hwService; + + public String getGreetings(String name) { + return "Hello " + hwService.getGreetings(name); + } + + public String getGreetingsBean(ABean bean){ + return "Hello " + hwService.getGreetingsBean(bean); + } + + public String getGreetingsBeanArray(ABean[] bean){ + return "Hello " + hwService.getGreetingsBeanArray(bean); + } + + /* + public String getGreetingsBeanVector(Vector bean){ + return "Hello " + bean.get(0).getField1() + " " + bean.get(0).getField2(); + } + */ + + public String getGreetingsBBean(BBean bean){ + return "Hello " + hwService.getGreetingsBBean(bean); + } + + public String getGreetingsCBean(CBean bean){ + return "Hello " + hwService.getGreetingsCBean(bean); + } + + public String getGreetingsDBean(DBean bean){ + return "Hello " + hwService.getGreetingsDBean(bean); + } +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java new file mode 100644 index 0000000000..a92a819aaf --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldImpl.java @@ -0,0 +1,69 @@ +/* + * 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 helloworld; + +import javax.jws.WebService; + +import org.osoa.sca.annotations.Service; + +import yetanotherpackage.DBean; + +import anotherpackage.BBean; +import anotherpackage.CBean; + +/** + * This class implements the HelloWorld service. + */ +@WebService +@Service(HelloWorldService.class) +public class HelloWorldImpl implements HelloWorldService { + + public String getGreetings(String name) { + return "Hello " + name; + } + + public String getGreetingsBean(ABean bean) { + return "Hello " + bean.getField1() + " " + bean.getField2() + + bean.getField3().getField1() + " " + + bean.getField3().getField2(); + } + + public String getGreetingsBeanArray(ABean[] bean) { + return "Hello " + bean[0].getField1() + " " + bean[0].getField2(); + } + + /* + * public String getGreetingsBeanVector(Vector bean){ return "Hello " + * + bean.get(0).getField1() + " " + bean.get(0).getField2(); } + */ + + public String getGreetingsBBean(BBean bean) { + return "Hello " + bean.getField1() + " " + bean.getField2(); + } + + public String getGreetingsCBean(CBean bean) { + return "Hello " + bean.getField1() + " " + bean.getField2(); + } + + public String getGreetingsDBean(DBean bean) { + return "Hello " + bean.getField1() + " " + bean.getField2() + " " + + bean.getField3().getField1() + " " + + bean.getField3().getField2(); + } +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java new file mode 100644 index 0000000000..6b0425d473 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/HelloWorldService.java @@ -0,0 +1,45 @@ +/* + * 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 helloworld; + +import javax.jws.WebService; + +import org.osoa.sca.annotations.Remotable; + +import yetanotherpackage.DBean; + +import anotherpackage.BBean; +import anotherpackage.CBean; + +/** + * This is the business interface of the HelloWorld greetings service. + */ +@WebService +@Remotable +public interface HelloWorldService { + + public String getGreetings(String name); + public String getGreetingsBean(ABean bean); + public String getGreetingsBeanArray(ABean[] bean); + //public String getGreetingsBeanVector(Vector bean); + public String getGreetingsBBean(BBean bean); + public String getGreetingsCBean(CBean bean); + public String getGreetingsDBean(DBean bean); +} + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/package-info.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/package-info.java new file mode 100644 index 0000000000..45bc473320 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/helloworld/package-info.java @@ -0,0 +1,20 @@ +/* + * 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. + */ +@javax.xml.bind.annotation.XmlSchema(namespace="http://test") +package helloworld; diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/yetanotherpackage/DBean.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/yetanotherpackage/DBean.java new file mode 100644 index 0000000000..cee893d678 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/java/yetanotherpackage/DBean.java @@ -0,0 +1,53 @@ +/* + * 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 yetanotherpackage; + +import anotherpackage.BBean; + +public class DBean { + + protected String field1; + protected String field2; + protected BBean field3; + + public String getField1() { + return field1; + } + + public void setField1(String field1) { + this.field1 = field1; + } + + public String getField2() { + return field2; + } + + public void setField2(String field2) { + this.field2 = field2; + } + + public BBean getField3() { + return field3; + } + + public void setField3(BBean field3) { + this.field3 = field3; + } +} + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/META-INF/sca-contribution.xml b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..c7797931d2 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/definitions.xml b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/definitions.xml new file mode 100644 index 0000000000..e1b316dcc6 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/definitions.xml @@ -0,0 +1,66 @@ + + + + + + + The general intent that a transport is available over which SOAP messages flow + + + + + + A JMS transport is required + + + + + + An HTTP transport is required + + + + + + + An HTTPS transport is required + + + + + + + org.apache.activemq.jndi.ActiveMQInitialContextFactory + tcp://localhost:61982 + QueueConnectionFactory + + + + + \ No newline at end of file diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld.composite b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld.composite new file mode 100644 index 0000000000..2b5d51b71e --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld.composite @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld1.composite b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld1.composite new file mode 100644 index 0000000000..3bd84f34d9 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/helloworld1.composite @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl new file mode 100644 index 0000000000..185aa2c649 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/main/resources/wsdl/HelloWorldService_TuscanyGen.wsdl @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java new file mode 100644 index 0000000000..22f154fbf3 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/HttpTransportTestCase.java @@ -0,0 +1,122 @@ +/* + * 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 helloworld; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.Service; + +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +import yetanotherpackage.DBean; + +import anotherpackage.BBean; + +/** + * Tests that the helloworld server is available + */ +public class HttpTransportTestCase{ + + private SCADomain scaDomain; + + @Before + public void startServer() throws Exception { + scaDomain = SCADomain.newInstance("helloworld1.composite"); + } + + @Ignore + @Test + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @Test + public void testComponent1SCA() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent1/HelloWorldService"); + assertNotNull(helloWorldService); + + HelloWorldService helloWorldClient = scaDomain.getService(HelloWorldService.class, "HelloWorldClientComponent1/HelloWorldService"); + assertNotNull(helloWorldClient); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + assertEquals("Hello Hello Smith", helloWorldClient.getGreetings("Smith")); + + BBean bbean = new BBean(); + bbean.setField1("1"); + bbean.setField2("2"); + + DBean abean = new DBean(); + abean.setField1("3"); + abean.setField2("4"); + abean.setField3(bbean); + + assertEquals("Hello Hello 3 4 1 2", helloWorldClient.getGreetingsDBean(abean)); + } + + @Test + public void testComponent1JAXWS() throws IOException { + + // talk to the service using JAXWS with WSDL generated from this service used wsgen + // the idea here is to demonstrate that the service is providing a JAXWS compliant + // interface + QName serviceName = new QName("http://helloworld/", "HelloWorldImplService"); + URL wsdlLocation = this.getClass().getClassLoader().getResource("wsdl/HelloWorldImplService.wsdl"); + Service webService = Service.create( wsdlLocation, serviceName ); + HelloWorldService wsProxy = (HelloWorldService) webService.getPort(HelloWorldService.class); + + assertEquals("Hello Fred", wsProxy.getGreetings("Fred")); + + BBean bbean = new BBean(); + bbean.setField1("1"); + bbean.setField2("2"); + + DBean abean = new DBean(); + abean.setField1("3"); + abean.setField2("4"); + abean.setField3(bbean); + + assertEquals("Hello 3 4 1 2", wsProxy.getGreetingsDBean(abean)); + + // repeat the JAXWS call with WSDL generated by tuscany + + } + + @After + public void stopServer() throws Exception { + if (scaDomain != null) { + scaDomain.close(); + } + } + +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/JmsTransportTestCase.java b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/JmsTransportTestCase.java new file mode 100644 index 0000000000..fe74ef1a3d --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/java/helloworld/JmsTransportTestCase.java @@ -0,0 +1,121 @@ +/* + * 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 helloworld; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; + +import java.io.IOException; + +import org.apache.activemq.broker.BrokerService; +import org.apache.tuscany.sca.host.embedded.SCADomain; +import org.junit.After; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Tests that the helloworld server is available + */ +public class JmsTransportTestCase{ + + private SCADomain scaDomain; + private BrokerService jmsBroker; + + @Before + public void startServer() throws Exception { + startBroker(); + scaDomain = SCADomain.newInstance("helloworld.composite"); + } + + protected void startBroker() throws Exception { + jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:51293"); + jmsBroker.start(); + } + + //@Ignore + @Test + public void testComponent1() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent1/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + //@Ignore + @Test + public void testComponent2() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent2/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Ignore + @Test + public void testComponent3() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent3/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Ignore + @Test + public void testComponent4() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent4/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Ignore + @Test + public void testComponent5() throws IOException { + HelloWorldService helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent5/HelloWorldService"); + assertNotNull(helloWorldService); + + assertEquals("Hello Smith", helloWorldService.getGreetings("Smith")); + } + + @Ignore + @Test + public void testWaitForInput() { + System.out.println("Press a key to end"); + try { + System.in.read(); + } catch (Exception ex) { + } + System.out.println("Shutting down"); + } + + @After + public void stopServer() throws Exception { + if (scaDomain != null) { + scaDomain.close(); + } + if (jmsBroker != null) { + jmsBroker.stop(); + } + } + +} diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl new file mode 100644 index 0000000000..5fa0d565b1 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService.wsdl @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema1.xsd b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema1.xsd new file mode 100644 index 0000000000..70de7a05ae --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema1.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd new file mode 100644 index 0000000000..446492c371 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/HelloWorldImplService_schema2.xsd @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/README b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/README new file mode 100644 index 0000000000..f0092fbfb1 --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/itest/wsdlgen/src/test/resources/wsdl/README @@ -0,0 +1,6 @@ +These are files generated by JAXWS wsgen. The maven pom.xml is configured to generate +them to target/jaxws/wsgen/wsdl. These files are copied manually from there to here +and the .wsdl file is hand edited to + +1/ add the right service port location +2/ change the port type name to HelloWorldService -- cgit v1.2.3