summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-02-06 09:07:24 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-02-06 09:07:24 +0000
commit0c00d07fd7c3d3fd50b21fd53d18de45a7109af9 (patch)
tree69ac8206bb14466e7ab40b978342a68aaca37052 /sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources
parent16e2eaecd50b40da545a5b04e2ba2a2fbe4a1b60 (diff)
Clean up contribution jar archetype and update to create a standalone project that doesn't use a tuscany parent pom
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1067618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources')
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml43
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml10
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml94
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/Helloworld.java (renamed from sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java)2
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java2
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml4
-rw-r--r--sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/test/java/HelloworldTestCase.java48
7 files changed, 126 insertions, 77 deletions
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
index 46c5cd6dca..1e1c124869 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -18,19 +18,32 @@
* under the License.
-->
<archetype-descriptor name="myproject">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- </fileSets>
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
index 69c3fb5ac9..6e0591fbfe 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
@@ -18,13 +18,5 @@
* under the License.
-->
<archetype>
- <id>tuscany-contribution-jar</id>
- <sources>
- <source>src/main/java/HelloworldImpl.java</source>
- <source>src/main/java/HelloworldService.java</source>
- </sources>
- <resources>
- <resource>src/main/hello.composite</resource>
- <resource>src/main/webapp/META-INF/sca-contribution.xml</resource>
- </resources>
+ <id>tuscany-contribution-jar</id>
</archetype> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
index 5a2755a325..28a846797c 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
@@ -18,64 +18,58 @@
* under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <version>${project.version}</version>
- <name>${project.artifactId}</name>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <packaging>jar</packaging>
- <dependencies>
+ <name>${artifactId}</name>
- <dependency>
- <groupId>org.oasis-open.sca.j</groupId>
- <artifactId>sca-caa-apis</artifactId>
- <version>1.1-CD04</version>
- <scope>provided</scope>
- </dependency>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
+ <dependencies>
- </dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${project.artifactId}</finalName>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- </plugin>
- </plugins>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>test</scope>
+ </dependency>
- </build>
+ </dependencies>
- <!-- OASIS SVN repo (for sca-api jar) -->
- <repositories>
- <repository>
- <id>oasis.svn</id>
- <url>http://tools.oasis-open.org/version-control/svn/sca-j/Release/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- </repositories>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ <version>${tuscany.version}</version>
+ </plugin>
+ </plugins>
+
+ </build>
</project>
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/Helloworld.java
index d705564334..68f91f67cd 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/Helloworld.java
@@ -21,7 +21,7 @@ package ${package};
import org.oasisopen.sca.annotation.Remotable;
@Remotable
-public interface HelloworldService {
+public interface Helloworld {
String sayHello(String name);
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
index 26237c105c..f5af4c7366 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
@@ -23,7 +23,7 @@ import org.oasisopen.sca.annotation.Scope;
import org.oasisopen.sca.annotation.EagerInit;
@Scope("COMPOSITE") @EagerInit
-public class HelloworldImpl implements HelloworldService {
+public class HelloworldImpl implements Helloworld {
public String sayHello(String name) {
return "Hello " + name;
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
index 960d6a90ae..d2e633d3d8 100644
--- a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
@@ -19,5 +19,7 @@
-->
<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:sample="http://${package}">
- <deployable composite="sample:${artifactId}"/>
+
+ <deployable composite="sample:${artifactId}" />
+
</contribution>
diff --git a/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/test/java/HelloworldTestCase.java b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/test/java/HelloworldTestCase.java
new file mode 100644
index 0000000000..c98112cb93
--- /dev/null
+++ b/sca-java-2.x/trunk/maven/archetypes/contribution-jar/src/main/resources/archetype-resources/src/test/java/HelloworldTestCase.java
@@ -0,0 +1,48 @@
+/*
+ * 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 ${package};
+
+import org.junit.Assert;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class HelloworldTestCase {
+
+ @Test
+ public void testSayHello() throws NoSuchServiceException {
+
+ // Run the SCA composite in a Tuscany runtime
+ Node node = TuscanyRuntime.runComposite("helloworld.composite", "target/classes");
+ try {
+
+ // Get the Helloworld service proxy
+ Helloworld helloworld = node.getService(Helloworld.class, "HelloworldComponent");
+
+ // test that it works as expected
+ Assert.assertEquals("Hello Amelia", helloworld.sayHello("Amelia"));
+
+ } finally {
+ // Stop the Tuscany runtime Node
+ node.stop();
+ }
+ }
+}