From 2f187c12e2ceceb61ca2745463fcd7fbbb438b72 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:39:43 +0000 Subject: Rename beta3 tag to final name git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245035 13f79535-47bb-0310-9956-ffa450edef68 --- .../tomcat/testing/download-tomcat/pom.xml | 82 ++++++++++++ .../testing/helloworld-client-webapp/pom.xml | 47 +++++++ .../src/main/java/testing/HelloworldService.java | 30 +++++ .../src/main/webapp/WEB-INF/web.composite | 30 +++++ .../src/main/webapp/WEB-INF/web.xml | 31 +++++ .../src/main/webapp/hello.jsp | 36 +++++ .../helloworld-reference-contribution/pom.xml | 45 +++++++ .../src/main/java/testing/HelloworldRefImpl.java | 38 ++++++ .../src/main/java/testing/HelloworldService.java | 28 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++++ .../src/main/resources/helloworld.composite | 29 ++++ .../testing/helloworld-scaclient-jsp/pom.xml | 48 +++++++ .../src/main/java/testing/HelloworldService.java | 28 ++++ .../src/main/webapp/META-INF/sca-contribution.xml | 28 ++++ .../src/main/webapp/WEB-INF/web.xml | 31 +++++ .../src/main/webapp/hello.jsp | 41 ++++++ .../testing/helloworld-scaclient-servlet/pom.xml | 53 ++++++++ .../src/main/java/testing/HelloworldService.java | 28 ++++ .../src/main/java/testing/HelloworldServlet.java | 64 +++++++++ .../src/main/webapp/META-INF/sca-contribution.xml | 28 ++++ .../src/main/webapp/WEB-INF/web.xml | 41 ++++++ .../src/main/webapp/hello.html | 52 ++++++++ .../helloworld-service-contribution/pom.xml | 45 +++++++ .../src/main/java/testing/HelloworldImpl.java | 38 ++++++ .../src/main/java/testing/HelloworldService.java | 28 ++++ .../main/resources/META-INF/sca-contribution.xml | 23 ++++ .../src/main/resources/helloworld.composite | 28 ++++ .../tomcat/testing/legal-checks/pom.xml | 42 ++++++ .../src/test/java/itest/JarsInLICENSETestCase.java | 147 +++++++++++++++++++++ .../distribution/tomcat/testing/pom.xml | 42 ++++++ 30 files changed, 1254 insertions(+) create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/download-tomcat/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/hello.jsp create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldRefImpl.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldService.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/helloworld.composite create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/java/testing/HelloworldService.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldService.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/WEB-INF/web.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/hello.html create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/pom.xml create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java create mode 100644 sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/pom.xml (limited to 'sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing') diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/download-tomcat/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/download-tomcat/pom.xml new file mode 100644 index 0000000000..bdae2f8137 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/download-tomcat/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + download-tomcat + war + Apache Tuscany SCA Tomcat Integration Testing Download Tomcat + + + 6.0.18 + + + + + + + + + org.codehaus.mojo + tomcat-maven-plugin + 1.0-beta-1 + + + + org.codehaus.mojo + wagon-maven-plugin + 1.0-beta-1 + + + download-tomcat + pre-integration-test + + download-single + + + http://archive.apache.org + dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip + download + + + + + + + + + + + + + download/apache-tomcat-6.0.18.zip + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/pom.xml new file mode 100644 index 0000000000..91f95b58b4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/pom.xml @@ -0,0 +1,47 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + helloworld-client-webapp + war + Apache Tuscany SCA Tomcat Integration Testing Helloworld Client Webapp + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-Beta3 + provided + + + + + ${project.artifactId} + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java new file mode 100644 index 0000000000..0be22979c2 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java @@ -0,0 +1,30 @@ +/* + * 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 testing; + +// TODO: should the webapp need to include the service interface? + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite new file mode 100644 index 0000000000..d6db86cf64 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..411d8a3146 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,31 @@ + + + + + jsp-client-webapp + + + hello.jsp + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/hello.jsp b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/hello.jsp new file mode 100644 index 0000000000..d520375993 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/hello.jsp @@ -0,0 +1,36 @@ +<%-- + * 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. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %> + + + + + + +

jsp-client-webapp

+ + Calling HelloworldService sayHello("world") returns: + +

