From f8c39e92337e604a17d016621d2201968d01e26a Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:23:20 +0000 Subject: Moving 2.x tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835155 13f79535-47bb-0310-9956-ffa450edef68 --- .../itest/distribution/bin-distro-unzip/build.xml | 24 +++ .../itest/distribution/bin-distro-unzip/pom.xml | 138 +++++++++++++ .../distribution/binding-ws-calculator/build.xml | 40 ++++ .../distribution/binding-ws-calculator/pom.xml | 82 ++++++++ .../itest/distribution/calculator-rmi/build.xml | 51 +++++ .../itest/distribution/calculator-rmi/pom.xml | 81 ++++++++ .../implementation-java-calculator/build.xml | 40 ++++ .../implementation-java-calculator/pom.xml | 82 ++++++++ .../itest/distribution/legal-checks/pom.xml | 42 ++++ .../src/test/java/itest/JarsInLICENSETestCase.java | 162 ++++++++++++++++ .../tags/2.0-M4-RC3/itest/distribution/pom.xml | 49 +++++ .../distribution/webapp-helloworld-bpel/pom.xml | 124 ++++++++++++ .../src/test/java/itest/HelloworldTestCase.java | 50 +++++ .../distribution/webapp-helloworld-jms/pom.xml | 216 +++++++++++++++++++++ .../src/test/java/itest/HelloworldTestCase.java | 51 +++++ .../webapp-helloworld-js-client/pom.xml | 188 ++++++++++++++++++ .../src/test/java/itest/HelloworldTestCase.java | 75 +++++++ .../distribution/webapp-helloworld-jsf/pom.xml | 130 +++++++++++++ .../test/java/itest/HelloworldTestCaseFIXME.java | 71 +++++++ .../distribution/webapp-helloworld-jsp/pom.xml | 188 ++++++++++++++++++ .../src/test/java/itest/HelloworldTestCase.java | 50 +++++ .../distribution/webapp-helloworld-stripes/pom.xml | 124 ++++++++++++ .../src/test/java/itest/HelloworldTestCase.java | 53 +++++ .../itest/distribution/webapp-helloworld/pom.xml | 121 ++++++++++++ 24 files changed, 2232 insertions(+) create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/build.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/build.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/build.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/build.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/src/test/java/itest/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/src/test/java/itest/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/pom.xml create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java create mode 100644 sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld/pom.xml (limited to 'sca-java-2.x/tags/2.0-M4-RC3/itest/distribution') diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/build.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/build.xml new file mode 100644 index 0000000000..68e15d4a8b --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/build.xml @@ -0,0 +1,24 @@ + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/pom.xml new file mode 100644 index 0000000000..e87bf00476 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/bin-distro-unzip/pom.xml @@ -0,0 +1,138 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-bin-distro-unzip + Apache Tuscany SCA iTest Bin Distro Unzip + + + + org.apache.tuscany.sca + tuscany-distribution-all + pom + 2.0-M4 + + + + + + + + not-sun-jdk + + + ${java.home}/../lib/tools.jar + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + + ant + ant-trax + 1.6.5 + + + + + + run-samples + verify + + run + + + + + + + + + + + + + + + + + sun-jdk + + + ${java.home}/../lib/tools.jar + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + + ant + ant-trax + 1.6.5 + + + + sun.jdk + tools + 1.6 + system + ${java.home}/../lib/tools.jar + + + + + + run-samples + verify + + run + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/build.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/build.xml new file mode 100644 index 0000000000..ed22bce2dc --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/build.xml @@ -0,0 +1,40 @@ + + + + ${java.home} + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/pom.xml new file mode 100644 index 0000000000..681e1ed85c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/binding-ws-calculator/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-binding-ws-calculator + Apache Tuscany SCA iTest Distribution binding-ws-calculator + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + + ant + ant-trax + 1.6.5 + + + + sun.jdk + tools + 1.6 + system + ${java.home}/../lib/tools.jar + + + + + + run-samples + verify + + run + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/build.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/build.xml new file mode 100644 index 0000000000..25abf4e040 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/build.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/pom.xml new file mode 100644 index 0000000000..7b39859144 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/calculator-rmi/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-calculator-rmi + Apache Tuscany SCA iTest Distribution calculator-rmi + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + + ant + ant-trax + 1.6.5 + + + + sun.jdk + tools + 1.6 + system + ${java.home}/../lib/tools.jar + + + + + + run-samples + verify + + run + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/build.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/build.xml new file mode 100644 index 0000000000..106fee758c --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/build.xml @@ -0,0 +1,40 @@ + + + + ${java.home} + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/pom.xml new file mode 100644 index 0000000000..76f9c786b8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/implementation-java-calculator/pom.xml @@ -0,0 +1,82 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-implementation-java-calculator + Apache Tuscany SCA iTest Distribution implementation-java-calculator + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.3 + + + + ant + ant-trax + 1.6.5 + + + + sun.jdk + tools + 1.6 + system + ${java.home}/../lib/tools.jar + + + + + + run-samples + verify + + run + + + + + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/pom.xml new file mode 100644 index 0000000000..5aa8a2a44a --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/pom.xml @@ -0,0 +1,42 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-legal-checks + Apache Tuscany SCA iTest Distribution Legal Checks + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java new file mode 100644 index 0000000000..2cbbe57125 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java @@ -0,0 +1,162 @@ +/* + * 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 = new File(distroRoot, "modules"); + 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() { + File distroTarget = new File("../../../distribution/all/target"); + File root = null; + for (String f : distroTarget.list()) { + if (f.endsWith("-dir")) { + root = new File(distroTarget, f); + break; + } + } + if (root == null) { + throw new IllegalStateException("can't find distro root"); + } + if (root.list().length != 1) { + throw new IllegalStateException("expecting one directory in distro root"); + } + root = new File(root, root.list()[0]); + return root; + } + + 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-M4-RC3/itest/distribution/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/pom.xml new file mode 100644 index 0000000000..b62849a2ef --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/pom.xml @@ -0,0 +1,49 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-itest + 2.0-M4 + ../pom.xml + + pom + itest-distribution + Apache Tuscany SCA iTest Distribution + + + install + + + + bin-distro-unzip + binding-ws-calculator + calculator-rmi + implementation-java-calculator + legal-checks + webapp-helloworld + webapp-helloworld-bpel + webapp-helloworld-js-client + webapp-helloworld-jsp + webapp-helloworld-stripes + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/pom.xml new file mode 100644 index 0000000000..da7b3f620d --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/pom.xml @@ -0,0 +1,124 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-bpel + Apache Tuscany SCA iTest Distribution Webapp helloworld-bpel + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-bpel + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + jetty6x + embedded + + org.apache.commons.logging.impl.SimpleLog + + + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-bpel + + + + org.apache.tuscany.sca + helloworld-bpel + war + + helloworld-bpel + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java new file mode 100644 index 0000000000..5b29292acf --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java @@ -0,0 +1,50 @@ +/* + * 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 static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Iterator; + +import org.junit.Test; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlParagraph; + +/** + */ +public class HelloworldTestCase { + + @Test + public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { + HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-bpel"); + Iterator ss = page.getAllHtmlChildElements(); + ss.next(); + ss.next(); + ss.next(); + HtmlParagraph p = (HtmlParagraph)ss.next(); + assertEquals("Hello world", p.asText()); + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/pom.xml new file mode 100644 index 0000000000..3d79100bb0 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/pom.xml @@ -0,0 +1,216 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-jms + Apache Tuscany SCA iTest Distribution Webapp helloworld-jms + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-jms + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + org.mortbay.jetty + jsp-2.0 + 6.1.19 + pom + compile + + + org.mortbay.jetty + jetty-naming + 6.1.19 + + + org.mortbay.jetty + jetty-plus + 6.1.19 + + + geronimo-spec + geronimo-spec-jta + 1.0.1B-rc4 + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + + jetty6x + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer + + embedded + + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + jetty-util + + + org.mortbay.jetty + jetty-plus + + + org.mortbay.jetty + jetty-naming + + + geronimo-spec + geronimo-spec-jta + + + javax.servlet + servlet-api + + + org.mortbay.jetty + jsp-2.0 + + + tomcat + jasper-runtime + + + tomcat + jasper-compiler + + + commons-logging + commons-logging + + + tomcat + jasper-compiler-jdt + + + org.mortbay.jetty + jsp-api-2.0 + + + commons-el + commons-el + + + + + + + + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedStandaloneLocalConfiguration + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-jms + + + + org.apache.tuscany.sca + helloworld-jms + war + + helloworld-jms + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/src/test/java/itest/HelloworldTestCase.java new file mode 100644 index 0000000000..bc436667c8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jms/src/test/java/itest/HelloworldTestCase.java @@ -0,0 +1,51 @@ +/* + * 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 static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Iterator; + +import org.junit.Test; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlParagraph; + +/** + */ +public class HelloworldTestCase { + + @Test + public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { + HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jms"); + Iterator ss = page.getAllHtmlChildElements(); + ss.next(); + ss.next(); + ss.next(); + ss.next(); + HtmlParagraph p = (HtmlParagraph)ss.next(); + assertEquals("Hello world", p.asText()); + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/pom.xml new file mode 100644 index 0000000000..bca540e6dc --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/pom.xml @@ -0,0 +1,188 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-js-client + Apache Tuscany SCA iTest Distribution Webapp helloworld-js-client + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-js-client + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + org.mortbay.jetty + jsp-2.0 + 6.1.19 + pom + compile + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + + latest-jetty6x + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer + + embedded + + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + jetty-util + + + javax.servlet + servlet-api + + + org.mortbay.jetty + jsp-2.0 + + + tomcat + jasper-runtime + + + tomcat + jasper-compiler + + + commons-logging + commons-logging + + + tomcat + jasper-compiler-jdt + + + org.mortbay.jetty + jsp-api-2.0 + + + commons-el + commons-el + + + + + + + + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedStandaloneLocalConfiguration + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-jsp + + + + org.apache.tuscany.sca + helloworld-js-client + war + + helloworld-js-client + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/src/test/java/itest/HelloworldTestCase.java new file mode 100644 index 0000000000..099b442050 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-js-client/src/test/java/itest/HelloworldTestCase.java @@ -0,0 +1,75 @@ +/* + * 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 static org.junit.Assert.assertTrue; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.net.URLEncoder; + +import org.junit.Test; + +/** + * Verfiy the serverside code is working, not sure how to easily itest the browser javascript code + */ +public class HelloworldTestCase { + + @Test + public void testA() throws MalformedURLException, IOException { + + URL url = new URL("http://localhost:8085/helloworld-js-client/org.oasisopen.sca.componentContext.js/foo/call/plaincall/service.sayHello.dwr"); + URLConnection conn = url.openConnection(); + conn.setDoOutput(true); + OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); + + // to find this run the sample through TCPMON to capture the messages + + String data = URLEncoder.encode("callCount", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8"); + data += "&" + URLEncoder.encode("page", "UTF-8") + "=" + URLEncoder.encode("/helloworld-js-client/", "UTF-8"); + data += "&" + URLEncoder.encode("httpSessionId", "UTF-8") + "=" + URLEncoder.encode("", "UTF-8"); + data += "&" + URLEncoder.encode("scriptSessionId", "UTF-8") + "=" + URLEncoder.encode("A023DA664E56F075491BE1B87B37B02671", "UTF-8"); + data += "&" + URLEncoder.encode("c0-scriptName", "UTF-8") + "=" + URLEncoder.encode("service", "UTF-8"); + data += "&" + URLEncoder.encode("c0-methodName", "UTF-8") + "=" + URLEncoder.encode("sayHello", "UTF-8"); + data += "&" + URLEncoder.encode("c0-id", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8"); + data += "&" + URLEncoder.encode("c0-param0", "UTF-8") + "=" + URLEncoder.encode("string:petra", "UTF-8"); + data += "&" + URLEncoder.encode("batchId", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8"); + + wr.write(data); + wr.flush(); + + BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); + rd.readLine(); // throw 'allowScriptTagRemoting is false.'; + rd.readLine(); //#DWR-INSERT + rd.readLine(); //#DWR-REPLY + String line = rd.readLine(); // dwr.engine._remoteHandleCallback('0','0',"Hello petra"); + wr.close(); + rd.close(); + + assertTrue(line.endsWith("\"Hello petra\");")); + + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/pom.xml new file mode 100644 index 0000000000..4b4f07f2e4 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/pom.xml @@ -0,0 +1,130 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-jsf + Apache Tuscany SCA iTest Distribution Webapp helloworld-jsf + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-jsf + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + javax.el + el-api + 1.0 + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + jetty6x + embedded + + org.apache.commons.logging.impl.SimpleLog + + + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-jsf + + + + org.apache.tuscany.sca + helloworld-jsf + war + + helloworld-jsf + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java new file mode 100644 index 0000000000..1f90a772ac --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java @@ -0,0 +1,71 @@ +/* + * 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.IOException; +import java.net.MalformedURLException; +import java.util.Iterator; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlForm; +import com.gargoylesoftware.htmlunit.html.HtmlInput; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlParagraph; + +/** + * TODO: This doesn't work yet, I can't find the hello response in the + * the response page from the button click. Not sure if thats just + * looking in the wrong place or the button click is not working + * Also the Cargo maven plugin has a problem finding the el-api when using Jetty + */ +public class HelloworldTestCaseFIXME { + + @Test + public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { + HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsf"); + + HtmlForm form = page.getFormByName("mainForm"); + + HtmlInput textField = form.getInputByName("mainForm:name"); + textField.setValueAttribute("root"); + + Iterator i = form.getChildIterator(); + i.next(); + HtmlInput button = (HtmlInput)i.next(); + + HtmlPage page2 = (HtmlPage)button.click(); + + Iterator ss = page2.getAllHtmlChildElements(); + ss.next(); + ss.next(); + ss.next(); + ss.next(); + HtmlForm form2 = (HtmlForm)ss.next(); + + Object oow = form2.getFirstChild(); + System.out.println(oow); +// assertTrue(p.asText().startsWith("Hello Petra")); + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/pom.xml new file mode 100644 index 0000000000..584f2f1038 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/pom.xml @@ -0,0 +1,188 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-jsp + Apache Tuscany SCA iTest Distribution Webapp helloworld-jsp + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-jsp + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + org.mortbay.jetty + jsp-2.0 + 6.1.19 + pom + compile + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + + latest-jetty6x + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer + + embedded + + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + jetty-util + + + javax.servlet + servlet-api + + + org.mortbay.jetty + jsp-2.0 + + + tomcat + jasper-runtime + + + tomcat + jasper-compiler + + + commons-logging + commons-logging + + + tomcat + jasper-compiler-jdt + + + org.mortbay.jetty + jsp-api-2.0 + + + commons-el + commons-el + + + + + + + + org.codehaus.cargo.container.jetty.Jetty6xEmbeddedStandaloneLocalConfiguration + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-jsp + + + + org.apache.tuscany.sca + helloworld-jsp + war + + helloworld-jsp + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java new file mode 100644 index 0000000000..2be60be081 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java @@ -0,0 +1,50 @@ +/* + * 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 static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Iterator; + +import org.junit.Test; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlParagraph; + +/** + */ +public class HelloworldTestCase { + + @Test + public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { + HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsp"); + Iterator ss = page.getAllHtmlChildElements(); + ss.next(); + ss.next(); + ss.next(); + HtmlParagraph p = (HtmlParagraph)ss.next(); + assertEquals("Hello world", p.asText()); + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/pom.xml new file mode 100644 index 0000000000..6cb817579f --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/pom.xml @@ -0,0 +1,124 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld-stripes + Apache Tuscany SCA iTest Distribution Webapp helloworld-stripes + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld-stripes + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + htmlunit + htmlunit + 1.9 + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + compile + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + jetty6x + embedded + + org.apache.commons.logging.impl.SimpleLog + + + + + ${project.build.directory}/cargo-jetty + + + + 8085 + helloworld-stripes + + + + org.apache.tuscany.sca + helloworld-stripes + war + + helloworld-stripes + + + + + + + + + + diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java new file mode 100644 index 0000000000..743ab054c8 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.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 itest; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Iterator; + +import org.junit.Test; + +import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlParagraph; + +/** + */ +public class HelloworldTestCase { + + @Test + public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { + HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes"); + Iterator ss = page.getAllHtmlChildElements(); + Object o1= ss.next(); + Object o2= ss.next(); + Object o3= ss.next(); + Object o4= ss.next(); + Object o5= ss.next(); + Object o6= ss.next(); + HtmlParagraph p = (HtmlParagraph)ss.next(); + assertEquals("sayHello returns: Hello world", p.asText()); + } + +} diff --git a/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld/pom.xml b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld/pom.xml new file mode 100644 index 0000000000..2eea7bfcd6 --- /dev/null +++ b/sca-java-2.x/tags/2.0-M4-RC3/itest/distribution/webapp-helloworld/pom.xml @@ -0,0 +1,121 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + itest-distribution + 2.0-M4 + ../pom.xml + + itest-distribution-webapp-helloworld + Apache Tuscany SCA iTest Distribution Webapp helloworld + + + + + org.apache.tuscany.sca + itest-bin-distro-unzip + pom + 2.0-M4 + + + + org.apache.tuscany.sca + helloworld + war + 2.0-M4 + + + + junit + junit + 4.5 + test + + + + httpunit + httpunit + 1.6.1 + test + + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + 1.0 + + + start-container + pre-integration-test + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + jetty6x + embedded + + org.apache.commons.logging.impl.SimpleLog + + + + + ${project.build.directory}/cargo-jetty + + + + 8085 + + + + org.apache.tuscany.sca + helloworld + war + http://localhost:8085/helloworld + + + + + + + + + -- cgit v1.2.3