You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by ga...@apache.org on 2010/06/07 22:05:41 UTC
svn commit: r952398 [2/3] - in /incubator/aries/trunk/application:
application-api/src/main/java/org/apache/aries/application/management/
application-bundle/ application-install/
application-install/src/main/java/org/apache/aries/application/install/ a...
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java Mon Jun 7 20:05:41 2010
@@ -1,150 +1,150 @@
-/*
- * 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 org.apache.aries.application.runtime.itests;
-
-import static org.junit.Assert.assertEquals;
-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 java.io.File;
-import java.io.FileOutputStream;
-
-import org.apache.aries.application.management.AriesApplication;
-import org.apache.aries.application.management.AriesApplicationContext;
-import org.apache.aries.application.management.AriesApplicationManager;
-import org.apache.aries.application.utils.filesystem.FileSystem;
-import org.apache.aries.sample.HelloWorld;
-import org.apache.aries.unittest.fixture.ArchiveFixture;
-import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-
-@RunWith(JUnit4TestRunner.class)
-public class BasicAppManagerTest extends AbstractIntegrationTest {
-
- /* Use @Before not @BeforeClass so as to ensure that these resources
- * are created in the paxweb temp directory, and not in the svn tree
- */
- static boolean createdApplications = false;
- @Before
- public static void createApplications() throws Exception {
- if (createdApplications) {
- return;
- }
- ZipFixture testEba = ArchiveFixture.newZip()
- .jar("sample.jar")
- .manifest().symbolicName("org.apache.aries.sample")
- .attribute("Bundle-Version", "1.0.0")
- .attribute("Import-Package", "org.apache.aries.sample")
- .end()
- .binary("org/apache/aries/sample/impl/HelloWorldImpl.class",
- BasicAppManagerTest.class.getClassLoader().getResourceAsStream("org/apache/aries/sample/impl/HelloWorldImpl.class"))
- .binary("OSGI-INF/blueprint/sample-blueprint.xml",
- BasicAppManagerTest.class.getClassLoader().getResourceAsStream("basic/sample-blueprint.xml"))
- .end();
-
- FileOutputStream fout = new FileOutputStream("test.eba");
- testEba.writeOut(fout);
- fout.close();
-
- ZipFixture testEba2 = testEba.binary("META-INF/APPLICATION.MF",
- BasicAppManagerTest.class.getClassLoader().getResourceAsStream("basic/APPLICATION.MF"))
- .end();
- fout = new FileOutputStream("test2.eba");
- testEba2.writeOut(fout);
- fout.close();
- createdApplications = true;
- }
-
- @Test
- public void testAppWithoutApplicationManifest() throws Exception {
-
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = getOsgiService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
- @Test
- public void testAppWithApplicationManifest() throws Exception {
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = getOsgiService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration() {
- Option[] options = options(
- // Log
- mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
- mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
- // Felix Config Admin
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
- // Felix mvn url handler
- mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
-
- // this is how you set the default log level when using pax
- // logging (logProfile)
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
-
- // Bundles
- 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.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.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
-
- /* For debugging, uncomment the next two lines
- vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
- waitForFrameworkStartup(),
-
- and add these imports:
- import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
- import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
- */
-
- equinox().version("3.5.0"));
- options = updateOptions(options);
- return options;
- }
-}
+/*
+ * 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 org.apache.aries.application.runtime.itests;
+
+import static org.junit.Assert.assertEquals;
+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 java.io.File;
+import java.io.FileOutputStream;
+
+import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationContext;
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.utils.filesystem.FileSystem;
+import org.apache.aries.sample.HelloWorld;
+import org.apache.aries.unittest.fixture.ArchiveFixture;
+import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+
+@RunWith(JUnit4TestRunner.class)
+public class BasicAppManagerTest extends AbstractIntegrationTest {
+
+ /* Use @Before not @BeforeClass so as to ensure that these resources
+ * are created in the paxweb temp directory, and not in the svn tree
+ */
+ static boolean createdApplications = false;
+ @Before
+ public static void createApplications() throws Exception {
+ if (createdApplications) {
+ return;
+ }
+ ZipFixture testEba = ArchiveFixture.newZip()
+ .jar("sample.jar")
+ .manifest().symbolicName("org.apache.aries.sample")
+ .attribute("Bundle-Version", "1.0.0")
+ .attribute("Import-Package", "org.apache.aries.sample")
+ .end()
+ .binary("org/apache/aries/sample/impl/HelloWorldImpl.class",
+ BasicAppManagerTest.class.getClassLoader().getResourceAsStream("org/apache/aries/sample/impl/HelloWorldImpl.class"))
+ .binary("OSGI-INF/blueprint/sample-blueprint.xml",
+ BasicAppManagerTest.class.getClassLoader().getResourceAsStream("basic/sample-blueprint.xml"))
+ .end();
+
+ FileOutputStream fout = new FileOutputStream("test.eba");
+ testEba.writeOut(fout);
+ fout.close();
+
+ ZipFixture testEba2 = testEba.binary("META-INF/APPLICATION.MF",
+ BasicAppManagerTest.class.getClassLoader().getResourceAsStream("basic/APPLICATION.MF"))
+ .end();
+ fout = new FileOutputStream("test2.eba");
+ testEba2.writeOut(fout);
+ fout.close();
+ createdApplications = true;
+ }
+
+ @Test
+ public void testAppWithoutApplicationManifest() throws Exception {
+
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = getOsgiService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals (result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Test
+ public void testAppWithApplicationManifest() throws Exception {
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = getOsgiService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals (result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+
+ @org.ops4j.pax.exam.junit.Configuration
+ public static Option[] configuration() {
+ Option[] options = options(
+ // Log
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+ // Felix Config Admin
+ mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+ // Felix mvn url handler
+ mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+ // this is how you set the default log level when using pax
+ // logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ 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.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.apache.aries", "org.apache.aries.util"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
+ mavenBundle("org.osgi", "org.osgi.compendium"),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
+
+ /* For debugging, uncomment the next two lines
+ vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
+ waitForFrameworkStartup(),
+
+ and add these imports:
+ import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
+ import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+ */
+
+ equinox().version("3.5.0"));
+ options = updateOptions(options);
+ return options;
+ }
+}
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java Mon Jun 7 20:05:41 2010
@@ -1,160 +1,160 @@
-/*
- * 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 org.apache.aries.application.runtime.itests;
-
-import java.io.File;
-import java.io.FileOutputStream;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-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 org.apache.aries.application.management.AriesApplication;
-import org.apache.aries.application.management.AriesApplicationContext;
-import org.apache.aries.application.management.AriesApplicationManager;
-import org.apache.aries.application.utils.filesystem.FileSystem;
-import org.apache.aries.unittest.fixture.ArchiveFixture;
-import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.blueprint.container.BlueprintEvent;
-import org.osgi.service.blueprint.container.BlueprintListener;
-
-
-@RunWith(JUnit4TestRunner.class)
-public class MinimumImportsTest extends AbstractIntegrationTest {
-
- /* Use @Before not @BeforeClass so as to ensure that these resources
- * are created in the paxweb temp directory, and not in the svn tree
- */
- static boolean createdApplications = false;
- @Before
- public static void createApplications() throws Exception {
-
- if (createdApplications) {
- return;
- }
- ZipFixture testEba = ArchiveFixture.newZip()
- .jar("org.apache.aries.application.itests.minimports.jar")
- .manifest().symbolicName("org.apache.aries.application.itests.minimports")
- .attribute("Bundle-Version", "1.0.0")
- .attribute("Import-Package", "org.apache.aries.application.management")
- .end()
- .binary("org/apache/aries/application/sample/appmgrclient/AppMgrClient.class",
- MinimumImportsTest.class.getClassLoader().getResourceAsStream("org/apache/aries/application/sample/appmgrclient/AppMgrClient.class"))
- .binary("OSGI-INF/blueprint/app-mgr-client.xml",
- MinimumImportsTest.class.getClassLoader().getResourceAsStream("app-mgr-client.xml"))
- .end();
-
- FileOutputStream fout = new FileOutputStream("appmgrclienttest.eba");
- testEba.writeOut(fout);
- fout.close();
-
- createdApplications = true;
- }
-
- public static class AppMgrClientBlueprintListener implements BlueprintListener {
-
- Boolean success = null;
-
- public void blueprintEvent(BlueprintEvent event) {
- if (event.getBundle().getSymbolicName().equals(
- "org.apache.aries.application.itests.minimports")) {
- if (event.getType() == event.FAILURE) {
- success = Boolean.FALSE;
- }
- if (event.getType() == event.CREATED) {
- success = Boolean.TRUE;
- }
- }
- }
- }
-
- @Test
- public void testAppUsingAriesApplicationManager() throws Exception {
-
- // Register a BlueprintListener to listen for the events from the BlueprintContainer for the bundle in the appmgrclienttest.eba
-
- AppMgrClientBlueprintListener acbl = new AppMgrClientBlueprintListener();
- ServiceRegistration sr = bundleContext.registerService("org.osgi.service.blueprint.container.BlueprintListener", acbl, null);
-
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("appmgrclienttest.eba")));
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- int sleepfor = 3000;
- while ((acbl.success == null || acbl.success == false) && sleepfor > 0) {
- Thread.sleep(100);
- sleepfor-=100;
- }
- assertNotNull("Timed out - didn't receive Blueprint CREATED or FAILURE event", acbl.success);
- assertTrue("Received Blueprint FAILURE event", acbl.success);
-
- ctx.stop();
- manager.uninstall(ctx);
- sr.unregister();
- }
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration() {
- Option[] options = options(
- // Log
- mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
- mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
- // Felix Config Admin
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
- // Felix mvn url handler
- mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
-
- // this is how you set the default log level when using pax
- // logging (logProfile)
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
-
- // Bundles
- 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.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.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
-
- /* For debugging, uncomment the next two lines
- vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
- waitForFrameworkStartup(),
-
- and add these imports:
- import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
- import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
- */
-
- equinox().version("3.5.0"));
- options = updateOptions(options);
- return options;
- }
-}
+/*
+ * 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 org.apache.aries.application.runtime.itests;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+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 org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationContext;
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.utils.filesystem.FileSystem;
+import org.apache.aries.unittest.fixture.ArchiveFixture;
+import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.blueprint.container.BlueprintEvent;
+import org.osgi.service.blueprint.container.BlueprintListener;
+
+
+@RunWith(JUnit4TestRunner.class)
+public class MinimumImportsTest extends AbstractIntegrationTest {
+
+ /* Use @Before not @BeforeClass so as to ensure that these resources
+ * are created in the paxweb temp directory, and not in the svn tree
+ */
+ static boolean createdApplications = false;
+ @Before
+ public static void createApplications() throws Exception {
+
+ if (createdApplications) {
+ return;
+ }
+ ZipFixture testEba = ArchiveFixture.newZip()
+ .jar("org.apache.aries.application.itests.minimports.jar")
+ .manifest().symbolicName("org.apache.aries.application.itests.minimports")
+ .attribute("Bundle-Version", "1.0.0")
+ .attribute("Import-Package", "org.apache.aries.application.management")
+ .end()
+ .binary("org/apache/aries/application/sample/appmgrclient/AppMgrClient.class",
+ MinimumImportsTest.class.getClassLoader().getResourceAsStream("org/apache/aries/application/sample/appmgrclient/AppMgrClient.class"))
+ .binary("OSGI-INF/blueprint/app-mgr-client.xml",
+ MinimumImportsTest.class.getClassLoader().getResourceAsStream("app-mgr-client.xml"))
+ .end();
+
+ FileOutputStream fout = new FileOutputStream("appmgrclienttest.eba");
+ testEba.writeOut(fout);
+ fout.close();
+
+ createdApplications = true;
+ }
+
+ public static class AppMgrClientBlueprintListener implements BlueprintListener {
+
+ Boolean success = null;
+
+ public void blueprintEvent(BlueprintEvent event) {
+ if (event.getBundle().getSymbolicName().equals(
+ "org.apache.aries.application.itests.minimports")) {
+ if (event.getType() == event.FAILURE) {
+ success = Boolean.FALSE;
+ }
+ if (event.getType() == event.CREATED) {
+ success = Boolean.TRUE;
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testAppUsingAriesApplicationManager() throws Exception {
+
+ // Register a BlueprintListener to listen for the events from the BlueprintContainer for the bundle in the appmgrclienttest.eba
+
+ AppMgrClientBlueprintListener acbl = new AppMgrClientBlueprintListener();
+ ServiceRegistration sr = bundleContext.registerService("org.osgi.service.blueprint.container.BlueprintListener", acbl, null);
+
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("appmgrclienttest.eba")));
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ int sleepfor = 3000;
+ while ((acbl.success == null || acbl.success == false) && sleepfor > 0) {
+ Thread.sleep(100);
+ sleepfor-=100;
+ }
+ assertNotNull("Timed out - didn't receive Blueprint CREATED or FAILURE event", acbl.success);
+ assertTrue("Received Blueprint FAILURE event", acbl.success);
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ sr.unregister();
+ }
+
+ @org.ops4j.pax.exam.junit.Configuration
+ public static Option[] configuration() {
+ Option[] options = options(
+ // Log
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+ // Felix Config Admin
+ mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+ // Felix mvn url handler
+ mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+ // this is how you set the default log level when using pax
+ // logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ 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.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.apache.aries", "org.apache.aries.util"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
+ mavenBundle("org.osgi", "org.osgi.compendium"),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
+
+ /* For debugging, uncomment the next two lines
+ vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006"),
+ waitForFrameworkStartup(),
+
+ and add these imports:
+ import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
+ import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;
+ */
+
+ equinox().version("3.5.0"));
+ options = updateOptions(options);
+ return options;
+ }
+}
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/MinimumImportsTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java Mon Jun 7 20:05:41 2010
@@ -1,186 +1,186 @@
-/*
- * 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 org.apache.aries.application.runtime.itests;
-
-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 java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.InputStreamReader;
-
-import org.apache.aries.application.management.AriesApplication;
-import org.apache.aries.application.management.AriesApplicationManager;
-import org.apache.aries.application.utils.filesystem.FileSystem;
-import org.apache.aries.unittest.fixture.ArchiveFixture;
-import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.service.obr.Capability;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.RepositoryAdmin;
-import org.osgi.service.obr.Resource;
-
-@RunWith(JUnit4TestRunner.class)
-public class OBRAppManagerTest extends AbstractIntegrationTest {
-
- /* Use @Before not @BeforeClass so as to ensure that these resources
- * are created in the paxweb temp directory, and not in the svn tree
- */
- static boolean createdApplications = false;
- @Before
- public static void createApplications() throws Exception {
- if (createdApplications) {
- return;
- }
- ZipFixture testBundle = ArchiveFixture.newZip()
- .manifest().symbolicName("org.apache.aries.sample")
- .attribute("Bundle-Version", "1.0.0")
- .attribute("Export-Package", "org.apache.aries.sample.impl")
- .end()
- .binary("org/apache/aries/sample/impl/HelloWorldImpl.class",
- OBRAppManagerTest.class.getClassLoader().getResourceAsStream("org/apache/aries/sample/impl/HelloWorldImpl.class"))
- .end();
-
- FileOutputStream fout = new FileOutputStream("bundle.jar");
- testBundle.writeOut(fout);
- fout.close();
-
- ZipFixture testEba = ArchiveFixture.newZip()
- .jar("sample.jar")
- .manifest().symbolicName("org.apache.aries.sample")
- .attribute("Bundle-Version", "1.0.0")
- .attribute("Import-Package", "org.apache.aries.sample.impl")
- .end()
- .binary("OSGI-INF/blueprint/sample-blueprint.xml",
- OBRAppManagerTest.class.getClassLoader().getResourceAsStream("basic/sample-blueprint.xml"))
- .end()
- .binary("META-INF/APPLICATION.MF",
- OBRAppManagerTest.class.getClassLoader().getResourceAsStream("basic/APPLICATION.MF"))
- .end();
- fout = new FileOutputStream("test.eba");
- testEba.writeOut(fout);
- fout.close();
-
- StringBuilder repositoryXML = new StringBuilder();
-
- BufferedReader reader = new BufferedReader(new InputStreamReader(OBRAppManagerTest.class.getResourceAsStream("/obr/repository.xml")));
- String line;
-
- while ((line = reader.readLine()) != null) {
- repositoryXML.append(line);
- repositoryXML.append("\r\n");
- }
-
- String repo = repositoryXML.toString().replaceAll("bundle_location", new File("bundle.jar").getAbsolutePath());
-
- System.out.println(repo);
-
- FileWriter writer = new FileWriter("repository.xml");
- writer.write(repo);
- writer.close();
-
- createdApplications = true;
- }
-
- @Test
- public void testAppWithApplicationManifest() throws Exception {
- RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
-
- repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
-
- Repository[] repos = repositoryAdmin.listRepositories();
-
- for (Repository repo : repos) {
- Resource[] resources = repo.getResources();
-
- for (Resource r : resources) {
- Capability[] cs = r.getCapabilities();
-
- for (Capability c : cs) {
- System.out.println(c.getName() + " : " + c.getProperties());
- }
- }
- }
-
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
- app = manager.resolve(app);
- //installing requires a valid url for the bundle in repository.xml.
-// ApplicationContext ctx = manager.install(app);
-// ctx.start();
-
-// HelloWorld hw = getOsgiService(HelloWorld.class);
-// String result = hw.getMessage();
-// assertEquals (result, "hello world");
-//
-// ctx.stop();
-// manager.uninstall(ctx);
- }
-
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration() {
- Option[] options = options(
- // Log
- mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
- mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
- // Felix Config Admin
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
- // Felix mvn url handler
- mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
-
- // this is how you set the default log level when using pax
- // logging (logProfile)
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
-
- // Bundles
- 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.management"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
- mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces"),
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
-
-// /* For debugging, uncomment the next two lines
-// vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
-// waitForFrameworkStartup(),
-
- /* 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;
- */
-
- equinox().version("3.5.0"));
- options = updateOptions(options);
- return options;
- }
+/*
+ * 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 org.apache.aries.application.runtime.itests;
+
+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 java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.InputStreamReader;
+
+import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.utils.filesystem.FileSystem;
+import org.apache.aries.unittest.fixture.ArchiveFixture;
+import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.service.obr.Capability;
+import org.osgi.service.obr.Repository;
+import org.osgi.service.obr.RepositoryAdmin;
+import org.osgi.service.obr.Resource;
+
+@RunWith(JUnit4TestRunner.class)
+public class OBRAppManagerTest extends AbstractIntegrationTest {
+
+ /* Use @Before not @BeforeClass so as to ensure that these resources
+ * are created in the paxweb temp directory, and not in the svn tree
+ */
+ static boolean createdApplications = false;
+ @Before
+ public static void createApplications() throws Exception {
+ if (createdApplications) {
+ return;
+ }
+ ZipFixture testBundle = ArchiveFixture.newZip()
+ .manifest().symbolicName("org.apache.aries.sample")
+ .attribute("Bundle-Version", "1.0.0")
+ .attribute("Export-Package", "org.apache.aries.sample.impl")
+ .end()
+ .binary("org/apache/aries/sample/impl/HelloWorldImpl.class",
+ OBRAppManagerTest.class.getClassLoader().getResourceAsStream("org/apache/aries/sample/impl/HelloWorldImpl.class"))
+ .end();
+
+ FileOutputStream fout = new FileOutputStream("bundle.jar");
+ testBundle.writeOut(fout);
+ fout.close();
+
+ ZipFixture testEba = ArchiveFixture.newZip()
+ .jar("sample.jar")
+ .manifest().symbolicName("org.apache.aries.sample")
+ .attribute("Bundle-Version", "1.0.0")
+ .attribute("Import-Package", "org.apache.aries.sample.impl")
+ .end()
+ .binary("OSGI-INF/blueprint/sample-blueprint.xml",
+ OBRAppManagerTest.class.getClassLoader().getResourceAsStream("basic/sample-blueprint.xml"))
+ .end()
+ .binary("META-INF/APPLICATION.MF",
+ OBRAppManagerTest.class.getClassLoader().getResourceAsStream("basic/APPLICATION.MF"))
+ .end();
+ fout = new FileOutputStream("test.eba");
+ testEba.writeOut(fout);
+ fout.close();
+
+ StringBuilder repositoryXML = new StringBuilder();
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(OBRAppManagerTest.class.getResourceAsStream("/obr/repository.xml")));
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ repositoryXML.append(line);
+ repositoryXML.append("\r\n");
+ }
+
+ String repo = repositoryXML.toString().replaceAll("bundle_location", new File("bundle.jar").getAbsolutePath());
+
+ System.out.println(repo);
+
+ FileWriter writer = new FileWriter("repository.xml");
+ writer.write(repo);
+ writer.close();
+
+ createdApplications = true;
+ }
+
+ @Test
+ public void testAppWithApplicationManifest() throws Exception {
+ RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
+
+ repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
+
+ Repository[] repos = repositoryAdmin.listRepositories();
+
+ for (Repository repo : repos) {
+ Resource[] resources = repo.getResources();
+
+ for (Resource r : resources) {
+ Capability[] cs = r.getCapabilities();
+
+ for (Capability c : cs) {
+ System.out.println(c.getName() + " : " + c.getProperties());
+ }
+ }
+ }
+
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
+ app = manager.resolve(app);
+ //installing requires a valid url for the bundle in repository.xml.
+// ApplicationContext ctx = manager.install(app);
+// ctx.start();
+
+// HelloWorld hw = getOsgiService(HelloWorld.class);
+// String result = hw.getMessage();
+// assertEquals (result, "hello world");
+//
+// ctx.stop();
+// manager.uninstall(ctx);
+ }
+
+
+ @org.ops4j.pax.exam.junit.Configuration
+ public static Option[] configuration() {
+ Option[] options = options(
+ // Log
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+ // Felix Config Admin
+ mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+ // Felix mvn url handler
+ mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+ // this is how you set the default log level when using pax
+ // logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ 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.management"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
+ mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces"),
+ mavenBundle("org.apache.aries", "org.apache.aries.util"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
+ mavenBundle("org.osgi", "org.osgi.compendium"),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
+
+// /* For debugging, uncomment the next two lines
+// vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
+// waitForFrameworkStartup(),
+
+ /* 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;
+ */
+
+ equinox().version("3.5.0"));
+ options = updateOptions(options);
+ return options;
+ }
}
\ No newline at end of file
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRAppManagerTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java Mon Jun 7 20:05:41 2010
@@ -1,283 +1,283 @@
-/*
- * 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 org.apache.aries.application.runtime.itests;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-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 java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.lang.reflect.Constructor;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.aries.application.ApplicationMetadataFactory;
-import org.apache.aries.application.DeploymentContent;
-import org.apache.aries.application.DeploymentMetadata;
-import org.apache.aries.application.management.AriesApplication;
-import org.apache.aries.application.management.AriesApplicationContext;
-import org.apache.aries.application.management.AriesApplicationManager;
-import org.apache.aries.application.management.BundleInfo;
-import org.apache.aries.application.management.ResolverException;
-import org.apache.aries.application.resolver.obr.generator.RepositoryDescriptorGenerator;
-import org.apache.aries.application.utils.filesystem.FileSystem;
-import org.apache.aries.application.utils.manifest.BundleManifest;
-import org.apache.aries.unittest.fixture.ArchiveFixture;
-import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-import org.osgi.service.obr.Repository;
-import org.osgi.service.obr.RepositoryAdmin;
-import org.w3c.dom.Document;
-
-@RunWith(JUnit4TestRunner.class)
-public class OBRResolverTest extends AbstractIntegrationTest
-{
- public static final String CORE_BUNDLE_BY_VALUE = "core.bundle.by.value";
- public static final String CORE_BUNDLE_BY_REFERENCE = "core.bundle.by.reference";
- public static final String TRANSITIVE_BUNDLE_BY_VALUE = "transitive.bundle.by.reference";
- public static final String TRANSITIVE_BUNDLE_BY_REFERENCE = "transitive.bundle.by.value";
-
-
- /* Use @Before not @BeforeClass so as to ensure that these resources
- * are created in the paxweb temp directory, and not in the svn tree
- */
- @Before
- public static void createApplications() throws Exception
- {
- ZipFixture bundle = ArchiveFixture.newJar().manifest()
- .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_VALUE)
- .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
- .attribute(Constants.IMPORT_PACKAGE, "p.q.r, x.y.z")
- .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
-
-
- FileOutputStream fout = new FileOutputStream(CORE_BUNDLE_BY_VALUE + ".jar");
- bundle.writeOut(fout);
- fout.close();
-
- bundle = ArchiveFixture.newJar().manifest()
- .attribute(Constants.BUNDLE_SYMBOLICNAME, TRANSITIVE_BUNDLE_BY_VALUE)
- .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
- .attribute(Constants.EXPORT_PACKAGE, "p.q.r")
- .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
-
- fout = new FileOutputStream(TRANSITIVE_BUNDLE_BY_VALUE + ".jar");
- bundle.writeOut(fout);
- fout.close();
-
- bundle = ArchiveFixture.newJar().manifest()
- .attribute(Constants.BUNDLE_SYMBOLICNAME, TRANSITIVE_BUNDLE_BY_REFERENCE)
- .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
- .attribute(Constants.EXPORT_PACKAGE, "x.y.z")
- .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
-
- fout = new FileOutputStream(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar");
- bundle.writeOut(fout);
- fout.close();
-
- bundle = ArchiveFixture.newJar().manifest()
- .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_REFERENCE)
- .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
- .attribute(Constants.EXPORT_PACKAGE, "d.e.f")
- .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
-
- fout = new FileOutputStream(CORE_BUNDLE_BY_REFERENCE + ".jar");
- bundle.writeOut(fout);
- fout.close();
-
- bundle = ArchiveFixture.newJar().manifest()
- .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_REFERENCE)
- .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
- .attribute(Constants.EXPORT_PACKAGE, "d.e.f").end();
-
- fout = new FileOutputStream(CORE_BUNDLE_BY_REFERENCE + "_0.0.0.jar");
- bundle.writeOut(fout);
- fout.close();
-
- ZipFixture testEba = ArchiveFixture.newZip()
- .binary("META-INF/APPLICATION.MF",
- OBRResolverTest.class.getClassLoader().getResourceAsStream("obr/APPLICATION.MF"))
- .end()
- .binary(CORE_BUNDLE_BY_VALUE + ".jar", new FileInputStream(CORE_BUNDLE_BY_VALUE + ".jar")).end()
- .binary(TRANSITIVE_BUNDLE_BY_VALUE + ".jar", new FileInputStream(TRANSITIVE_BUNDLE_BY_VALUE + ".jar")).end();
-
- fout = new FileOutputStream("blog.eba");
- testEba.writeOut(fout);
- fout.close();
- }
-
- @Test(expected=ResolverException.class)
- public void testBlogAppResolveFail() throws ResolverException, Exception
- {
- generateOBRRepoXML(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar", CORE_BUNDLE_BY_REFERENCE + "_0.0.0.jar");
-
- RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
-
- Repository[] repos = repositoryAdmin.listRepositories();
- for (Repository repo : repos) {
- repositoryAdmin.removeRepository(repo.getURL());
- }
-
- repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
-
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
- //installing requires a valid url for the bundle in repository.xml.
-
- app = manager.resolve(app);
- }
-
- @Test
- public void testBlogApp() throws Exception
- {
- generateOBRRepoXML(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar", CORE_BUNDLE_BY_REFERENCE + ".jar");
-
- RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
-
- Repository[] repos = repositoryAdmin.listRepositories();
- for (Repository repo : repos) {
- repositoryAdmin.removeRepository(repo.getURL());
- }
-
- repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
-
- AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
- //installing requires a valid url for the bundle in repository.xml.
-
- app = manager.resolve(app);
-
- DeploymentMetadata depMeta = app.getDeploymentMetadata();
-
- List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
-
- assertEquals(provision.toString(), 2, provision.size());
-
- List<String> bundleSymbolicNames = new ArrayList<String>();
-
- for (DeploymentContent dep : provision) {
- bundleSymbolicNames.add(dep.getContentName());
- }
-
- assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_REFERENCE));
- assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_VALUE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_VALUE));
-
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- Set<Bundle> bundles = ctx.getApplicationContent();
-
- assertEquals("Number of bundles provisioned in the app", 4, bundles.size());
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
-
- private void generateOBRRepoXML(String ... bundleFiles) throws Exception
- {
- Set<BundleInfo> bundles = new HashSet<BundleInfo>();
-
- for (String file : bundleFiles) {
- bundles.add(createBundleInfo(new File(file).toURI().toURL().toExternalForm()));
- }
-
- Document doc = RepositoryDescriptorGenerator.generateRepositoryDescriptor("Test repo description", bundles);
-
- FileOutputStream fout = new FileOutputStream("repository.xml");
-
- TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(fout));
-
- fout.close();
-
- TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(System.out));
- }
-
- private BundleInfo createBundleInfo(String urlToBundle) throws Exception
- {
- ApplicationMetadataFactory factory = getOsgiService(ApplicationMetadataFactory.class);
-
- Bundle b = getBundle("org.apache.aries.application.management");
- @SuppressWarnings("unchecked")
- Class<BundleInfo> clazz = b.loadClass("org.apache.aries.application.utils.management.SimpleBundleInfo");
- Constructor<BundleInfo> c = clazz.getConstructor(ApplicationMetadataFactory.class, BundleManifest.class, String.class);
-
- return c.newInstance(factory, BundleManifest.fromBundle(new URL(urlToBundle).openStream()), urlToBundle);
- }
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration() {
- Option[] options = options(
- // Log
- mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
- mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
- // Felix Config Admin
- mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
- // Felix mvn url handler
- mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
-
- // this is how you set the default log level when using pax
- // logging (logProfile)
- systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
-
- // Bundles
- 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.management"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
- mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces"),
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("org.osgi", "org.osgi.compendium"),
- mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
-
- /* For debugging, uncomment the next two lines */
-// vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"),
-// waitForFrameworkStartup(),
-
- /* 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;
- */
-
- equinox().version("3.5.0"));
- options = updateOptions(options);
- return options;
- }
+/*
+ * 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 org.apache.aries.application.runtime.itests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+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 java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.lang.reflect.Constructor;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.aries.application.ApplicationMetadataFactory;
+import org.apache.aries.application.DeploymentContent;
+import org.apache.aries.application.DeploymentMetadata;
+import org.apache.aries.application.management.AriesApplication;
+import org.apache.aries.application.management.AriesApplicationContext;
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.management.BundleInfo;
+import org.apache.aries.application.management.ResolverException;
+import org.apache.aries.application.resolver.obr.generator.RepositoryDescriptorGenerator;
+import org.apache.aries.application.utils.filesystem.FileSystem;
+import org.apache.aries.application.utils.manifest.BundleManifest;
+import org.apache.aries.unittest.fixture.ArchiveFixture;
+import org.apache.aries.unittest.fixture.ArchiveFixture.ZipFixture;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.JUnit4TestRunner;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+import org.osgi.service.obr.Repository;
+import org.osgi.service.obr.RepositoryAdmin;
+import org.w3c.dom.Document;
+
+@RunWith(JUnit4TestRunner.class)
+public class OBRResolverTest extends AbstractIntegrationTest
+{
+ public static final String CORE_BUNDLE_BY_VALUE = "core.bundle.by.value";
+ public static final String CORE_BUNDLE_BY_REFERENCE = "core.bundle.by.reference";
+ public static final String TRANSITIVE_BUNDLE_BY_VALUE = "transitive.bundle.by.reference";
+ public static final String TRANSITIVE_BUNDLE_BY_REFERENCE = "transitive.bundle.by.value";
+
+
+ /* Use @Before not @BeforeClass so as to ensure that these resources
+ * are created in the paxweb temp directory, and not in the svn tree
+ */
+ @Before
+ public static void createApplications() throws Exception
+ {
+ ZipFixture bundle = ArchiveFixture.newJar().manifest()
+ .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_VALUE)
+ .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
+ .attribute(Constants.IMPORT_PACKAGE, "p.q.r, x.y.z")
+ .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
+
+
+ FileOutputStream fout = new FileOutputStream(CORE_BUNDLE_BY_VALUE + ".jar");
+ bundle.writeOut(fout);
+ fout.close();
+
+ bundle = ArchiveFixture.newJar().manifest()
+ .attribute(Constants.BUNDLE_SYMBOLICNAME, TRANSITIVE_BUNDLE_BY_VALUE)
+ .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
+ .attribute(Constants.EXPORT_PACKAGE, "p.q.r")
+ .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
+
+ fout = new FileOutputStream(TRANSITIVE_BUNDLE_BY_VALUE + ".jar");
+ bundle.writeOut(fout);
+ fout.close();
+
+ bundle = ArchiveFixture.newJar().manifest()
+ .attribute(Constants.BUNDLE_SYMBOLICNAME, TRANSITIVE_BUNDLE_BY_REFERENCE)
+ .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
+ .attribute(Constants.EXPORT_PACKAGE, "x.y.z")
+ .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
+
+ fout = new FileOutputStream(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar");
+ bundle.writeOut(fout);
+ fout.close();
+
+ bundle = ArchiveFixture.newJar().manifest()
+ .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_REFERENCE)
+ .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
+ .attribute(Constants.EXPORT_PACKAGE, "d.e.f")
+ .attribute(Constants.BUNDLE_VERSION, "1.0.0").end();
+
+ fout = new FileOutputStream(CORE_BUNDLE_BY_REFERENCE + ".jar");
+ bundle.writeOut(fout);
+ fout.close();
+
+ bundle = ArchiveFixture.newJar().manifest()
+ .attribute(Constants.BUNDLE_SYMBOLICNAME, CORE_BUNDLE_BY_REFERENCE)
+ .attribute(Constants.BUNDLE_MANIFESTVERSION, "2")
+ .attribute(Constants.EXPORT_PACKAGE, "d.e.f").end();
+
+ fout = new FileOutputStream(CORE_BUNDLE_BY_REFERENCE + "_0.0.0.jar");
+ bundle.writeOut(fout);
+ fout.close();
+
+ ZipFixture testEba = ArchiveFixture.newZip()
+ .binary("META-INF/APPLICATION.MF",
+ OBRResolverTest.class.getClassLoader().getResourceAsStream("obr/APPLICATION.MF"))
+ .end()
+ .binary(CORE_BUNDLE_BY_VALUE + ".jar", new FileInputStream(CORE_BUNDLE_BY_VALUE + ".jar")).end()
+ .binary(TRANSITIVE_BUNDLE_BY_VALUE + ".jar", new FileInputStream(TRANSITIVE_BUNDLE_BY_VALUE + ".jar")).end();
+
+ fout = new FileOutputStream("blog.eba");
+ testEba.writeOut(fout);
+ fout.close();
+ }
+
+ @Test(expected=ResolverException.class)
+ public void testBlogAppResolveFail() throws ResolverException, Exception
+ {
+ generateOBRRepoXML(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar", CORE_BUNDLE_BY_REFERENCE + "_0.0.0.jar");
+
+ RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
+
+ Repository[] repos = repositoryAdmin.listRepositories();
+ for (Repository repo : repos) {
+ repositoryAdmin.removeRepository(repo.getURL());
+ }
+
+ repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
+
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
+ //installing requires a valid url for the bundle in repository.xml.
+
+ app = manager.resolve(app);
+ }
+
+ @Test
+ public void testBlogApp() throws Exception
+ {
+ generateOBRRepoXML(TRANSITIVE_BUNDLE_BY_REFERENCE + ".jar", CORE_BUNDLE_BY_REFERENCE + ".jar");
+
+ RepositoryAdmin repositoryAdmin = getOsgiService(RepositoryAdmin.class);
+
+ Repository[] repos = repositoryAdmin.listRepositories();
+ for (Repository repo : repos) {
+ repositoryAdmin.removeRepository(repo.getURL());
+ }
+
+ repositoryAdmin.addRepository(new File("repository.xml").toURI().toURL());
+
+ AriesApplicationManager manager = getOsgiService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("blog.eba")));
+ //installing requires a valid url for the bundle in repository.xml.
+
+ app = manager.resolve(app);
+
+ DeploymentMetadata depMeta = app.getDeploymentMetadata();
+
+ List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
+
+ assertEquals(provision.toString(), 2, provision.size());
+
+ List<String> bundleSymbolicNames = new ArrayList<String>();
+
+ for (DeploymentContent dep : provision) {
+ bundleSymbolicNames.add(dep.getContentName());
+ }
+
+ assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_REFERENCE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_REFERENCE));
+ assertTrue("Bundle " + TRANSITIVE_BUNDLE_BY_VALUE + " not found.", bundleSymbolicNames.contains(TRANSITIVE_BUNDLE_BY_VALUE));
+
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ Set<Bundle> bundles = ctx.getApplicationContent();
+
+ assertEquals("Number of bundles provisioned in the app", 4, bundles.size());
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+
+ private void generateOBRRepoXML(String ... bundleFiles) throws Exception
+ {
+ Set<BundleInfo> bundles = new HashSet<BundleInfo>();
+
+ for (String file : bundleFiles) {
+ bundles.add(createBundleInfo(new File(file).toURI().toURL().toExternalForm()));
+ }
+
+ Document doc = RepositoryDescriptorGenerator.generateRepositoryDescriptor("Test repo description", bundles);
+
+ FileOutputStream fout = new FileOutputStream("repository.xml");
+
+ TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(fout));
+
+ fout.close();
+
+ TransformerFactory.newInstance().newTransformer().transform(new DOMSource(doc), new StreamResult(System.out));
+ }
+
+ private BundleInfo createBundleInfo(String urlToBundle) throws Exception
+ {
+ ApplicationMetadataFactory factory = getOsgiService(ApplicationMetadataFactory.class);
+
+ Bundle b = getBundle("org.apache.aries.application.management");
+ @SuppressWarnings("unchecked")
+ Class<BundleInfo> clazz = b.loadClass("org.apache.aries.application.utils.management.SimpleBundleInfo");
+ Constructor<BundleInfo> c = clazz.getConstructor(ApplicationMetadataFactory.class, BundleManifest.class, String.class);
+
+ return c.newInstance(factory, BundleManifest.fromBundle(new URL(urlToBundle).openStream()), urlToBundle);
+ }
+
+ @org.ops4j.pax.exam.junit.Configuration
+ public static Option[] configuration() {
+ Option[] options = options(
+ // Log
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api"),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service"),
+ // Felix Config Admin
+ mavenBundle("org.apache.felix", "org.apache.felix.configadmin"),
+ // Felix mvn url handler
+ mavenBundle("org.ops4j.pax.url", "pax-url-mvn"),
+
+ // this is how you set the default log level when using pax
+ // logging (logProfile)
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ 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.management"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr"),
+ mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository"),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces"),
+ mavenBundle("org.apache.aries", "org.apache.aries.util"),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
+ mavenBundle("org.osgi", "org.osgi.compendium"),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit"),
+
+ /* For debugging, uncomment the next two lines */
+// vmOption ("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777"),
+// waitForFrameworkStartup(),
+
+ /* 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;
+ */
+
+ equinox().version("3.5.0"));
+ options = updateOptions(options);
+ return options;
+ }
}
\ No newline at end of file
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/OBRResolverTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java Mon Jun 7 20:05:41 2010
@@ -1,46 +1,46 @@
-/*
- * 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 WARRANTIESOR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.aries.application.sample.appmgrclient;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.apache.aries.application.management.AriesApplicationManager;
-import org.apache.aries.application.management.ManagementException;
-
-public class AppMgrClient
-{
- private AriesApplicationManager applicationManager;
-
- public AriesApplicationManager getApplicationManager()
- {
- return applicationManager;
- }
-
- public void setApplicationManager(AriesApplicationManager applicationManager)
- {
- this.applicationManager = applicationManager;
- }
-
- public void doSomething() throws MalformedURLException, ManagementException
- {
- applicationManager.createApplication(new URL("foo"));
- }
-
-}
+/*
+ * 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 WARRANTIESOR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.aries.application.sample.appmgrclient;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.aries.application.management.AriesApplicationManager;
+import org.apache.aries.application.management.ManagementException;
+
+public class AppMgrClient
+{
+ private AriesApplicationManager applicationManager;
+
+ public AriesApplicationManager getApplicationManager()
+ {
+ return applicationManager;
+ }
+
+ public void setApplicationManager(AriesApplicationManager applicationManager)
+ {
+ this.applicationManager = applicationManager;
+ }
+
+ public void doSomething() throws MalformedURLException, ManagementException
+ {
+ applicationManager.createApplication(new URL("foo"));
+ }
+
+}
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/application/sample/appmgrclient/AppMgrClient.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java (original)
+++ incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java Mon Jun 7 20:05:41 2010
@@ -1,29 +1,29 @@
-/*
- * 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 org.apache.aries.sample.impl;
-
-import org.apache.aries.sample.HelloWorld;
-
-public class HelloWorldImpl implements HelloWorld {
-
- public String getMessage() {
- return "hello world";
- }
-
-}
+/*
+ * 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 org.apache.aries.sample.impl;
+
+import org.apache.aries.sample.HelloWorld;
+
+public class HelloWorldImpl implements HelloWorld {
+
+ public String getMessage() {
+ return "hello world";
+ }
+
+}
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/java/org/apache/aries/sample/impl/HelloWorldImpl.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml (original)
+++ incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml Mon Jun 7 20:05:41 2010
@@ -1,28 +1,28 @@
-<?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.
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <reference id="app-manager" interface="org.apache.aries.application.management.AriesApplicationManager"/>
-
- <bean id="app-mgr-client" class="org.apache.aries.application.sample.appmgrclient.AppMgrClient" scope="singleton" activation="lazy">
- <property name="applicationManager" ref="app-manager"/>
- </bean>
-
-</blueprint>
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <reference id="app-manager" interface="org.apache.aries.application.management.AriesApplicationManager"/>
+
+ <bean id="app-mgr-client" class="org.apache.aries.application.sample.appmgrclient.AppMgrClient" scope="singleton" activation="lazy">
+ <property name="applicationManager" ref="app-manager"/>
+ </bean>
+
+</blueprint>
Propchange: incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: incubator/aries/trunk/application/application-itests/src/test/resources/app-mgr-client.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/aries/trunk/application/application-itests/src/test/resources/basic/sample-blueprint.xml
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-itests/src/test/resources/basic/sample-blueprint.xml?rev=952398&r1=952397&r2=952398&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-itests/src/test/resources/basic/sample-blueprint.xml (original)
+++ incubator/aries/trunk/application/application-itests/src/test/resources/basic/sample-blueprint.xml Mon Jun 7 20:05:41 2010
@@ -1,25 +1,25 @@
-<?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.
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
- <bean id="hello" class="org.apache.aries.sample.impl.HelloWorldImpl"/>
- <service interface="org.apache.aries.sample.HelloWorld" ref="hello" />
-
-</blueprint>
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+
+ <bean id="hello" class="org.apache.aries.sample.impl.HelloWorldImpl"/>
+ <service interface="org.apache.aries.sample.HelloWorld" ref="hello" />
+
+</blueprint>