+ + <%= service.sayHello("world") %> + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/pom.xml new file mode 100644 index 0000000000..70390ec70d --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + helloworld-reference-contribution + Apache Tuscany SCA Tomcat Integration Testing Helloworld Reference Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-Beta3 + provided + + + + + + ${project.artifactId} + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldRefImpl.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldRefImpl.java new file mode 100644 index 0000000000..c2d0bcb4dc --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldRefImpl.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 testing; + +import org.oasisopen.sca.annotation.Service; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.EagerInit; + +@Service(HelloworldService.class) +public class HelloworldRefImpl implements HelloworldService { + + @Reference + public HelloworldService service; + + public String sayHello(String name) { + if (service == null) { + return "ERROR, @Reference is null!"; + } else { + return "Hello ref says: " + service.sayHello(name); + } + } +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldService.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldService.java new file mode 100644 index 0000000000..b035a772be --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/java/testing/HelloworldService.java @@ -0,0 +1,28 @@ +/* + * 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 testing; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..693325c13d --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/helloworld.composite b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/helloworld.composite new file mode 100644 index 0000000000..b07cf6078c --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-reference-contribution/src/main/resources/helloworld.composite @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/pom.xml new file mode 100644 index 0000000000..be6b9a64e1 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/pom.xml @@ -0,0 +1,48 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + helloworld-scaclient-jsp + war + Apache Tuscany SCA Tomcat Integration Testing Helloworld Webapp Using SCAClient in a JSP + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-Beta3 + provided + + + + + ${project.artifactId} + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/java/testing/HelloworldService.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/java/testing/HelloworldService.java new file mode 100644 index 0000000000..b035a772be --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/java/testing/HelloworldService.java @@ -0,0 +1,28 @@ +/* + * 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 testing; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7839933b3a --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..f2e3441d5e --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,31 @@ + + + + + jsp-client-webapp + + + hello.jsp + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp new file mode 100644 index 0000000000..45ae96cb82 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-jsp/src/main/webapp/hello.jsp @@ -0,0 +1,41 @@ +<%-- + * 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. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + +<%@ page import="org.oasisopen.sca.client.SCAClientFactory"%> +<%@ page import="testing.HelloworldService" %> +<%@ page import="java.net.URI" %> + +<% + HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, "HelloworldComponent"); +%> + + + + +

helloworld-scaclient-jsp

+ + Calling HelloworldService sayHello("world") returns: + +

+ + <%= service.sayHello("world") %> + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/pom.xml new file mode 100644 index 0000000000..21e77f4baf --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + helloworld-scaclient-servlet + war + Apache Tuscany SCA Tomcat Integration Testing Helloworld Webapp Using SCAClient in a Servlet + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-Beta3 + provided + + + javax.servlet + servlet-api + 2.5 + provided + + + + + ${project.artifactId} + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldService.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldService.java new file mode 100644 index 0000000000..b035a772be --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldService.java @@ -0,0 +1,28 @@ +/* + * 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 testing; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java new file mode 100644 index 0000000000..5be51fab61 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/java/testing/HelloworldServlet.java @@ -0,0 +1,64 @@ +/* + * 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 testing; + +import java.io.IOException; +import java.io.Writer; +import java.net.URI; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.oasisopen.sca.NoSuchDomainException; +import org.oasisopen.sca.NoSuchServiceException; +import org.oasisopen.sca.client.SCAClientFactory; + +/** + */ +public class HelloworldServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + @Override + protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException { + try { + + String component = request.getParameter("component"); + HelloworldService service = SCAClientFactory.newInstance(URI.create("default")).getService(HelloworldService.class, component); + + String name = request.getParameter("name"); + String greeting = service.sayHello(name); + + Writer out = response.getWriter(); + out.write("Apache Tuscany Helloworld Servlet Sample"); + out.write("

Apache Tuscany Helloworld Servlet Sample

"); + out.write("
Component " + component + " says: " + greeting); + out.write(""); + out.flush(); + out.close(); + + } catch (NoSuchDomainException e) { + e.printStackTrace(); + } catch (NoSuchServiceException e) { + e.printStackTrace(); + } + } +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..7839933b3a --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/META-INF/sca-contribution.xml @@ -0,0 +1,28 @@ + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..d424d4b71b --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,41 @@ + + + + + helloworld-scaclient2-webapp + + + HelloworldServlet + testing.HelloworldServlet + + + + HelloworldServlet + /HelloworldServlet + + + + hello.html + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/hello.html b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/hello.html new file mode 100644 index 0000000000..5398cb5274 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-scaclient-servlet/src/main/webapp/hello.html @@ -0,0 +1,52 @@ + + + + +helloworld-scaclient2-webapp + + + + +

helloworld-scaclient-servlet

+ +
+ + + + + + + + + + + +
Enter your name: + +
+ +
+
+ + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/pom.xml new file mode 100644 index 0000000000..0478e5ad1f --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + + helloworld-service-contribution + Apache Tuscany SCA Tomcat Integration Testing Helloworld Service Contribution + + + + org.apache.tuscany.sca + tuscany-sca-api + 2.0-Beta3 + provided + + + + + + ${project.artifactId} + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java new file mode 100644 index 0000000000..564b2e332f --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.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 testing; + +import org.oasisopen.sca.annotation.Init; +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.Service; +import org.oasisopen.sca.annotation.EagerInit; + +@Service(HelloworldService.class) +@Scope("COMPOSITE") @EagerInit +public class HelloworldImpl implements HelloworldService { + + public String sayHello(String name) { + return "Hello " + name; + } + + @Init + public void init() { + System.out.println("HelloworldImpl eager init: " + sayHello("world")); + } +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java new file mode 100644 index 0000000000..eec9d63da8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java @@ -0,0 +1,28 @@ +/* + * 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 testing; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface HelloworldService { + + String sayHello(String name); + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml new file mode 100644 index 0000000000..4e0eca6068 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite new file mode 100644 index 0000000000..82b2cc7ce7 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/pom.xml new file mode 100644 index 0000000000..13d1032415 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + 2.0-Beta3 + ../pom.xml + + war-legal-checks + Apache Tuscany SCA WAR Distribution Legal Checks + + + + junit + junit + 4.8.1 + compile + + + + + + diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java new file mode 100644 index 0000000000..04e6a0bc5c --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java @@ -0,0 +1,147 @@ +/* + * 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 itest; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +import org.junit.Test; + +/** + * Checks that all jar files included in the distribution are mentioned in the LICENSE file + * and that all jars mentioned in the LICENSE are in the distribution. + */ +public class JarsInLICENSETestCase { + + @Test + public void testJars() throws Exception { + File distroRoot = getUnzipedDistroRoot(); + + File licenseFile = new File(distroRoot, "LICENSE"); + if (!licenseFile.exists()) { + throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString()); + } + + File libDirectory = distroRoot; + if (!libDirectory.exists()) { + throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString()); + } + + List jars = getJarsInDistro(libDirectory); + + List bad2 = getLICENSEJarsNotInDistro(licenseFile, jars); + if (bad2.size() > 0) { + System.err.println("Jars in LICENSE but not in Distribution: " + bad2); + } + + List bad1 = getJarsNotInLICENSE(jars, licenseFile); + if (bad1.size() > 0) { + System.err.println("Jars in distribution but not in LICENSE: " + bad1); + } + + if (bad1.size() > 0 || bad2.size() > 0) { + throw new IllegalStateException("LICENSE problems, check log"); + } + } + + private List getLICENSEJarsNotInDistro(File licenseFile, List jars) throws IOException { + List badJars = new ArrayList(); + BufferedReader reader = new BufferedReader(new FileReader(licenseFile)); + String line = null; + while ((line = reader.readLine()) != null) { + line = line.trim(); + if (line.contains(".jar")) { + StringTokenizer st = new StringTokenizer(line); + while (st.hasMoreTokens()) { + String s = st.nextToken(); + if (s.contains(".jar")) { + if (s.startsWith("(")) { + s = s.substring(1); + } + if (s.endsWith(",") || s.endsWith(":")) { + s = s.substring(0, s.length()-1); + } + if (s.endsWith(")")) { + s = s.substring(0, s.length()-1); + } + if (!jars.contains(s) && !s.startsWith("tuscany-")) { + badJars.add(s); + } + } + } + } + } + return badJars; + } + + private List getJarsNotInLICENSE(List jars, File licenseFile) throws IOException { + List badJars = new ArrayList(); + String licenseText = readLICENSE(licenseFile); + for (String jar : jars) { + if (!licenseText.contains(jar)) { + if (jar.startsWith("tuscany-")) { + // ignore tuscany jars as they're not mentioned in the LICENSE file + } else { + badJars.add(jar); + } + } + } + return badJars; + } + + private List getJarsInDistro(File directory) { + List jars = new ArrayList(); + for (String fn : directory.list()){ + if (fn.endsWith(".jar")) { + jars.add(fn); + } else { + File f = new File(directory, fn); + if (f.isDirectory()) { + jars.addAll(getJarsInDistro(f)); + } + } + } + return jars; + } + + private File getUnzipedDistroRoot() { + return new File("../../tomcat-war/target/tuscany"); + } + + private static String readLICENSE(File licenseFile) throws java.io.IOException { + StringBuffer fileData = new StringBuffer(); + BufferedReader reader = new BufferedReader(new FileReader(licenseFile)); + char[] buf = new char[1024]; + int numRead = 0; + while ((numRead = reader.read(buf)) != -1) { + String readData = String.valueOf(buf, 0, numRead); + fileData.append(readData); + buf = new char[1024]; + } + reader.close(); + return fileData.toString(); + } + +} diff --git a/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/pom.xml b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/pom.xml new file mode 100644 index 0000000000..e66e785042 --- /dev/null +++ b/sca-java-2.x/tags/2.0-Beta3-RC2/distribution/tomcat/testing/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-distribution-tomcat + ../pom.xml + 2.0-Beta3 + + org.apache.tuscany.sca + tuscany-distribution-tomcat-testing + pom + Apache Tuscany SCA Distribution Tomcat Testing + + + helloworld-service-contribution + helloworld-reference-contribution + helloworld-scaclient-jsp + helloworld-scaclient-servlet + helloworld-client-webapp + legal-checks + + + -- cgit v1.2.3