JBoss-OSGI SVN: r87351 - in projects/jboss-osgi/trunk: bundle/common and 11 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 10:25:32 -0400 (Wed, 15 Apr 2009)
New Revision: 87351
Added:
projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
Modified:
projects/jboss-osgi/trunk/bundle/common/pom.xml
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/felix/pom.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
Log:
[JBOSGI-37] Verify local framework
Modified: projects/jboss-osgi/trunk/bundle/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -37,7 +37,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-SymbolicName>org.jboss.osgi.common</Bundle-SymbolicName>
<Export-Package>
org.jboss.osgi.common,
org.jboss.osgi.common.log
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -72,7 +72,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-SymbolicName>org.jboss.osgi.service.remote.log</Bundle-SymbolicName>
+ <Bundle-SymbolicName>org.jboss.osgi.service.remotelog</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.remotelog.RemoteLogActivator</Bundle-Activator>
<Export-Package>org.jboss.osgi.service.remotelog;version=${version}</Export-Package>
<Import-Package>
Modified: projects/jboss-osgi/trunk/bundle/webconsole/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/webconsole/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/bundle/webconsole/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -107,8 +107,7 @@
<extensions>true</extensions>
<configuration>
<instructions>
- <Bundle-Vendor>JBoss, a division of RedHat</Bundle-Vendor>
- <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-SymbolicName>org.jboss.osgi.service.webconsole</Bundle-SymbolicName>
<Bundle-Activator>org.jboss.osgi.service.webconsole.internal.WebConsoleActivator</Bundle-Activator>
<Export-Package>
org.apache.felix.webconsole;version=${version.felix.webconsole},
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -19,8 +19,10 @@
<description>JBossOSGi</description>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/</developerConnection>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/
+ </connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/trunk/
+ </developerConnection>
<url>http://fisheye.jboss.com/qsearch/JBossOSGi/</url>
</scm>
@@ -288,6 +290,17 @@
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
</plugins>
<!-- PluginManagement -->
Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -34,6 +34,24 @@
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- Test Dependencies -->
<dependency>
@@ -61,6 +79,21 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
+ <id>bundles</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>directory-single</goal>
+ </goals>
+ <configuration>
+ <finalName>test-libs</finalName>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-bundles.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ <execution>
<phase>package</phase>
<goals>
<goal>single</goal>
Added: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml (rev 0)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -0,0 +1,28 @@
+<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+ <id>deploy-artifacts</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <!-- Dependency Sets -->
+ <dependencySets>
+
+ <!-- bundle -->
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-logging:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+
+ </dependencySets>
+</assembly>
Property changes on: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -36,6 +36,13 @@
<entry><key>org.jboss.osgi.service.remote.log.port</key><value>5400</value></entry>
</map>
</property>
+ <property name="autoStart">
+ <list elementClass="java.net.URI">
+ <value>file://${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
+ <value>file://${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
+ <value>file://${test.archive.directory}/bundles/jboss-osgi-logging.jar</value>
+ </list>
+ </property>
</bean>
</deployment>
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-15 14:25:32 UTC (rev 87351)
@@ -100,6 +100,7 @@
protected void stopRemoteLogging() throws Exception
{
+ // Undeploy the RemoteLogListener from the remote OSGiFramework.
undeployBundle("bundles/jboss-osgi-remotelog.jar");
}
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -60,6 +60,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-remotelog</artifactId>
<version>${version}</version>
<scope>provided</scope>
@@ -71,6 +77,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<!-- Build -->
@@ -86,10 +97,10 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
- <id>thirdparty-bundles</id>
+ <id>bundles</id>
<phase>test-compile</phase>
<goals>
- <goal>single</goal>
+ <goal>directory-single</goal>
</goals>
<configuration>
<finalName>test-libs</finalName>
Modified: projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/scripts/assembly-bundles.xml 2009-04-15 14:25:32 UTC (rev 87351)
@@ -16,8 +16,8 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
- <include>*:org.osgi.compendium:jar</include>
<include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,7 +23,13 @@
//$Id$
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
/**
* [JBOSGI-37] Prevent creation of deployment unit for nested jars
@@ -35,7 +41,32 @@
*/
public class OSGI37TestCase extends OSGiTest
{
- public void testServiceA() throws Exception
+ private BundleContext sysContext;
+
+ @Override
+ protected void setUp() throws Exception
{
+ super.setUp();
+
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ sysContext = framework.getSystemBundleContext();
}
+
+ public void testNestedBundle() throws Exception
+ {
+ Bundle bundleA = installBundle(sysContext, "jbosgi37-bundleA.jar", true);
+
+ assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
+
+ List<String> relevant = new ArrayList<String>();
+ for (Bundle bundle : sysContext.getBundles())
+ {
+ String symbolicName = bundle.getSymbolicName();
+ if (symbolicName.startsWith("jbosgi37"))
+ relevant.add(symbolicName);
+ }
+
+ assertEquals("No Sub Bundle", 1, relevant.size());
+ assertEquals("jbosgi37-bundleA", relevant.get(0));
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,17 +23,23 @@
//$Id$
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subA.PojoA;
import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
/**
* ServiceA has a dependecy on PojoA
*/
public class ServiceA
{
+ private LogService log;
+
ServiceA(BundleContext context)
{
+ log = new LogServiceTracker(context);
+
PojoA pojo = new PojoA(context.getBundle().getSymbolicName());
- System.out.println(pojo);
+ log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
}
}
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-15 14:25:13 UTC (rev 87350)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-15 14:25:32 UTC (rev 87351)
@@ -23,17 +23,23 @@
//$Id$
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subB.PojoB;
import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
/**
* ServiceB has a dependecy on PojoB
*/
public class ServiceB
{
+ private LogService log;
+
ServiceB(BundleContext context)
{
+ log = new LogServiceTracker(context);
+
PojoB pojo = new PojoB(context.getBundle().getSymbolicName());
- System.out.println(pojo);
+ log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
}
}
17 years, 3 months
JBoss-OSGI SVN: r87339 - in projects/jboss-osgi/trunk: bundle/remotelog and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 08:23:20 -0400 (Wed, 15 Apr 2009)
New Revision: 87339
Modified:
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/spi/pom.xml
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
Log:
Push setup of remote logging to integration layer
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-15 12:23:20 UTC (rev 87339)
@@ -25,11 +25,6 @@
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-15 12:23:20 UTC (rev 87339)
@@ -28,8 +28,8 @@
<modules>
<module>microcontainer</module>
<module>repository</module>
+ <module>bundle</module>
<module>runtime</module>
- <module>bundle</module>
<module>testsuite</module>
</modules>
Modified: projects/jboss-osgi/trunk/runtime/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-04-15 12:23:20 UTC (rev 87339)
@@ -19,6 +19,18 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-15 12:23:20 UTC (rev 87339)
@@ -27,6 +27,7 @@
import javax.management.MBeanServerConnection;
+import org.jboss.osgi.common.log.LogEntryCache;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.framework.RemoteFramework;
@@ -49,6 +50,16 @@
return delegate;
}
+ protected void startRemoteLogging(LogEntryCache entryCache) throws Exception
+ {
+ getDelegate().startRemoteLogging(entryCache);
+ }
+
+ protected void stopRemoteLogging() throws Exception
+ {
+ getDelegate().stopRemoteLogging();
+ }
+
protected boolean isRemoteIntegration()
{
return IntegrationTestHelper.isRemoteIntegration();
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-15 12:23:20 UTC (rev 87339)
@@ -36,7 +36,10 @@
import javax.naming.NamingException;
import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.framework.RemoteFramework;
import org.jboss.osgi.spi.framework.RemoteFrameworkException;
@@ -44,7 +47,11 @@
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* An integration test helper that deals with test deployment/undeployment, etc.
@@ -55,15 +62,47 @@
public class IntegrationTestHelper extends OSGiTestHelper
{
private static MBeanServerConnection server;
- private OSGiBootstrapProvider bootProvider;
private ManagedFrameworkMBean managedFramework;
private String integrationTarget;
public IntegrationTestHelper(OSGiBootstrapProvider bootProvider)
{
- this.bootProvider = bootProvider;
+ setBootstrapProvider(bootProvider);
}
+ protected void startRemoteLogging(final LogEntryCache logEntryCache) throws Exception
+ {
+ // Bootstrap the Framework and get the system bundle
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+ ServiceTracker tracker = new ServiceTracker(sysContext, RemoteLogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService service = (LogReaderService)super.addingService(sref);
+ service.addLogListener(logEntryCache);
+ return service;
+ }
+ };
+ tracker.open();
+
+ // Install the RemoteLogReaderService in the local OSGiFramework.
+ // The 'org.jboss.osgi.service.remote.log.reader' property must be set to 'true'
+ installBundle(sysContext, "bundles/jboss-osgi-remotelog.jar", true);
+
+ // Deploy the RemoteLogListener to the remote OSGiFramework.
+ // The 'org.jboss.osgi.service.remote.log.sender' property must be set to 'true'
+ deployBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+
+ protected void stopRemoteLogging() throws Exception
+ {
+ undeployBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+
public void deploy(String archive) throws Exception
{
URL url = getTestArchiveFile(archive).toURI().toURL();
@@ -143,7 +182,7 @@
}
else
{
- DeployerClient deployer = (DeployerClient)bootProvider.getInstance("MainDeployer");
+ DeployerClient deployer = (DeployerClient)getBootstrapProvider().getInstance("MainDeployer");
return new EmbeddedArchiveDeployer(deployer);
}
}
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java 2009-04-15 12:23:20 UTC (rev 87339)
@@ -25,16 +25,15 @@
import java.net.MalformedURLException;
import java.net.URL;
+import junit.framework.TestCase;
+
import org.jboss.logging.Logger;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.virtual.VFS;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
-import junit.framework.TestCase;
-
/**
* An OSGi Test Case
*
@@ -47,7 +46,6 @@
final Logger log = Logger.getLogger(OSGiTest.class);
private OSGiTestHelper delegate = new OSGiTestHelper();
- private OSGiBootstrapProvider bootProvider;
public OSGiTest()
{
@@ -57,21 +55,17 @@
protected OSGiBootstrapProvider createBootstrapProvider()
{
- return OSGiBootstrap.getBootstrapProvider();
+ return delegate.createBootstrapProvider();
}
protected OSGiBootstrapProvider getBootstrapProvider()
{
- if (bootProvider == null)
- {
- bootProvider = createBootstrapProvider();
- }
- return bootProvider;
+ return delegate.getBootstrapProvider();
}
protected void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
{
- this.bootProvider = bootProvider;
+ delegate.setBootstrapProvider(bootProvider);
}
@Override
Modified: projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-15 12:23:20 UTC (rev 87339)
@@ -25,6 +25,8 @@
import java.net.MalformedURLException;
import java.net.URL;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -40,9 +42,30 @@
private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+ private OSGiBootstrapProvider bootProvider;
+
private static String testResourcesDir;
private static String testArchiveDir;
+ public OSGiBootstrapProvider createBootstrapProvider()
+ {
+ return OSGiBootstrap.getBootstrapProvider();
+ }
+
+ public OSGiBootstrapProvider getBootstrapProvider()
+ {
+ if (bootProvider == null)
+ {
+ bootProvider = createBootstrapProvider();
+ }
+ return bootProvider;
+ }
+
+ public void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+ {
+ this.bootProvider = bootProvider;
+ }
+
/** Try to discover the URL for the test resource */
public URL getResourceURL(String resource)
{
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-15 12:16:16 UTC (rev 87338)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-15 12:23:20 UTC (rev 87339)
@@ -28,17 +28,11 @@
import org.jboss.osgi.common.log.LogEntryCache;
import org.jboss.osgi.common.log.LogEntryFilter;
import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
-import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.junit.IntegrationTest;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
/**
* This example demonstrates the usage of the {@link RemoteLogReaderService}
@@ -48,37 +42,26 @@
*/
public class LogServiceRemoteTestCase extends IntegrationTest
{
- public void testServiceA() throws Exception
+ private LogEntryCache logEntryCache;
+
+ @Override
+ protected void setUp() throws Exception
{
- // Bootstrap the Framework and get the system bundle
- OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
- BundleContext sysContext = framework.getSystemBundleContext();
+ super.setUp();
- // Setup the LogEntryCache
- final LogEntryCache logEntryCache = new LogEntryCache();
- logEntryCache.addFilter(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
-
- // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
- ServiceTracker tracker = new ServiceTracker(sysContext, RemoteLogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService service = (LogReaderService)super.addingService(sref);
- service.addLogListener(logEntryCache);
- return service;
- }
- };
- tracker.open();
+ logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+ startRemoteLogging(logEntryCache);
+ }
- // Install the RemoteLogReaderService in the local OSGiFramework.
- // The 'org.jboss.osgi.service.remote.log.reader' property must be set to 'true'
- installBundle(sysContext, "bundles/jboss-osgi-remotelog.jar", true);
-
- // Deploy the RemoteLogListener to the remote OSGiFramework.
- // The 'org.jboss.osgi.service.remote.log.sender' property must be set to 'true'
- deployBundle("bundles/jboss-osgi-remotelog.jar");
-
+ @Override
+ protected void tearDown() throws Exception
+ {
+ stopRemoteLogging();
+ super.tearDown();
+ }
+
+ public void testServiceA() throws Exception
+ {
// Deploy the test bundle
RemoteBundle bundleA = deployBundle("example/example-log.jar");
@@ -88,9 +71,6 @@
// Undeploy the test bundle
undeployBundle("example/example-log.jar");
- // Uneploy the RemoteLogListener from the remote OSGiFramework.
- undeployBundle("bundles/jboss-osgi-remotelog.jar");
-
// Verify the received log entries
List<LogEntry> entries = logEntryCache.getLog();
assertEquals("Number of entries", 1, entries.size());
17 years, 3 months
JBoss-OSGI SVN: r87336 - in projects/jboss-osgi/trunk/testsuite: src/test/java/org/jboss/test/osgi/service and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 07:31:26 -0400 (Wed, 15 Apr 2009)
New Revision: 87336
Added:
projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/service-startlevel.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/
projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/startlevel-service.bnd
Modified:
projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
Log:
Refine startlevel service test
Modified: projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-04-15 11:10:12 UTC (rev 87335)
+++ projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-04-15 11:31:26 UTC (rev 87336)
@@ -23,6 +23,8 @@
<property name="tests.output.dir" value="${basedir}/../target" />
<mkdir dir="${tests.output.dir}/test-libs/example" />
+ <mkdir dir="${tests.output.dir}/test-libs/service" />
+
<property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
<property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
@@ -77,7 +79,7 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
<!-- startlevel-service -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/startlevel-service.jar" files="${tests.resources.dir}/service/startlevel/startlevel-service.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/service-startlevel.jar" files="${tests.resources.dir}/service/startlevel/service-startlevel.bnd" />
<!-- Please add alphabetically -->
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java 2009-04-15 11:10:12 UTC (rev 87335)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java 2009-04-15 11:31:26 UTC (rev 87336)
@@ -37,10 +37,10 @@
{
public void testStartLevel() throws Exception
{
- RemoteBundle bundle = deployBundle("startlevel-service.jar");
+ RemoteBundle bundle = deployBundle("service/service-startlevel.jar");
assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
- undeployBundle("startlevel-service.jar");
+ undeployBundle("service/service-startlevel.jar");
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-15 11:10:12 UTC (rev 87335)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-15 11:31:26 UTC (rev 87336)
@@ -23,8 +23,10 @@
//$Id$
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
import org.osgi.service.startlevel.StartLevel;
import org.osgi.util.tracker.ServiceTracker;
@@ -36,20 +38,19 @@
*/
public class ServiceActivator implements BundleActivator
{
- /*
- * Implements BundleActivator.start().
- */
public void start(BundleContext context)
{
+ LogService log = new LogServiceTracker(context);
+
ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
tracker.open();
StartLevel service = (StartLevel)tracker.getService();
if (service == null)
- System.err.println("Cannot get StartLevel. Loaded with: " + StartLevel.class.getClassLoader());
+ log.log(LogService.LOG_ERROR, "Cannot get StartLevel. Loaded with: " + StartLevel.class.getClassLoader());
int level = service.getStartLevel();
- System.out.println("StartLevel: " + level);
+ log.log(LogService.LOG_INFO, "StartLevel: " + level);
}
/*
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/service-startlevel.bnd (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/startlevel-service.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/service-startlevel.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/service-startlevel.bnd 2009-04-15 11:31:26 UTC (rev 87336)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/service/service-startlevel.jar src/test/resources/service/startlevel/service-startlevel.bnd
+
+Bundle-SymbolicName: service-startlevel
+Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.service.startlevel.bundle
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/startlevel-service.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/startlevel-service.bnd 2009-04-15 11:10:12 UTC (rev 87335)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/service/startlevel/startlevel-service.bnd 2009-04-15 11:31:26 UTC (rev 87336)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/startlevel-service.jar src/test/resources/service/startlevel/startlevel-service.bnd
-
-Bundle-SymbolicName: startlevel-service
-Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.service.startlevel.bundle
17 years, 3 months
JBoss-OSGI SVN: r87332 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 07:03:11 -0400 (Wed, 15 Apr 2009)
New Revision: 87332
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
[JBOSGI-63] Update to Felix HTTP Service (Jetty) 1.0.0
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-15 11:01:46 UTC (rev 87331)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-15 11:03:11 UTC (rev 87332)
@@ -39,7 +39,7 @@
<version.equinox>3.4.2</version.equinox>
<version.felix.configadmin>1.0.10</version.felix.configadmin>
<version.felix.framework>1.6.0</version.felix.framework>
- <version.felix.http.jetty>0.9.0-20090218-R745505</version.felix.http.jetty>
+ <version.felix.http.jetty>1.0.0</version.felix.http.jetty>
<version.felix.javax.servlet>1.0.0</version.felix.javax.servlet>
<version.felix.log>1.0.0</version.felix.log>
<version.felix.metatype>1.0.2</version.felix.metatype>
17 years, 3 months
JBoss-OSGI SVN: r87331 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 07:01:46 -0400 (Wed, 15 Apr 2009)
New Revision: 87331
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
[JBOSGI-64] Update to Felix Log Service 1.0.0
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-15 10:57:57 UTC (rev 87330)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-15 11:01:46 UTC (rev 87331)
@@ -41,7 +41,7 @@
<version.felix.framework>1.6.0</version.felix.framework>
<version.felix.http.jetty>0.9.0-20090218-R745505</version.felix.http.jetty>
<version.felix.javax.servlet>1.0.0</version.felix.javax.servlet>
- <version.felix.log>0.9.0-20090211-R743531</version.felix.log>
+ <version.felix.log>1.0.0</version.felix.log>
<version.felix.metatype>1.0.2</version.felix.metatype>
<version.felix.osgi.core>1.2.0</version.felix.osgi.core>
<version.felix.webconsole>1.2.8</version.felix.webconsole>
17 years, 3 months
JBoss-OSGI SVN: r87330 - in projects/jboss-osgi/trunk: runtime/felix/src/test/java/org/jboss/test/osgi/felix and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 06:57:57 -0400 (Wed, 15 Apr 2009)
New Revision: 87330
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
Log:
[JBOSGI-65] Update to Felix 1.6.0
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-15 10:57:57 UTC (rev 87330)
@@ -38,7 +38,7 @@
<version.aqute.bnd>0.0.315</version.aqute.bnd>
<version.equinox>3.4.2</version.equinox>
<version.felix.configadmin>1.0.10</version.felix.configadmin>
- <version.felix.framework>1.4.1</version.felix.framework>
+ <version.felix.framework>1.6.0</version.felix.framework>
<version.felix.http.jetty>0.9.0-20090218-R745505</version.felix.http.jetty>
<version.felix.javax.servlet>1.0.0</version.felix.javax.servlet>
<version.felix.log>0.9.0-20090211-R743531</version.felix.log>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/runtime/felix/src/test/java/org/jboss/test/osgi/felix/SystemBundleTestCase.java 2009-04-15 10:57:57 UTC (rev 87330)
@@ -47,7 +47,7 @@
Bundle bundle = framework.getSystemBundle();
assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "system.bundle", bundle.getSymbolicName());
+ assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
}
public void testSystemBundle()
@@ -57,6 +57,6 @@
Bundle bundle = framework.getSystemBundle();
assertEquals("BundleId == 0", 0, bundle.getBundleId());
- assertEquals("SymbolicName", "system.bundle", bundle.getSymbolicName());
+ assertEquals("SymbolicName", "org.apache.felix.framework", bundle.getSymbolicName());
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-04-15 10:57:57 UTC (rev 87330)
@@ -43,7 +43,7 @@
{
public static Test suite()
{
- return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "http-service.jar");
+ return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "example/example-http.jar");
}
public void testServletAccess() throws Exception
@@ -64,7 +64,7 @@
{
URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=context");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("http-service-test", br.readLine());
+ assertEquals("example-http", br.readLine());
}
public void testServletStartLevel() throws Exception
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-15 10:57:57 UTC (rev 87330)
@@ -80,13 +80,13 @@
deployBundle("bundles/jboss-osgi-remotelog.jar");
// Deploy the test bundle
- RemoteBundle bundleA = deployBundle("example/example-log-bundleA.jar");
+ RemoteBundle bundleA = deployBundle("example/example-log.jar");
// Verify that the bundle is active
assertEquals("Remote bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
// Undeploy the test bundle
- undeployBundle("example/example-log-bundleA.jar");
+ undeployBundle("example/example-log.jar");
// Uneploy the RemoteLogListener from the remote OSGiFramework.
undeployBundle("bundles/jboss-osgi-remotelog.jar");
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-15 10:57:57 UTC (rev 87330)
@@ -82,7 +82,7 @@
commonBundle.start();
// Install and start the test bundle
- testURL = getTestArchiveURL("example/example-log-bundleA.jar");
+ testURL = getTestArchiveURL("example/example-log.jar");
Bundle bundleA = sysContext.installBundle(testURL.toExternalForm());
bundleA.start();
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-15 10:57:57 UTC (rev 87330)
@@ -41,7 +41,7 @@
{
public static Test suite()
{
- return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "microcontainer-service.jar");
+ return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "example/example-microcontainer.jar");
}
public void testMBeanAccess() throws Exception
17 years, 3 months
JBoss-OSGI SVN: r87329 - in projects/jboss-osgi/trunk/testsuite: scripts and 14 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 06:34:21 -0400 (Wed, 15 Apr 2009)
New Revision: 87329
Added:
projects/jboss-osgi/trunk/testsuite/scripts/antrun-example-jars.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/example-http.bnd
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log.bnd
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/example-microcontainer.bnd
Removed:
projects/jboss-osgi/trunk/testsuite/scripts/assembly-testsuite.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundleA/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/HttpServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/bundle/
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/MBeanServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle/
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/http-service.bnd
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/microcontainer-service.bnd
projects/jboss-osgi/trunk/testsuite/src/test/resources/service/http/
projects/jboss-osgi/trunk/testsuite/src/test/resources/service/microcontainer/
Modified:
projects/jboss-osgi/trunk/testsuite/pom.xml
projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
Log:
Add http service example.
Add microcontainer service example.
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-15 10:34:21 UTC (rev 87329)
@@ -115,7 +115,8 @@
<tasks>
<property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
<property name="tests.output.dir" value="${project.build.directory}" />
- <ant antfile="scripts/antrun-test-jars.xml" target="build-test-jars" />
+ <ant antfile="scripts/antrun-example-jars.xml"/>
+ <ant antfile="scripts/antrun-test-jars.xml"/>
</tasks>
</configuration>
</execution>
Added: projects/jboss-osgi/trunk/testsuite/scripts/antrun-example-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/antrun-example-jars.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/scripts/antrun-example-jars.xml 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ============================================================ -->
+
+<!-- $Id$ -->
+
+<project default="build-example-jars">
+
+ <description>OSGi test archive builder</description>
+
+ <!-- ================================================================== -->
+ <!-- Init -->
+ <!-- ================================================================== -->
+
+ <target name="init">
+
+ <!-- Property override when not called from maven -->
+ <property name="maven.runtime.classpath" value="/usr/java/bnd.jar" />
+ <property name="tests.output.dir" value="${basedir}/../target" />
+
+ <mkdir dir="${tests.output.dir}/test-libs/example" />
+ <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+ <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+ <taskdef resource="aQute/bnd/ant/taskdef.properties">
+ <classpath>
+ <pathelement path="${maven.runtime.classpath}" />
+ </classpath>
+ </taskdef>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Building -->
+ <!-- ================================================================== -->
+
+ <target name="build-example-jars" depends="init" description="Build the test deployments">
+
+ <!-- Please add alphabetically -->
+
+ <!-- example/log -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-log.jar" files="${tests.resources.dir}/example/log/example-log.bnd" />
+
+ <!-- example/http -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-http.jar" files="${tests.resources.dir}/example/http/example-http.bnd" />
+
+ <!-- example/microcontainer -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-microcontainer.jar" files="${tests.resources.dir}/example/microcontainer/example-microcontainer.bnd" />
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Property changes on: projects/jboss-osgi/trunk/testsuite/scripts/antrun-example-jars.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/scripts/antrun-test-jars.xml 2009-04-15 10:34:21 UTC (rev 87329)
@@ -42,9 +42,6 @@
<!-- Please add alphabetically -->
- <!-- example/log -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-log-bundleA.jar" files="${tests.resources.dir}/example/log/example-log-bundleA.bnd" />
-
<!-- jbosgi36 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/deployer/jbosgi36/jbosgi36.bnd" />
<jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
@@ -79,12 +76,6 @@
<!-- jbosgi41 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
- <!-- http-service -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/http-service.jar" files="${tests.resources.dir}/service/http/http-service.bnd" />
-
- <!-- microcontainer-service -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/microcontainer-service.jar" files="${tests.resources.dir}/service/microcontainer/microcontainer-service.bnd" />
-
<!-- startlevel-service -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/startlevel-service.jar" files="${tests.resources.dir}/service/startlevel/startlevel-service.bnd" />
Deleted: projects/jboss-osgi/trunk/testsuite/scripts/assembly-testsuite.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/scripts/assembly-testsuite.xml 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/scripts/assembly-testsuite.xml 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,18 +0,0 @@
-<assembly 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/xsd/assembly-1.1.0-SNAPSHOT.xsd">
- <id>testsuite</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/test</directory>
- <outputDirectory>/</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>target/test-libs</directory>
- <outputDirectory>/test-libs</outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/HttpServiceRemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.http;
+
+//$Id$
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+
+/**
+ * A test that deployes a bundle that containes a HttpServlet which
+ * is registered through the OSGi HttpService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class HttpServiceRemoteTestCase extends IntegrationTest
+{
+ public static Test suite()
+ {
+ return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "http-service.jar");
+ }
+
+ public void testServletAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=plain");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Servlet", br.readLine());
+ }
+
+ public void testServletInitProps() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=initProp");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("initProp=SomeValue", br.readLine());
+ }
+
+ public void testServletBundleContext() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=context");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("http-service-test", br.readLine());
+ }
+
+ public void testServletStartLevel() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=startLevel");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("startLevel=1", br.readLine());
+ }
+
+ public void testResourceAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/file/message.txt");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Resource", br.readLine());
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/bundle)
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/bundle/EndpointService.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.http.bundle;
+package org.jboss.test.osgi.example.http.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/bundle/EndpointServlet.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.http.bundle;
+package org.jboss.test.osgi.example.http.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/bundle/ServiceActivator.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.http.bundle;
+package org.jboss.test.osgi.example.http.bundle;
//$Id$
Copied: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundleA)
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundleA/ServiceA.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.example.log.bundleA;
+package org.jboss.test.osgi.example.log.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundleA/ServiceActivator.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.example.log.bundleA;
+package org.jboss.test.osgi.example.log.bundle;
//$Id$
Copied: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/MBeanServiceRemoteTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer;
+
+//$Id$
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.test.osgi.example.microcontainer.bundle.FooMBean;
+import org.jboss.test.osgi.example.microcontainer.bundle.MBeanTestService;
+
+/**
+ * A test that deployes a bundle that registeres an MBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class MBeanServiceRemoteTestCase extends IntegrationTest
+{
+ public static Test suite()
+ {
+ return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "microcontainer-service.jar");
+ }
+
+ public void testMBeanAccess() throws Exception
+ {
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getServer());
+ assertEquals("hello", foo.echo("hello"));
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle)
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle/Foo.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.microcontainer.bundle;
+package org.jboss.test.osgi.example.microcontainer.bundle;
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle/FooMBean.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.microcontainer.bundle;
+package org.jboss.test.osgi.example.microcontainer.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle/MBeanTestService.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.microcontainer.bundle;
+package org.jboss.test.osgi.example.microcontainer.bundle;
//$Id$
@@ -28,7 +28,7 @@
import org.jboss.osgi.spi.management.ObjectNameFactory;
import org.jboss.osgi.spi.service.microcontainer.MicrocontainerService;
-import org.jboss.test.osgi.service.microcontainer.bundle.Foo;
+import org.jboss.test.osgi.example.microcontainer.bundle.Foo;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/bundle/ServiceActivator.java 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.osgi.service.microcontainer.bundle;
+package org.jboss.test.osgi.example.microcontainer.bundle;
//$Id$
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/HttpServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/HttpServiceRemoteTestCase.java 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/http/HttpServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.service.http;
-
-//$Id$
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.jboss.osgi.spi.junit.IntegrationTestSetup;
-
-/**
- * A test that deployes a bundle that containes a HttpServlet which
- * is registered through the OSGi HttpService
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class HttpServiceRemoteTestCase extends IntegrationTest
-{
- public static Test suite()
- {
- return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "http-service.jar");
- }
-
- public void testServletAccess() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=plain");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Servlet", br.readLine());
- }
-
- public void testServletInitProps() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=initProp");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("initProp=SomeValue", br.readLine());
- }
-
- public void testServletBundleContext() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=context");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("http-service-test", br.readLine());
- }
-
- public void testServletStartLevel() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=startLevel");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("startLevel=1", br.readLine());
- }
-
- public void testResourceAccess() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8090/file/message.txt");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("Hello from Resource", br.readLine());
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/service/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This 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.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.osgi.service.microcontainer;
-
-//$Id$
-
-import junit.framework.Test;
-
-import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.jboss.osgi.spi.junit.IntegrationTestSetup;
-import org.jboss.osgi.spi.management.MBeanProxy;
-import org.jboss.test.osgi.service.microcontainer.bundle.FooMBean;
-import org.jboss.test.osgi.service.microcontainer.bundle.MBeanTestService;
-
-/**
- * A test that deployes a bundle that registeres an MBean
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Feb-2009
- */
-public class MBeanServiceRemoteTestCase extends IntegrationTest
-{
- public static Test suite()
- {
- return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "microcontainer-service.jar");
- }
-
- public void testMBeanAccess() throws Exception
- {
- FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getServer());
- assertEquals("hello", foo.echo("hello"));
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/service/http)
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/example-http.bnd (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/service/http/http-service.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/example-http.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/example-http.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,9 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-http.jar src/test/resources/example/http/example-http.bnd
+
+Bundle-SymbolicName: example-http
+Bundle-Activator: org.jboss.test.osgi.example.http.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.http.bundle
+Include-Resource: res/message.txt=message.txt
+
+# For some reason this does not work
+# Include-Resource: src/test/resources/service/http/message.txt
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/http-service.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/service/http/http-service.bnd 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/http/http-service.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,9 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/http-service.jar src/test/resources/service/http/http-service.bnd
-
-Bundle-SymbolicName: http-service-test
-Bundle-Activator: org.jboss.test.osgi.service.http.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.service.http.bundle
-Include-Resource: res/message.txt=message.txt
-
-# For some reason this does not work
-# Include-Resource: src/test/resources/service/http/message.txt
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log-bundleA.bnd 2009-04-15 10:13:16 UTC (rev 87328)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log-bundleA.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/example-log-bundleA.jar src/test/resources/example/log/example-log-bundleA.bnd
-
-Bundle-SymbolicName: example-log-bundleA
-
-Bundle-Activator: org.jboss.test.osgi.example.log.bundleA.ServiceActivator
-Export-Package: org.jboss.test.osgi.example.log.bundleA
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log.bnd (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log-bundleA.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/log/example-log.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-log.jar src/test/resources/example/log/example-log.bnd
+
+Bundle-SymbolicName: example-log
+
+Bundle-Activator: org.jboss.test.osgi.example.log.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.log.bundle
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/service/microcontainer)
Copied: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/example-microcontainer.bnd (from rev 87324, projects/jboss-osgi/trunk/testsuite/src/test/resources/service/microcontainer/microcontainer-service.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/example-microcontainer.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/example-microcontainer.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-microcontainer.jar src/test/resources/example/microcontainer/example-microcontainer.bnd
+
+Bundle-SymbolicName: example-microcontainer
+Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.microcontainer.bundle
Deleted: projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/microcontainer-service.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/resources/service/microcontainer/microcontainer-service.bnd 2009-04-15 10:00:38 UTC (rev 87324)
+++ projects/jboss-osgi/trunk/testsuite/src/test/resources/example/microcontainer/microcontainer-service.bnd 2009-04-15 10:34:21 UTC (rev 87329)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/microcontainer-service.jar src/test/resources/service/microcontainer/microcontainer-service.bnd
-
-Bundle-SymbolicName: microcontainer-service-test
-Bundle-Activator: org.jboss.test.osgi.service.microcontainer.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.service.microcontainer.bundle
17 years, 3 months
JBoss-OSGI SVN: r87326 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 06:09:04 -0400 (Wed, 15 Apr 2009)
New Revision: 87326
Removed:
projects/jboss-osgi/trunk/service/
Log:
Delete unused service module
17 years, 3 months
JBoss-OSGI SVN: r87325 - in projects/jboss-osgi/trunk: bundle and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-15 06:07:56 -0400 (Wed, 15 Apr 2009)
New Revision: 87325
Modified:
projects/jboss-osgi/trunk/
projects/jboss-osgi/trunk/bundle/
projects/jboss-osgi/trunk/microcontainer/
projects/jboss-osgi/trunk/repository/
projects/jboss-osgi/trunk/runtime/
Log:
svn:ignore target dirs
Property changes on: projects/jboss-osgi/trunk
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
autoinstall.xml
+ .classpath
.project
autoinstall.xml
target
Property changes on: projects/jboss-osgi/trunk/bundle
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: projects/jboss-osgi/trunk/microcontainer
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: projects/jboss-osgi/trunk/repository
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: projects/jboss-osgi/trunk/runtime
___________________________________________________________________
Name: svn:ignore
+ target
17 years, 3 months