summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-07-21 10:54:19 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2011-07-21 10:54:19 +0000
commitbbf16e4c0da1202da475dcba660bc8b9143bc9b0 (patch)
treed13e7c8f6b484f1b6a2bde6efaf5a9eff2f5192b /sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src
parentbefd009cd2be55db418737b3af1a42d3e0cc27cc (diff)
Delete the unreleased folder from beta3
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1149107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src')
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/Helloworld.java28
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/HelloworldImpl.java43
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/SampleActivator.java45
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/sca-contribution.xml25
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor20
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions17
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory18
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/definitions.xml60
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/helloworld.composite50
-rw-r--r--sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/test/java/sample/HelloworldTestCase.java216
10 files changed, 0 insertions, 522 deletions
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/Helloworld.java b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/Helloworld.java
deleted file mode 100644
index f4e8c50448..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/Helloworld.java
+++ /dev/null
@@ -1,28 +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 sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
-
- String sayHello(String name);
-
-}
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/HelloworldImpl.java b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/HelloworldImpl.java
deleted file mode 100644
index 0e6d3cb1c7..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/HelloworldImpl.java
+++ /dev/null
@@ -1,43 +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 sample.impl;
-
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-
-import sample.Helloworld;
-
-public class HelloworldImpl implements Helloworld {
-
- @Reference(required=false)
- protected Helloworld hwRef;
-
- @Property
- protected String componentName;
-
- public String sayHello(String name) {
- String returnString = "Hello " + name + "->" + componentName;
- if (hwRef != null){
- return hwRef.sayHello(returnString);
- } else {
- return returnString;
- }
- }
-
-}
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/SampleActivator.java b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/SampleActivator.java
deleted file mode 100644
index 4838b534db..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/java/sample/impl/SampleActivator.java
+++ /dev/null
@@ -1,45 +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 sample.impl;
-
-import java.util.logging.Logger;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-import sample.Helloworld;
-
-public class SampleActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(SampleActivator.class.getName());
-
-
- public void start(BundleContext context) throws Exception {
- logger.info("Starting " + context.getBundle());
-
- Helloworld hw = new HelloworldImpl();
- logger.info(hw.sayHello("Fred Bloggs"));
- }
-
- public void stop(BundleContext context) throws Exception {
- logger.info("Stopping " + context.getBundle());
- // Registered services will be automatically unregistered
- }
-
-}
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/sca-contribution.xml
deleted file mode 100644
index 95c32fb5bf..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/sca-contribution.xml
+++ /dev/null
@@ -1,25 +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.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- xmlns:sample="http://sample">
-
- <deployable composite="sample:helloworld-contribution" />
-
-</contribution>
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
deleted file mode 100644
index e3f31ae8d7..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
+++ /dev/null
@@ -1,20 +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.
-
-sample.ImplementationGenericPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementationGenericPolicy,model=sample.ImplementationGenericPolicy
-sample.InteractionGenericPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#interactionGenericPolicy,model=sample.InteractionGenericPolicy
-sample.InteractionBindingWSPolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#interactionBindingWSPolicy,model=sample.InteractionBindingWSPolicy \ No newline at end of file
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
deleted file mode 100644
index f362b64a1f..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
+++ /dev/null
@@ -1,17 +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.
-definitions.xml
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
deleted file mode 100644
index cbfb70c346..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
+++ /dev/null
@@ -1,18 +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.
-
-sample.InteractionBindingWSPolicyProviderFactory;model=sample.InteractionBindingWSPolicy \ No newline at end of file
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/definitions.xml b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/definitions.xml
deleted file mode 100644
index f37fde76ab..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/definitions.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * 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.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <intent name="implementation.generic" constrains="implementation">
- <description>
- An intent that targets policy interceptors at the implementation
- </description>
- </intent>
-
- <intent name="interaction.generic" constrains="binding">
- <description>
- An intent that targets policy interceptors at the binding generically
- </description>
- </intent>
-
- <intent name="interaction.bindingws" constrains="binding.ws">
- <description>
- An intent that targets policy interceptors at binding.ws
- </description>
- </intent>
-
- <policySet name="ImplementationGeneric"
- provides="tuscany:implementation.generic"
- appliesTo="//implementation">
- <tuscany:implementationGenericPolicy name="ImplementationGeneric"/>
- </policySet>
-
- <policySet name="InteractionGeneric"
- provides="tuscany:interaction.generic"
- appliesTo="//binding">
- <tuscany:interactionGenericPolicy name="InteractionGeneric"/>
- </policySet>
-
- <policySet name="InteractionBindingWS"
- provides="tuscany:interaction.bindingws"
- appliesTo="//binding.ws">
- <tuscany:interactionBindingWSPolicy name="InteractionBindingWS"/>
- </policySet>
-
-</definitions> \ No newline at end of file
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/helloworld.composite b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/helloworld.composite
deleted file mode 100644
index 47488f8bbd..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/main/resources/helloworld.composite
+++ /dev/null
@@ -1,50 +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/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://sample"
- name="helloworld-contribution">
-
- <component name="HelloworldComponent1">
- <implementation.java class="sample.HelloworldImpl"/>
- <reference name="hwRef"
- target="HelloworldComponent2"
- requires="tuscany:interaction.bindingws"
- policySets="tuscany:InteractionBindingWS"/>
- <property name="componentName" value="HelloworldComponent1"/>
- </component>
-
- <component name="HelloworldComponent2">
- <implementation.java class="sample.HelloworldImpl"/>
- <service name="Helloworld"
- requires="tuscany:interaction.bindingws"
- policySets="tuscany:InteractionBindingWS">
- <binding.ws/>
- </service>
- <reference name="hwRef" target="HelloworldComponent3"/>
- <property name="componentName" value="HelloworldComponent2"/>
- </component>
-
- <component name="HelloworldComponent3">
- <implementation.java class="sample.HelloworldImpl"/>
- <property name="componentName" value="HelloworldComponent3"/>
- </component>
-
-</composite>
diff --git a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/test/java/sample/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/test/java/sample/HelloworldTestCase.java
deleted file mode 100644
index 4c3f0271fa..0000000000
--- a/sca-java-2.x/branches/2.0-Beta3/unreleased/testing/itest/bundle/src/test/java/sample/HelloworldTestCase.java
+++ /dev/null
@@ -1,216 +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 sample;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.util.HashSet;
-import java.util.Set;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
-
-import org.apache.aries.application.filesystem.IDirectory;
-import org.apache.aries.application.management.spi.repository.RepositoryGenerator;
-import org.apache.aries.application.modelling.ModelledResourceManager;
-import org.apache.aries.application.modelling.ModelledResource;
-import org.apache.aries.application.utils.filesystem.FileSystem;
-
-import org.apache.felix.bundlerepository.Repository;
-import org.apache.felix.bundlerepository.RepositoryAdmin;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.options.WorkingDirectoryOption;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
-import org.osgi.framework.FrameworkUtil;
-import org.osgi.util.tracker.ServiceTracker;
-
-/* For debugging, uncomment the next two lines and add these imports:
- */
-import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
-
-
-/**
- * Note that much of the technical detail/instruction comes from...
- *
- * http://svn.apache.org/repos/asf/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java
- *
- */
-
-@RunWith( JUnit4TestRunner.class )
-public class HelloworldTestCase {
-
- public static final long DEFAULT_TIMEOUT = 30000;
-
- @Inject
- protected BundleContext bundleContext;
-
- @Configuration
- public static Option[] configuration() {
- Option[] options = options(
- mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
- mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
-
-// mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
- mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
-
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("asm", "asm-all"),
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy"),
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
-
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.api"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.default.local.platform"),
- mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.management"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces"),
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
-
- mavenBundle("org.apache.tuscany.sca", "tuscany-sca-api"),
-
- mavenBundle("org.apache.tuscany.sca", "bundle"),
-
- /* For debugging, uncomment the next two lines
- vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"),
- waitForFrameworkStartup(),
- */
-
- workingDirectory("D://sca-java-2.x//unreleased//testing//itest//bundle//target"),
-
- equinox().version("3.5.0"));
-
- return options;
- }
-
- @Test
- public void testSayHello() {
- System.out.println("testSayHello - start");
- System.out.println("test dir = " + System.getProperty("user.dir"));
- System.out.println("current dir = " + this.getClass().getProtectionDomain().getCodeSource().getLocation());
-
- // get the OBR repository admin service
- RepositoryAdmin respositoryAdminService = getOsgiService(RepositoryAdmin.class);
-
- // print currently registered repos
- Repository[] repos = respositoryAdminService.listRepositories();
- System.out.println("initial repos");
- for (Repository repo : repos) {
- System.out.println("Repo >>> " + repo.getName());
- }
-
- // get the repository generator service
- System.out.println("get RepositoryGenerator service =");
- RepositoryGenerator repositoryGenerator = getOsgiService(RepositoryGenerator.class);
- System.out.println(repositoryGenerator);
-
- System.out.println("get ModelledResourceManager service =");
- ModelledResourceManager modelledResourceManager = getOsgiService(ModelledResourceManager.class);
- System.out.println(modelledResourceManager);
-
- Set<ModelledResource> mrs = new HashSet<ModelledResource>();
-
- try {
- // create mrs based on base runtime
- populateMRS(modelledResourceManager,
- mrs,
- "../../../../../distribution/all/target/features/tuscany-base-runtime-pom/which-jars",
- "../../../../../distribution/all/target/modules");
- //File outFile = new File("D://sca-java-2.x//unreleased//testing//itest//bundle//target//myrepository.xml");
- //File outFile = new File(".//target//myrepository.xml");
- //FileOutputStream fout = new FileOutputStream(outFile);
- FileOutputStream fout = new FileOutputStream("repository.xml");
- repositoryGenerator.generateRepository("Test repo description", mrs, fout);
- fout.close();
-
- } catch(Exception ex) {
- ex.printStackTrace();
- }
-
- System.out.println("testSayHello - end");
- }
-
- private void populateMRS(ModelledResourceManager modelledResourceManager,
- Set<ModelledResource> mrs,
- String whichJars,
- String modules){
- try {
- BufferedReader in = new BufferedReader(new FileReader(whichJars));
- String line;
- while ((line = in.readLine()) != null) {
- if (line.endsWith(".jar")){
- int dirSeparatorIndex = line.indexOf("/");
- if (dirSeparatorIndex > 0){
- line = line.substring(0, dirSeparatorIndex);
- }
- System.out.println("Processing - " + line);
- File bundleFile = new File(modules + "\\" + line);
- IDirectory jarDir = FileSystem.getFSRoot(bundleFile);
- mrs.add(modelledResourceManager.getModelledResource(bundleFile.toURI().toString(), jarDir));
- }
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- private <T> T getOsgiService(Class<T> type) {
- try {
- String filterString = "(" + Constants.OBJECTCLASS + "=" + type.getName() + ")";
- Filter osgiFilter = FrameworkUtil.createFilter(filterString);
- ServiceTracker tracker = new ServiceTracker(bundleContext, osgiFilter, null);
- tracker.open();
- Object tmp = tracker.waitForService(DEFAULT_TIMEOUT);
- return type.cast(tmp);
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static MavenArtifactProvisionOption mavenBundle(String groupId, String artifactId) {
- return CoreOptions.mavenBundle().groupId(groupId).artifactId(artifactId).versionAsInProject();
- }
-}
-
-