summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 21:10:05 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-18 21:10:05 +0000
commit7188fa70c225d6b55ca6a02106ccf0f92eb1fc8e (patch)
tree4c9cad89d04e1f6ab9d355661b605ce4b53e283a /java
parentcf01849798f2d842bcace2e6af657c0fa5ed094d (diff)
Access the equinox jars from a temporary maven repo @http://people.apache.org/~rfeng/repo/maven2
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@755736 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/sca/modules/node-impl-osgi/pom.xml34
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java8
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java14
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorld.java30
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorldImpl.java30
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/HelloWorld.composite30
6 files changed, 39 insertions, 107 deletions
diff --git a/java/sca/modules/node-impl-osgi/pom.xml b/java/sca/modules/node-impl-osgi/pom.xml
index ed7a922d6b..cc42ebbd00 100644
--- a/java/sca/modules/node-impl-osgi/pom.xml
+++ b/java/sca/modules/node-impl-osgi/pom.xml
@@ -29,20 +29,54 @@
<artifactId>tuscany-node-impl-osgi</artifactId>
<name>Apache Tuscany SCA OSGi Node Implementation</name>
+
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>rfeng.repo</id>
+ <name>A Temporary Maven 2.x Repository for Equinox 3.4.2</name>
+ <url>http://people.apache.org/~rfeng/repo/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
<dependencies>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
+ <version>3.4.0-v20080605-1900</version>
+ <!--
<version>3.3.0-v20070530</version>
+ -->
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>services</artifactId>
+ <version>3.1.200-v20071203</version>
+ <!--
<version>3.1.200-v20070605</version>
+ -->
<scope>test</scope>
</dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.0.0-v20080427-0830</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.0-v20080414</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-assembly</artifactId>
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
index 86b0da3a01..dbb45dedb4 100644
--- a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
+++ b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
@@ -19,7 +19,6 @@
package calculator.dosgi.test;
-import java.io.File;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -80,13 +79,6 @@ public class CalculatorOSGiNodeTestCase {
}
Set<URL> bundles = new HashSet<URL>();
- File plugins = new File("target/test-classes/plugins");
- for (File f : plugins.listFiles()) {
- if (f.isFile()) {
- bundles.add(f.toURI().toURL());
- }
- }
-
if (client == null || client.booleanValue()) {
System.out.println("Generating calculator.dosgi bundle...");
bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar",
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
index 82204a0272..6ff261d01f 100644
--- a/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
+++ b/java/sca/modules/node-impl-osgi/src/test/java/calculator/dosgi/test/CalculatorOSGiTestCase.java
@@ -19,7 +19,6 @@
package calculator.dosgi.test;
-import java.io.File;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@@ -62,13 +61,6 @@ public class CalculatorOSGiTestCase {
public static void setUpBeforeClass() throws Exception {
Set<URL> bundles = new HashSet<URL>();
- File plugins = new File("target/test-classes/plugins");
- for (File f : plugins.listFiles()) {
- if (f.isFile()) {
- bundles.add(f.toURI().toURL());
- }
- }
-
bundles.add(OSGiTestBundles.createBundle("target/test-classes/calculator-bundle.jar",
"calculator/dosgi/META-INF/MANIFEST.MF",
new String[][] {
@@ -103,10 +95,14 @@ public class CalculatorOSGiTestCase {
DivideService.class,
DivideServiceImpl.class));
try {
- host = new EquinoxHost(bundles);
+ host = new EquinoxHost();
BundleContext context = host.start();
+ for (URL loc : bundles) {
+ host.installBundle(loc, null);
+ }
for (Bundle b : context.getBundles()) {
if (b.getSymbolicName().equals("org.eclipse.equinox.ds")) {
+ System.out.println(string(b, false));
b.start();
System.out.println(string(b, false));
}
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorld.java b/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorld.java
deleted file mode 100644
index e3fcdfd25f..0000000000
--- a/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorld.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * HelloWorld interface
- */
-@Remotable
-public interface HelloWorld {
- String hello(String name);
-}
diff --git a/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorldImpl.java b/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorldImpl.java
deleted file mode 100644
index c9a7560b12..0000000000
--- a/java/sca/modules/node-impl-osgi/src/test/java/hello/HelloWorldImpl.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package hello;
-
-/**
- * HelloWorldImpl
- */
-public class HelloWorldImpl implements HelloWorld {
- public String hello(String name) {
- System.out.println("Hello: " + name);
- return "Hello, " + name;
- }
-}
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/HelloWorld.composite b/java/sca/modules/node-impl-osgi/src/test/resources/HelloWorld.composite
deleted file mode 100644
index 27ddcb94a8..0000000000
--- a/java/sca/modules/node-impl-osgi/src/test/resources/HelloWorld.composite
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample/composite"
- xmlns:sc="http://sample/composite"
- name="HelloWorld">
-
- <component name="HelloWorld">
- <implementation.java class="hello.HelloWorldImpl"/>
- </component>
-
-</composite>