You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by tj...@apache.org on 2014/06/30 18:55:06 UTC
svn commit: r1606837 [2/27] - in /aries/branches/subsystemsR6: ./
application/ application/application-api/ application/application-bundle/
application/application-converters/
application/application-default-local-platform/
application/application-depl...
Modified: aries/branches/subsystemsR6/application/application-isolated-distro/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/application/application-isolated-distro/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/application/application-isolated-distro/pom.xml (original)
+++ aries/branches/subsystemsR6/application/application-isolated-distro/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,31 +1,33 @@
<?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.
- -->
+<!--
+ 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.
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.aries</groupId>
- <artifactId>java5-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
-
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application-isolated-distro</artifactId>
<name>Application distribution for isolated application support</name>
@@ -38,7 +40,6 @@
<url>http://svn.apache.org/viewvc/aries/trunk/application/application-isolated-distro</url>
</scm>
-
<dependencies>
<dependency>
<groupId>org.apache.aries.application</groupId>
@@ -123,4 +124,5 @@
</plugin>
</plugins>
</build>
+
</project>
Modified: aries/branches/subsystemsR6/application/application-itest-interface/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/application/application-itest-interface/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/application/application-itest-interface/pom.xml (original)
+++ aries/branches/subsystemsR6/application/application-itest-interface/pom.xml Mon Jun 30 16:54:57 2014
@@ -1,3 +1,4 @@
+<?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
@@ -17,12 +18,14 @@
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.aries</groupId>
- <artifactId>java6-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
<groupId>org.apache.aries.application</groupId>
@@ -34,19 +37,17 @@
Interface class(es) for aplication runtime itests.
</description>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/application/application-itest-interface</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/application/application-itest-interface</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/trunk/application/application-itest-interface</url>
- </scm>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/application/application-itest-interface</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/application/application-itest-interface</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/trunk/application/application-itest-interface</url>
+ </scm>
<properties>
<!-- Export package versions are maintained in packageinfo files -->
-
<aries.osgi.export.pkg>
org.apache.aries.sample
</aries.osgi.export.pkg>
-
<aries.osgi.private.pkg />
</properties>
Modified: aries/branches/subsystemsR6/application/application-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/application/application-itests/pom.xml?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/application/application-itests/pom.xml (original)
+++ aries/branches/subsystemsR6/application/application-itests/pom.xml Mon Jun 30 16:54:57 2014
@@ -18,14 +18,16 @@
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.aries</groupId>
- <artifactId>java6-parent</artifactId>
- <version>1.0.0</version>
- <relativePath />
+ <artifactId>parent</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <relativePath>../../parent/pom.xml</relativePath>
</parent>
-
- <modelVersion>4.0.0</modelVersion>
+
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.isolated.itests</artifactId>
<packaging>jar</packaging>
@@ -35,57 +37,27 @@
Integration tests for the Application runtime
</description>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/application/application-itests</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/application/application-itests</developerConnection>
- <url>http://svn.apache.org/viewvc/aries/trunk/application/application-itests</url>
- </scm>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/application/application-itests</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/aries/trunk/application/application-itests</developerConnection>
+ <url>http://svn.apache.org/viewvc/aries/trunk/application/application-itests</url>
+ </scm>
<dependencies>
+ <!-- framework -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
+ <artifactId>org.osgi.compendium</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <version>1.2.4</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- </exclusion>
- </exclusions>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ <version>3.8.0.v20120529-1548</version>
+ <scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.aries</groupId>
- <artifactId>org.apache.aries.util</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.aries.blueprint</groupId>
- <artifactId>org.apache.aries.blueprint</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.aries.proxy</groupId>
- <artifactId>org.apache.aries.proxy</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-all</artifactId>
- <version>4.0</version>
- <scope>test</scope>
- </dependency>
+
+ <!-- logging -->
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
@@ -96,26 +68,61 @@
<artifactId>pax-logging-service</artifactId>
<scope>test</scope>
</dependency>
+
+ <!-- pax exam -->
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam</artifactId>
+ <version>3.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-default</artifactId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <version>3.4.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.ops4j.pax.url</groupId>
- <artifactId>pax-url-mvn</artifactId>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-native</artifactId>
+ <version>3.4.0</version>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-link-mvn</artifactId>
+ <version>3.4.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-aether</artifactId>
+ <version>1.6.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.testsupport</groupId>
+ <artifactId>org.apache.aries.testsupport.unit</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- bundles -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <version>1.2.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
@@ -123,73 +130,83 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
+ <groupId>org.apache.aries</groupId>
+ <artifactId>org.apache.aries.util</artifactId>
+ <version>1.0.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>org.apache.aries.blueprint</artifactId>
+ <version>1.0.0</version>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.proxy</groupId>
+ <artifactId>org.apache.aries.proxy</artifactId>
+ <version>1.0.2-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-all</artifactId>
+ <version>5.0.3</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.utils</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.itest.interfaces</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.management</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.framework</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.framework.management</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.repository</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime.isolated</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.runtime</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.resolver.obr</artifactId>
<version>1.0.0</version>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.apache.aries.application</groupId>
<artifactId>org.apache.aries.application.resolver.noop</artifactId>
@@ -214,24 +231,11 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.aries.testsupport</groupId>
- <artifactId>org.apache.aries.testsupport.unit</artifactId>
- <version>1.0.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.5.0.v20090520</version>
- <type>jar</type>
- <scope>test</scope>
- </dependency>
</dependencies>
<build>
@@ -267,26 +271,6 @@
</includes>
</configuration>
</plugin>
- <plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <version>1.2.3</version>
- <executions>
- <execution>
- <id>generate-config</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>generate-config</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <options>
- <platform>equinox</platform>
- <version>3.8.0.V20120529-1548</version>
- </options>
- </configuration>
- </plugin>
</plugins>
</build>
@@ -314,65 +298,6 @@
</plugins>
</build>
</profile>
- <profile>
- <id>equinox35</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <version>1.2.3</version>
- <executions>
- <execution>
- <id>generate-config</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>generate-config</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <options>
- <platform>equinox</platform>
- <version>3.5.0</version>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>equinox37</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>maven-paxexam-plugin</artifactId>
- <version>1.2.3</version>
- <executions>
- <execution>
- <id>generate-config</id>
- <phase>process-test-resources</phase>
- <goals>
- <goal>generate-config</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <options>
- <platform>equinox</platform>
- <version>3.7.0.v20110613</version>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
</profiles>
+
</project>
Modified: aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java (original)
+++ aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicAppManagerTest.java Mon Jun 30 16:54:57 2014
@@ -18,10 +18,8 @@
*/
package org.apache.aries.application.runtime.itests;
-import static org.apache.aries.itest.ExtraOptions.mavenBundle;
-import static org.apache.aries.itest.ExtraOptions.paxLogging;
-import static org.apache.aries.itest.ExtraOptions.testOptions;
import static org.junit.Assert.assertEquals;
+import static org.ops4j.pax.exam.CoreOptions.*;
import java.io.File;
import java.io.FileOutputStream;
@@ -37,150 +35,144 @@ import org.apache.aries.util.filesystem.
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.junit.MavenConfiguredJUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
-@RunWith(MavenConfiguredJUnit4TestRunner.class)
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.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;
+
+ /* 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 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 = context().getService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
+
+ // application name should be equal to eba name since application.mf is not provided
+ assertEquals("test.eba", app.getApplicationMetadata().getApplicationName());
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = context().getService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals(result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Test
+ public void testAppWithApplicationManifest() throws Exception {
+ AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
+
+ // application name should equal to whatever Application name provided in the application.mf
+ assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
+
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = context().getService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals(result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Test
+ public void testAppStore() throws Exception {
+ AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
+ app = manager.resolve(app);
+
+ app.store(new FileOutputStream("test2-resolved.eba"));
+
+ app = manager.createApplication(FileSystem.getFSRoot(new File("test2-resolved.eba")));
+
+ // application name should equal to whatever Application name provided in the application.mf
+ assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
+
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = context().getService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals(result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Configuration
+ public static Option[] configuration() {
+ return options(
+
+ // framework / core bundles
+ mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
+ mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
+
+ // Logging
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
+
+ // Bundles
+ junitBundles(),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.management").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.default.local.platform").versionAsInProject(),
+ mavenBundle("org.apache.felix", "org.apache.felix.bundlerepository").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.obr").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces").versionAsInProject(),
+ mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),
+ mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+ mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").versionAsInProject()
+ );
}
- 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 = context().getService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
-
- // application name should be equal to eba name since application.mf is not provided
- assertEquals("test.eba", app.getApplicationMetadata().getApplicationName());
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = context().getService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
- @Test
- public void testAppWithApplicationManifest() throws Exception {
- AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
-
- // application name should equal to whatever Application name provided in the application.mf
- assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
-
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = context().getService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
- @Test
- public void testAppStore() throws Exception {
- AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
- app = manager.resolve(app);
-
- app.store(new FileOutputStream("test2-resolved.eba"));
-
- app = manager.createApplication(FileSystem.getFSRoot(new File("test2-resolved.eba")));
-
- // application name should equal to whatever Application name provided in the application.mf
- assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
-
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = context().getService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
-
- private static Option[] generalConfiguration() {
- return testOptions(
- paxLogging("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.deployment.management"),
- mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller"),
- 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.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.runtime.itest.interfaces"),
- mavenBundle("org.apache.aries", "org.apache.aries.util"),
- mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint"),
- mavenBundle("org.ow2.asm", "asm-all"),
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy"),
- mavenBundle("org.osgi", "org.osgi.compendium"));
-
-
- /* 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;
- */
-
- }
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration()
- {
- return testOptions(
- generalConfiguration(),
- PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties")
- );
- }
}
Modified: aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicNoOpResolverTest.java
URL: http://svn.apache.org/viewvc/aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicNoOpResolverTest.java?rev=1606837&r1=1606836&r2=1606837&view=diff
==============================================================================
--- aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicNoOpResolverTest.java (original)
+++ aries/branches/subsystemsR6/application/application-itests/src/test/java/org/apache/aries/application/runtime/itests/BasicNoOpResolverTest.java Mon Jun 30 16:54:57 2014
@@ -18,9 +18,7 @@
*/
package org.apache.aries.application.runtime.itests;
-import static org.apache.aries.itest.ExtraOptions.mavenBundle;
-import static org.apache.aries.itest.ExtraOptions.paxLogging;
-import static org.apache.aries.itest.ExtraOptions.testOptions;
+import static org.ops4j.pax.exam.CoreOptions.*;
import static org.junit.Assert.assertEquals;
import java.io.File;
@@ -37,125 +35,119 @@ import org.apache.aries.util.filesystem.
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
-import org.ops4j.pax.exam.junit.MavenConfiguredJUnit4TestRunner;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
-@RunWith(MavenConfiguredJUnit4TestRunner.class)
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
public class BasicNoOpResolverTest 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;
+
+ /* 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 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 = context().getService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
+
+ // application name should be equal to eba name since application.mf is not provided
+ assertEquals("test.eba", app.getApplicationMetadata().getApplicationName());
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = context().getService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals(result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Test
+ public void testAppWithApplicationManifest() throws Exception {
+ AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
+ AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
+
+ // application name should equal to whatever Application name provided in the application.mf
+ assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
+
+ AriesApplicationContext ctx = manager.install(app);
+ ctx.start();
+
+ HelloWorld hw = context().getService(HelloWorld.class);
+ String result = hw.getMessage();
+ assertEquals(result, "hello world");
+
+ ctx.stop();
+ manager.uninstall(ctx);
+ }
+
+ @Configuration
+ public static Option[] configuration() {
+ return options(
+
+ // framework / core bundles
+ mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
+ mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-api").versionAsInProject(),
+ mavenBundle("org.ops4j.pax.logging", "pax-logging-service").versionAsInProject(),
+
+ // Logging
+ systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+
+ // Bundles
+ junitBundles(),
+ mavenBundle("org.apache.aries.testsupport", "org.apache.aries.testsupport.unit").versionAsInProject(),
+ mavenBundle("org.osgi", "org.osgi.compendium").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.api").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.utils").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.deployment.management").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.modeller").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.default.local.platform").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.management").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.resolver.noop").versionAsInProject(),
+ mavenBundle("org.apache.aries.application", "org.apache.aries.application.runtime.itest.interfaces").versionAsInProject(),
+ mavenBundle("org.apache.aries", "org.apache.aries.util").versionAsInProject(),
+ mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint").versionAsInProject(),
+ mavenBundle("org.ow2.asm", "asm-all").versionAsInProject(),
+ mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy").versionAsInProject());
}
- 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 = context().getService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test.eba")));
-
- // application name should be equal to eba name since application.mf is not provided
- assertEquals("test.eba", app.getApplicationMetadata().getApplicationName());
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = context().getService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
- @Test
- public void testAppWithApplicationManifest() throws Exception {
- AriesApplicationManager manager = context().getService(AriesApplicationManager.class);
- AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("test2.eba")));
-
- // application name should equal to whatever Application name provided in the application.mf
- assertEquals("test application 2", app.getApplicationMetadata().getApplicationName());
-
- AriesApplicationContext ctx = manager.install(app);
- ctx.start();
-
- HelloWorld hw = context().getService(HelloWorld.class);
- String result = hw.getMessage();
- assertEquals (result, "hello world");
-
- ctx.stop();
- manager.uninstall(ctx);
- }
-
-
- private static Option[] generalConfiguration() {
- return testOptions(
- paxLogging("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.deployment.management"),
- 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.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.noop"),
- 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.ow2.asm", "asm-all"),
- mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy"),
- mavenBundle("org.osgi", "org.osgi.compendium"));
-
-
- /* 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;
- */
-
- }
-
- @org.ops4j.pax.exam.junit.Configuration
- public static Option[] configuration()
- {
- return testOptions(
- generalConfiguration(),
- PaxRunnerOptions.rawPaxRunnerOption("config", "classpath:ss-runner.properties")
- );
- }
}