Commit 8c139ca3 authored by Philippe Merle's avatar Philippe Merle

Added support to run the HelloWorld OSGI example with both Eclipse Equinox and Apache Felix.

parent 38668ea3
......@@ -27,10 +27,14 @@ HelloWorld OSGi example:
------------------------
This example shows how to embed existing OSGi bundles into an SCA application, i.e.,
use of <frascati:implementation.osgi bundle="..."/> implemented on top of Apache Felix.
use of <frascati:implementation.osgi bundle="..."/> implemented with Eclipse Equinox
and Apache Felix.
Th directory 'bundles' contains three OSGi bundles (api, server, and client).
The directory 'sca' contains an SCA composite embedding the three OSGi bundles.
The directory 'sca' contains an SCA composite embedding the three OSGi bundles,
see sca/src/main/resources/helloworld-osgi.composite
The directory 'equinox' contains the pom.xml to run the SCA composite with Eclipse Equinox.
The directory 'felix' contains the pom.xml to run the SCA composite with Apache Felix.
Compilation with Maven:
-----------------------
......@@ -38,11 +42,16 @@ Compilation with Maven:
Execution with Maven:
---------------------
cd sca; mvn -Prun (standalone execution)
cd sca; mvn -Pexplorer (with FraSCAti Explorer)
With Eclipse Equinox:
cd equinox; mvn -Prun (standalone execution)
cd equinox; mvn -Pexplorer (with FraSCAti Explorer)
With Apache Felix:
cd felix; mvn -Prun (standalone execution)
cd felix; mvn -Pexplorer (with FraSCAti Explorer)
Execution with the FraSCAti script:
-----------------------------------
You have to compile this example with Maven.
mvn install
cd sca; frascati run helloworld-osgi -libpath target/helloworld-osgi-sca-<version>.jar -s r -m run
TO BE COMPLETED
<?xml version="1.0"?>
<!--
* OW2 FraSCAti Examples: HelloWorld OSGi
*
* Copyright (c) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
-->
<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.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-parent</artifactId>
<version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-equinox</artifactId>
<packaging>jar</packaging>
<name>OW2 FraSCAti Examples: HelloWorld OSGi with Eclipse Equinox</name>
<properties>
<logging.conf.file>../../distribution/standalone/src/main/conf/logging.properties</logging.conf.file>
<composite.file>helloworld-osgi</composite.file>
<service.name>r</service.name>
<method.name>run</method.name>
</properties>
<dependencies>
<!-- For helloworld-osgi.composite -->
<dependency>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-sca</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- Support for <frascati:implementation.osgi> with Eclipse Equinox. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi-equinox</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- For testing. -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- ================================================ -->
<!-- Copy used OSGi bundles into target/classes -->
<!-- ================================================ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-bundles</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<stripVersion>true</stripVersion> <!-- Remove version number -->
<artifactItems>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-api</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-client</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-server</artifactId>
<version>${frascati.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti Examples: HelloWorld OSGi
*
* Copyright (c) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
-->
<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.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-parent</artifactId>
<version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-felix</artifactId>
<packaging>jar</packaging>
<name>OW2 FraSCAti Examples: HelloWorld OSGi with Apache Felix</name>
<properties>
<logging.conf.file>../../distribution/standalone/src/main/conf/logging.properties</logging.conf.file>
<composite.file>helloworld-osgi</composite.file>
<service.name>r</service.name>
<method.name>run</method.name>
</properties>
<dependencies>
<!-- For helloworld-osgi.composite -->
<dependency>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-sca</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- Support for <frascati:implementation.osgi> with Apache Felix. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi-felix</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- For testing. -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- ================================================ -->
<!-- Copy used OSGi bundles into target/classes -->
<!-- ================================================ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-bundles</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<stripVersion>true</stripVersion> <!-- Remove version number -->
<artifactItems>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-api</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-client</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-server</artifactId>
<version>${frascati.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/***
* OW2 FraSCAti Examples: HelloWorld OSGi
* Copyright (C) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*/
package org.ow2.frascati.examples.helloworld.osgi;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
public class HelloWorldTestCase extends FraSCAtiTestCase {
@Override
public String getComposite() {
return "helloworld-osgi";
}
@Test
public void testService() {
getService(Runnable.class, "r").run();
}
}
......@@ -44,6 +44,8 @@
<modules>
<module>bundles</module>
<module>sca</module>
<module>equinox</module>
<module>felix</module>
</modules>
</project>
......@@ -40,80 +40,13 @@
<packaging>jar</packaging>
<name>OW2 FraSCAti Examples: HelloWorld OSGi SCA Composite</name>
<properties>
<logging.conf.file>../../distribution/standalone/src/main/conf/logging.properties</logging.conf.file>
<composite.file>helloworld-osgi</composite.file>
<service.name>r</service.name>
<method.name>run</method.name>
</properties>
<dependencies>
<!-- Support for <frascati:implementation.osgi> with Apache Felix. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi-felix</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- Interface PrintService used into helloworld-osgi.composite. -->
<!-- For interface PrintService used into helloworld-osgi.composite. -->
<dependency>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-api</artifactId>
<version>${frascati.version}</version>
</dependency>
<!-- For testing. -->
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${frascati.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- ================================================ -->
<!-- Copy used OSGi bundles into target/classes -->
<!-- ================================================ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.0</version>
<executions>
<execution>
<id>copy-bundles</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<stripVersion>true</stripVersion> <!-- Remove version number -->
<artifactItems>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-api</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-client</artifactId>
<version>${frascati.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-server</artifactId>
<version>${frascati.version}</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment