[jboss-osgi-commits] JBoss-OSGI SVN: r88419 - in projects/jboss-osgi/trunk: bundle/blueprint/src and 26 other directories.
jboss-osgi-commits at lists.jboss.org
jboss-osgi-commits at lists.jboss.org
Fri May 8 06:12:52 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-05-08 06:12:51 -0400 (Fri, 08 May 2009)
New Revision: 88419
Added:
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/ServiceActivator.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/example-jmx.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/example-jndi.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java
Removed:
projects/jboss-osgi/trunk/bundle/blueprint/scripts/
projects/jboss-osgi/trunk/bundle/blueprint/src/test/
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/NotImplementedException.java
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/jmx-test.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/jndi-test.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java
Modified:
projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogEntry.java
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/Foo.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/FooMBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/JMXTestService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
All examples migrated and ok in embedded and jbossas
Modified: projects/jboss-osgi/trunk/bundle/blueprint/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/pom.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/blueprint/pom.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -24,147 +24,14 @@
<artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- </dependency>
-
- <!-- Provided Dependencies -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.naming</groupId>
- <artifactId>jnpserver</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- Bundle Dependencies -->
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>apache-xerces-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jaxb-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-common-core-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-microcontainer</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jbossxb-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version}</version>
- <scope>test</scope>
- </dependency>
</dependencies>
+ <!-- Build -->
<build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <filtering>true</filtering>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <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>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>build-test-jars</id>
- <phase>test-compile</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <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" />
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
</build>
<!-- Profiles -->
<profiles>
-
</profiles>
</project>
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -78,7 +78,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.service.remotelog.RemoteLogActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.service.remotelog.internal.ServiceActivator</Bundle-Activator>
<Export-Package>org.jboss.osgi.service.remotelog;version=${version}</Export-Package>
<Import-Package>
org.osgi.framework,
Deleted: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/NotImplementedException.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/NotImplementedException.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/NotImplementedException.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,43 +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.osgi.service.remotelog;
-
-// $Id$
-
-/**
- * A RuntimeException that should be thrown for unimplemented features
- *
- * @author thomas.diesler at jboss.com
- * @since 18-Jun-2008
- */
- at SuppressWarnings("serial")
-public class NotImplementedException extends RuntimeException
-{
- public NotImplementedException()
- {
- }
-
- public NotImplementedException(String message)
- {
- super(message);
- }
-}
Deleted: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,109 +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.osgi.service.remotelog;
-
-//$Id$
-
-import java.util.Properties;
-
-import org.jboss.osgi.service.remotelog.internal.RemoteLogReaderServiceImpl;
-import org.jboss.osgi.spi.logging.RemoteLogReaderService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * [TODO]
- *
- * @author thomas.diesler at jboss.com
- * @since 23-Jan-2009
- */
-public class RemoteLogActivator implements BundleActivator
-{
- public static final String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
- public static final String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
- public static final String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
- public static final String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
-
- private Boolean isReader = Boolean.FALSE;
- private Boolean isSender = Boolean.FALSE;
- private RemoteLogReaderServiceImpl readerService;
- private RemoteLogListener remoteSender;
-
- public void start(BundleContext context)
- {
- String readerProp = context.getProperty(REMOTE_LOG_READER);
- String senderProp = context.getProperty(REMOTE_LOG_SENDER);
- String hostProp = context.getProperty(REMOTE_LOG_HOST);
- String portProp = context.getProperty(REMOTE_LOG_PORT);
-
- if (readerProp != null)
- isReader = Boolean.valueOf(readerProp);
-
- if (senderProp != null)
- isSender = Boolean.valueOf(senderProp);
-
- String host = hostProp != null ? hostProp : "localhost";
- String port = portProp != null ? portProp : "5400";
-
- Properties props = new Properties();
- props.put(REMOTE_LOG_HOST, host);
- props.put(REMOTE_LOG_PORT, port);
-
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
-
- if (isReader == true)
- {
- readerService = new RemoteLogReaderServiceImpl(context, props);
- context.registerService(RemoteLogReaderService.class.getName(), readerService, props);
- readerService.start();
- }
-
- if (isSender == true)
- {
- remoteSender = new RemoteLogListener(context, props);
- remoteSender.start();
- }
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
-
- public void stop(BundleContext context) throws Exception
- {
- if (isReader == true)
- {
- readerService.stop();
- readerService = null;
- }
-
- if (isSender == true)
- {
- remoteSender.stop();
- remoteSender = null;
- }
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogListener.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -25,6 +25,7 @@
import java.util.Properties;
+import org.jboss.osgi.service.remotelog.internal.ServiceActivator;
import org.jboss.osgi.service.remotelog.internal.RemoteLogEntry;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
@@ -53,8 +54,8 @@
public RemoteLogListener(BundleContext context, Properties props)
{
this.context = context;
- this.host = props.getProperty(RemoteLogActivator.REMOTE_LOG_HOST);
- this.port = new Integer(props.getProperty(RemoteLogActivator.REMOTE_LOG_PORT));
+ this.host = props.getProperty(ServiceActivator.REMOTE_LOG_HOST);
+ this.port = new Integer(props.getProperty(ServiceActivator.REMOTE_LOG_PORT));
// Get the remoting client
try
Modified: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogEntry.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogEntry.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogEntry.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -32,7 +32,7 @@
import java.util.Dictionary;
import java.util.Enumeration;
-import org.jboss.osgi.service.remotelog.NotImplementedException;
+import org.jboss.osgi.spi.NotImplementedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
Modified: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -30,8 +30,7 @@
import javax.management.MBeanServer;
-import org.jboss.osgi.service.remotelog.NotImplementedException;
-import org.jboss.osgi.service.remotelog.RemoteLogActivator;
+import org.jboss.osgi.spi.NotImplementedException;
import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
@@ -59,8 +58,8 @@
public RemoteLogReaderServiceImpl(BundleContext context, Properties props)
{
- this.host = props.getProperty(RemoteLogActivator.REMOTE_LOG_HOST);
- this.port = new Integer(props.getProperty(RemoteLogActivator.REMOTE_LOG_PORT));
+ this.host = props.getProperty(ServiceActivator.REMOTE_LOG_HOST);
+ this.port = new Integer(props.getProperty(ServiceActivator.REMOTE_LOG_PORT));
}
public void addLogListener(LogListener listener)
Copied: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/ServiceActivator.java (from rev 88408, projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/ServiceActivator.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,109 @@
+/*
+ * 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.osgi.service.remotelog.internal;
+
+//$Id$
+
+import java.util.Properties;
+
+import org.jboss.osgi.service.remotelog.RemoteLogListener;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ public static final String REMOTE_LOG_SENDER = "org.jboss.osgi.service.remote.log.sender";
+ public static final String REMOTE_LOG_READER = "org.jboss.osgi.service.remote.log.reader";
+ public static final String REMOTE_LOG_HOST = "org.jboss.osgi.service.remote.log.host";
+ public static final String REMOTE_LOG_PORT = "org.jboss.osgi.service.remote.log.port";
+
+ private Boolean isReader = Boolean.FALSE;
+ private Boolean isSender = Boolean.FALSE;
+ private RemoteLogReaderServiceImpl readerService;
+ private RemoteLogListener remoteSender;
+
+ public void start(BundleContext context)
+ {
+ String readerProp = context.getProperty(REMOTE_LOG_READER);
+ String senderProp = context.getProperty(REMOTE_LOG_SENDER);
+ String hostProp = context.getProperty(REMOTE_LOG_HOST);
+ String portProp = context.getProperty(REMOTE_LOG_PORT);
+
+ if (readerProp != null)
+ isReader = Boolean.valueOf(readerProp);
+
+ if (senderProp != null)
+ isSender = Boolean.valueOf(senderProp);
+
+ String host = hostProp != null ? hostProp : "localhost";
+ String port = portProp != null ? portProp : "5400";
+
+ Properties props = new Properties();
+ props.put(REMOTE_LOG_HOST, host);
+ props.put(REMOTE_LOG_PORT, port);
+
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
+ if (isReader == true)
+ {
+ readerService = new RemoteLogReaderServiceImpl(context, props);
+ context.registerService(RemoteLogReaderService.class.getName(), readerService, props);
+ readerService.start();
+ }
+
+ if (isSender == true)
+ {
+ remoteSender = new RemoteLogListener(context, props);
+ remoteSender.start();
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ if (isReader == true)
+ {
+ readerService.stop();
+ readerService = null;
+ }
+
+ if (isSender == true)
+ {
+ remoteSender.stop();
+ remoteSender = null;
+ }
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/EmbeddedRuntime.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -98,24 +98,23 @@
public void startLogEntryTracking(final LogEntryCache logEntryCache)
{
+ super.startLogEntryTracking(logEntryCache);
+
// Track the LogReaderService to add the LogEntryCache as LogListener
ServiceTracker tracker = new ServiceTracker(getBundleContext(), LogReaderService.class.getName(), null)
{
@Override
public Object addingService(ServiceReference sref)
{
- LogReaderService service = (LogReaderService)super.addingService(sref);
- service.addLogListener(logEntryCache);
- return service;
+ LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
+ logReaderService.addLogListener(logEntryCache);
+ setLogReaderService(logReaderService);
+ return logReaderService;
}
};
tracker.open();
}
- public void stopLogEntryTracking()
- {
- }
-
@Override
public void shutdown()
{
@@ -124,7 +123,7 @@
bootProvider.getFramework().stop();
}
- private BundleContext getBundleContext()
+ public BundleContext getBundleContext()
{
OSGiBootstrapProvider bootProvider = getTestHelper().getBootstrapProvider();
OSGiFramework framework = bootProvider.getFramework();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiRuntime.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -22,10 +22,12 @@
package org.jboss.osgi.spi.testing;
import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.management.MBeanProxyException;
import org.osgi.framework.BundleException;
/**
@@ -56,6 +58,8 @@
InitialContext getInitialContext() throws NamingException;
+ <T> T getMBeanProxy(Class<T> mbeanInterface, ObjectName objectName) throws MBeanProxyException;
+
MBeanServerConnection getMBeanServer();
String getServerHost();
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/OSGiTestHelper.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -27,7 +27,6 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
-import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
/**
* An OSGi Test Helper
@@ -76,7 +75,7 @@
return runtime;
}
- public OSGiRuntimeImpl getEmbeddedRuntime()
+ public EmbeddedRuntime getEmbeddedRuntime()
{
return new EmbeddedRuntime(this);
}
Added: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,46 @@
+/*
+ * 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.osgi.spi.testing;
+
+//$Id$
+
+import java.util.Properties;
+
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class RemoteLogCapability extends Capability
+{
+ public RemoteLogCapability()
+ {
+ Properties props = getProperties();
+ props.setProperty("org.jboss.osgi.service.remote.log.reader", "true");
+ props.setProperty("org.jboss.osgi.remote.log.host", System.getProperty("jboss.bind.address", "localhost"));
+ props.setProperty("org.jboss.osgi.remote.log.port", "5400");
+
+ addBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteLogCapability.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/RemoteRuntime.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -42,13 +42,18 @@
import org.jboss.osgi.spi.framework.RemoteFramework;
import org.jboss.osgi.spi.framework.RemoteFrameworkException;
import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.management.ManagedBundleMBean;
import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
import org.jboss.osgi.spi.testing.internal.OSGiRuntimeImpl;
+import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* [TODO]
@@ -61,6 +66,10 @@
private MBeanServerConnection mbeanServer;
private ManagedFrameworkMBean managedFramework;
private Set<Class<?>> ignoredCaps = new HashSet<Class<?>>();
+
+ // Needed for remote logging
+ private EmbeddedRuntime embeddedRuntime;
+ private RemoteLogCapability remoteLogCapability;
public RemoteRuntime(OSGiTestHelper helper)
{
@@ -119,16 +128,73 @@
public AbstractBundle[] getBundles()
{
- throw new NotImplementedException();
+ try
+ {
+ Set<RemoteBundle> remoteBundles = getRemoteFramework().getBundles();
+ Set<AbstractBundle> bundles = new HashSet<AbstractBundle>();
+ for (RemoteBundle remoteBundle : remoteBundles)
+ bundles.add(new RemoteBundleBadName(this, remoteBundle, null));
+
+ AbstractBundle[] bundleArr = new AbstractBundle[bundles.size()];
+ bundles.toArray(bundleArr);
+
+ return bundleArr;
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot obtain remote bundles", ex);
+ }
}
public void startLogEntryTracking(final LogEntryCache logEntryCache)
{
- throw new NotImplementedException();
+ super.startLogEntryTracking(logEntryCache);
+
+ try
+ {
+ remoteLogCapability = new RemoteLogCapability();
+ addCapability(remoteLogCapability);
+
+ embeddedRuntime = getTestHelper().getEmbeddedRuntime();
+ embeddedRuntime.addCapability(remoteLogCapability);
+
+ // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+ BundleContext context = embeddedRuntime.getBundleContext();
+ ServiceTracker tracker = new ServiceTracker(context, RemoteLogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService logReaderService = (LogReaderService)super.addingService(sref);
+ logReaderService.addLogListener(logEntryCache);
+ setLogReaderService(logReaderService);
+ return logReaderService;
+ }
+ };
+ tracker.open();
+ }
+ catch (BundleException ex)
+ {
+ throw new IllegalStateException("Cannot start log entry tracking", ex);
+ }
}
+ @Override
public void stopLogEntryTracking()
{
+ if (remoteLogCapability != null)
+ {
+ removeCapability(remoteLogCapability);
+ remoteLogCapability = null;
+ }
+
+ if (embeddedRuntime != null)
+ {
+ embeddedRuntime.shutdown();
+ embeddedRuntime = null;
+ }
+
+ super.stopLogEntryTracking();
}
public MBeanServerConnection getMBeanServer()
Modified: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/testing/internal/OSGiRuntimeImpl.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -31,11 +31,15 @@
import javax.management.ObjectName;
import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
import org.jboss.osgi.spi.testing.AbstractBundle;
import org.jboss.osgi.spi.testing.Capability;
import org.jboss.osgi.spi.testing.OSGiRuntime;
import org.jboss.osgi.spi.testing.OSGiTestHelper;
import org.osgi.framework.BundleException;
+import org.osgi.service.log.LogReaderService;
/**
* [TODO]
@@ -51,7 +55,10 @@
private OSGiTestHelper helper;
private Map<String, AbstractBundle> bundles = new HashMap<String, AbstractBundle>();
private List<Capability> capabilities = new ArrayList<Capability>();
+ private LogReaderService logReaderService;
+ private LogEntryCache logEntryCache;
+
public OSGiRuntimeImpl(OSGiTestHelper helper)
{
this.helper = helper;
@@ -62,6 +69,16 @@
return helper;
}
+ protected void setLogReaderService(LogReaderService logReaderService)
+ {
+ this.logReaderService = logReaderService;
+ }
+
+ protected LogReaderService getLogReaderService()
+ {
+ return logReaderService;
+ }
+
public void addCapability(Capability capability) throws BundleException
{
for (String location : capability.getBundles())
@@ -95,8 +112,25 @@
}
}
+ public void startLogEntryTracking(LogEntryCache logEntryCache)
+ {
+ this.logEntryCache = logEntryCache;
+ }
+
+ public void stopLogEntryTracking()
+ {
+ if (logReaderService != null && logEntryCache != null)
+ {
+ logReaderService.removeLogListener(logEntryCache);
+ logReaderService = null;
+ logEntryCache = null;
+ }
+ }
+
public void shutdown()
{
+ stopLogEntryTracking();
+
while (capabilities.size() > 0)
{
Capability capability = capabilities.get(0);
@@ -122,6 +156,11 @@
getMBeanServer().invoke(oname, method, new Object[] { archiveURL }, new String[] { "java.net.URL" });
}
+ public <T> T getMBeanProxy(Class<T> mbeanInterface, ObjectName objectName) throws MBeanProxyException
+ {
+ return MBeanProxy.get(mbeanInterface, objectName, getMBeanServer());
+ }
+
public String getServerHost()
{
return System.getProperty("jboss.bind.address", "localhost");
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -18,89 +18,6 @@
<properties>
</properties>
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-deployer</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- </dependency>
-
- <!-- Bundle Dependencies -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.http.jetty</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.metatype</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
<!-- Build -->
<build>
<plugins>
@@ -150,7 +67,7 @@
<tasks>
<property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
<property name="tests.output.dir" value="${project.build.directory}" />
- <ant antfile="scripts/antrun-example-jars.xml" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
</tasks>
</configuration>
</execution>
Deleted: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,55 +0,0 @@
-<?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: antrun-example-jars.xml 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $ -->
-
-<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/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/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" />
-
- <!-- Please add alphabetically -->
-
- </target>
-
-</project>
Copied: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml (from rev 88417, projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-test-jars.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,65 @@
+<?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: antrun-example-jars.xml 87329 2009-04-15 10:34:21Z thomas.diesler at jboss.com $ -->
+
+<project default="build-test-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" />
+ <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-test-jars" depends="init" description="Build the test deployments">
+
+ <!-- Please add alphabetically -->
+
+ <!-- http -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-http.jar" files="${tests.resources.dir}/http/example-http.bnd" />
+
+ <!-- jmx -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jmx.jar" files="${tests.resources.dir}/jmx/example-jmx.bnd" />
+
+ <!-- jndi -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-jndi.jar" files="${tests.resources.dir}/jndi/example-jndi.bnd" />
+
+ <!-- log -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-log.jar" files="${tests.resources.dir}/log/example-log.bnd" />
+
+ <!-- mcservice -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleA.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example-mcservice-bundleB.jar" files="${tests.resources.dir}/mcservice/example-mcservice-bundleB.bnd" />
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -15,14 +15,21 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
+ <include>*:apache-xerces-bundle:jar</include>
+ <include>*:jaxb-bundle:jar</include>
+ <include>*:jboss-common-core-bundle:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-jmx:jar</include>
+ <include>*:jboss-osgi-jndi:jar</include>
+ <include>*:jboss-osgi-logging:jar</include>
+ <include>*:jboss-osgi-microcontainer:jar</include>
+ <include>*:jboss-osgi-remotelog:jar</include>
+ <include>*:jbossxb-bundle:jar</include>
<include>*:org.apache.felix.configadmin:jar</include>
<include>*:org.apache.felix.http.jetty:jar</include>
<include>*:org.apache.felix.log:jar</include>
<include>*:org.apache.felix.metatype: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>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceTestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -59,8 +59,11 @@
runtime = getDefaultRuntime();
runtime.addCapability(new ConfigAdminCapability());
runtime.addCapability(new HttpCapability());
+
Thread.sleep(500);
- testBundle = runtime.installBundle("example/example-http.jar");
+
+ testBundle = runtime.installBundle("example-http.jar");
+ testBundle.start();
}
@Override
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/JMXTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/JMXTestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,97 @@
+/*
+ * 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.jmx;
+
+//$Id: JMXTestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler at jboss.com $
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.JMXCapability;
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.jboss.test.osgi.example.jmx.bundle.FooMBean;
+
+/**
+ * A test that deployes a bundle that registeres an MBean
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class JMXTestCase extends OSGiTest
+{
+ private static OSGiRuntime runtime;
+ private static AbstractBundle bundle;
+
+ public static Test suite()
+ {
+ OSGiTestSetup setup = new OSGiTestSetup(JMXTestCase.class)
+ {
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
+
+ bundle = runtime.installBundle("example-jmx.jar");
+ bundle.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ bundle.uninstall();
+ runtime.shutdown();
+ super.tearDown();
+ }
+ };
+ return setup;
+ }
+
+ public void testMBeanAccess() throws Exception
+ {
+ ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, runtime.getMBeanServer());
+ assertEquals("hello", foo.echo("hello"));
+ }
+
+ public void testRMIAdaptor() throws Exception
+ {
+ // Lookup the MBeanServerConnection
+ InitialContext iniCtx = runtime.getInitialContext();
+ MBeanServerConnection rmiAdaptor = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+
+ // Access the MBean through the MBeanServerConnection
+ ObjectName oname = new ObjectName("jboss.osgi:service=mbean-test-service");
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, oname, rmiAdaptor);
+ assertEquals("hello", foo.echo("hello"));
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/bundle)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/bundle/Foo.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/Foo.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.jmx.bundle;
+package org.jboss.test.osgi.example.jmx.bundle;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/bundle/FooMBean.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/FooMBean.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.jmx.bundle;
+package org.jboss.test.osgi.example.jmx.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/JMXTestService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/bundle/JMXTestService.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/JMXTestService.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.jmx.bundle;
+package org.jboss.test.osgi.example.jmx.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jmx/bundle/ServiceActivator.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jmx/bundle/ServiceActivator.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.jmx.bundle;
+package org.jboss.test.osgi.example.jmx.bundle;
//$Id$
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/JNDITestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,94 @@
+/*
+ * 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.jndi;
+
+//$Id: JNDITestCase.java 88356 2009-05-07 13:13:26Z thomas.diesler at jboss.com $
+
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestSetup;
+import org.osgi.framework.Bundle;
+
+/**
+ * A test that deployes a bundle that binds a String to JNDI
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 05-May-2009
+ */
+public class JNDITestCase extends OSGiTest
+{
+ private static OSGiRuntime runtime;
+
+ public static Test suite()
+ {
+ OSGiTestSetup setup = new OSGiTestSetup(JNDITestCase.class)
+ {
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ runtime.shutdown();
+ super.tearDown();
+ }
+ };
+ return setup;
+ }
+
+ public void testJNDIAccess() throws Exception
+ {
+ AbstractBundle bundle = runtime.installBundle("example-jndi.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+
+ InitialContext iniCtx = runtime.getInitialContext();
+ String lookup = (String)iniCtx.lookup("test/Foo");
+ assertEquals("JNDI bound String expected", "Bar", lookup);
+
+ // Uninstall should unbind the object
+ bundle.uninstall();
+
+ try
+ {
+ iniCtx.lookup("test/Foo");
+ fail("NameNotFoundException expected");
+ }
+ catch (NameNotFoundException ex)
+ {
+ // expected
+ }
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/bundle)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/jndi/bundle/ServiceActivator.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/jndi/bundle/ServiceActivator.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.jndi.bundle;
+package org.jboss.test.osgi.example.jndi.bundle;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -59,14 +59,14 @@
@Override
protected void tearDown() throws Exception
{
- runtime.stopLogEntryTracking();
+ runtime.shutdown();
super.tearDown();
}
public void testLogEntryFilter() throws Exception
{
// Install and start the test bundle
- AbstractBundle bundleA = runtime.installBundle("example/example-log.jar");
+ AbstractBundle bundleA = runtime.installBundle("example-log.jar");
bundleA.start();
// Verify that the bundle is active
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/MicrocontainerTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,125 @@
+/*
+ * 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 static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_KERNEL;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_MBEAN_SERVER;
+import static org.jboss.osgi.microcontainer.MicrocontainerService.BEAN_SYSTEM_BUNDLE_CONTEXT;
+import static org.jboss.osgi.microcontainer.MicrocontainerServiceMBean.MBEAN_MICROCONTAINER_SERVICE;
+import static org.jboss.osgi.spi.management.ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.microcontainer.MicrocontainerServiceMBean;
+import org.jboss.osgi.spi.management.ManagedFrameworkMBean;
+import org.jboss.osgi.spi.testing.JMXCapability;
+import org.jboss.osgi.spi.testing.JNDICapability;
+import org.jboss.osgi.spi.testing.MicrocontainerCapability;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.jboss.osgi.spi.testing.OSGiTestSetup;
+
+/**
+ * A test that checks whether the MicrocontainerService can be accessed
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 12-Feb-2009
+ */
+public class MicrocontainerTestCase extends OSGiTest
+{
+ private static OSGiRuntime runtime;
+
+ public static Test suite()
+ {
+ OSGiTestSetup setup = new OSGiTestSetup(MicrocontainerTestCase.class)
+ {
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new JNDICapability());
+ runtime.addCapability(new JMXCapability());
+ runtime.addCapability(new MicrocontainerCapability());
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ runtime.shutdown();
+ super.tearDown();
+ }
+ };
+ return setup;
+ }
+
+ public void testServiceAccess() throws Exception
+ {
+ MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("BundleContext registered with MC", registeredBeans.contains(BEAN_SYSTEM_BUNDLE_CONTEXT));
+ assertTrue("MBeanServer registered with MC", registeredBeans.contains(BEAN_MBEAN_SERVER));
+ assertTrue("Kernel registered with MC", registeredBeans.contains(BEAN_KERNEL));
+ }
+
+ /**
+ * Test whether the bundle can be deployed through the MicrocontainerServiceMBean
+ */
+ public void testBundleDeployment() throws Exception
+ {
+ MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ mcService.deploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
+
+ ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleA") > 0);
+
+ mcService.undeploy(getTestArchiveURL("example-mcservice-bundleA.jar"));
+}
+
+ public void testBeansDeployment() throws Exception
+ {
+ MicrocontainerServiceMBean mcService = runtime.getMBeanProxy(MicrocontainerServiceMBean.class, MBEAN_MICROCONTAINER_SERVICE);
+ mcService.deploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
+
+ ManagedFrameworkMBean frameworkMBean = runtime.getMBeanProxy(ManagedFrameworkMBean.class, MBEAN_MANAGED_FRAMEWORK);
+ Set<ObjectName> bundles = frameworkMBean.getBundles();
+ assertTrue("Managed bundle registered", bundles.toString().indexOf("jboss.osgi:bundle=example-mcservice-bundleB") > 0);
+
+ // Check whether the bean is registered
+ List<String> registeredBeans = mcService.getRegisteredBeans();
+ assertTrue("SomeBean registered", registeredBeans.contains("SomeBean"));
+
+ mcService.undeploy(getTestArchiveURL("example-mcservice-bundleB.jar"));
+
+ // Check whether the bean is unregistered
+ registeredBeans = mcService.getRegisteredBeans();
+ assertFalse("SomeBean unregistered", registeredBeans.contains("SomeBean"));
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleA)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleA/ServiceActivator.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/ServiceActivator.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.mcservice.bundleA;
+package org.jboss.test.osgi.example.microcontainer.bundleA;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleA/SomeService.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleA/SomeService.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.mcservice.bundleA;
+package org.jboss.test.osgi.example.microcontainer.bundleA;
//$Id$
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleB)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleB/SomeBean.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBean.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.mcservice.bundleB;
+package org.jboss.test.osgi.example.microcontainer.bundleB;
//$Id$
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/mcservice/bundleB/SomeBeanMBean.java 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundleB/SomeBeanMBean.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -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.blueprint.mcservice.bundleB;
+package org.jboss.test.osgi.example.microcontainer.bundleB;
//$Id$
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/http (from rev 88408, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-felix.properties 2009-05-08 10:12:51 UTC (rev 88419)
@@ -16,17 +16,31 @@
# Extra System Packages
org.osgi.framework.system.packages.extra=\
+ org.apache.log4j, \
org.jboss.logging, \
org.jboss.net.protocol, \
org.jboss.osgi.spi, \
+ org.jboss.osgi.spi.logging, \
org.jboss.osgi.spi.management, \
org.jboss.virtual, \
org.jboss.virtual.plugins.registry, \
org.jboss.virtual.plugins.context.jar, \
org.jboss.virtual.plugins.vfs.helpers, \
org.jboss.virtual.protocol, \
- org.osgi.framework;version\=1.4
+ org.osgi.framework;version\=1.4, \
+ org.apache.log4j, \
+ org.jboss.util, \
+ org.jboss.util.id, \
+ org.jboss.util.threadpool, \
+ org.jboss.util.propertyeditor
+# These are needed by jboss-remoting
+# org.apache.log4j, \
+# org.jboss.util, \
+# org.jboss.util.id, \
+# org.jboss.util.threadpool, \
+# org.jboss.util.propertyeditor
+
# Bundles that need to be installed with the Framework automatically
org.jboss.osgi.spi.framework.autoInstall=\
file://${test.archive.directory}/bundles/org.osgi.compendium.jar
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jmx)
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/example-jmx.bnd (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jmx/jmx-test.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/example-jmx.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/example-jmx.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-jmx.jar src/test/resources/jmx/example-jmx.bnd
+
+Bundle-SymbolicName: example-jmx
+Bundle-Activator: org.jboss.test.osgi.example.jmx.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.jmx.bundle
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/jmx-test.bnd
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jmx/jmx-test.bnd 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jmx/jmx-test.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,5 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jmx-test.jar src/test/resources/jmx/jmx-test.bnd
-
-Bundle-SymbolicName: jmx-test
-Bundle-Activator: org.jboss.test.osgi.blueprint.jmx.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.blueprint.jmx.bundle
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi)
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/example-jndi.bnd (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi/jndi-test.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/example-jndi.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/example-jndi.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jndi-test.jar src/test/resources/jndi/jndi-test.bnd
+
+Bundle-SymbolicName: example-jndi
+Bundle-Activator: org.jboss.test.osgi.example.jndi.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.jndi.bundle
+Import-Package: javax.naming, org.osgi.framework, org.jboss.osgi.jndi
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/jndi-test.bnd
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/jndi/jndi-test.bnd 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi/jndi-test.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/jndi-test.jar src/test/resources/jndi/jndi-test.bnd
-
-Bundle-SymbolicName: jndi-test
-Bundle-Activator: org.jboss.test.osgi.blueprint.jndi.bundle.ServiceActivator
-Export-Package: org.jboss.test.osgi.blueprint.jndi.bundle
-Import-Package: javax.naming, org.osgi.framework, org.jboss.osgi.jndi
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log (from rev 88408, projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log)
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice)
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/META-INF/mcservice-jboss-beans.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,6 +1,6 @@
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="SomeBean" class="org.jboss.test.osgi.blueprint.mcservice.bundleB.SomeBean">
+ <bean name="SomeBean" class="org.jboss.test.osgi.example.microcontainer.bundleB.SomeBean">
<property name="mbeanServer"><inject bean="jboss.osgi:service=MBeanServer"/></property>
</bean>
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice/mcservice-bundleA.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleA.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-mcservice-bundleA.jar src/test/resources/mcservice/example-mcservice-bundleA.bnd
+
+Bundle-SymbolicName: example-mcservice-bundleA
+Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.microcontainer.bundleA
+Import-Package: org.jboss.osgi.microcontainer, org.osgi.framework
Copied: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice/mcservice-bundleB.bnd)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/example-mcservice-bundleB.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleB.jar src/test/resources/mcservice/mcservice-bundleB.bnd
+
+Bundle-SymbolicName: example-mcservice-bundleB
+Export-Package: org.jboss.test.osgi.example.microcontainer.bundleB
+Import-Package: javax.management
+Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice/mcservice-bundleA.bnd 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleA.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleA.jar src/test/resources/mcservice/mcservice-bundleA.bnd
-
-Bundle-SymbolicName: mcservice-bundleA
-Bundle-Activator: org.jboss.test.osgi.blueprint.mcservice.bundleA.ServiceActivator
-Export-Package: org.jboss.test.osgi.blueprint.mcservice.bundleA
-Import-Package: org.jboss.osgi.microcontainer, org.osgi.framework
Deleted: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/bundle/blueprint/src/test/resources/mcservice/mcservice-bundleB.bnd 2009-05-08 05:54:51 UTC (rev 88408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/mcservice/mcservice-bundleB.bnd 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,6 +0,0 @@
-# bnd build -classpath target/test-classes -output target/test-libs/mcservice-bundleB.jar src/test/resources/mcservice/mcservice-bundleB.bnd
-
-Bundle-SymbolicName: mcservice-bundleB
-Export-Package: org.jboss.test.osgi.blueprint.mcservice.bundleB
-Import-Package: javax.management
-Include-Resource: META-INF/mcservice-jboss-beans.xml=META-INF/mcservice-jboss-beans.xml
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -18,115 +18,6 @@
<properties>
</properties>
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>biz.aQute</groupId>
- <artifactId>bnd</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-spi</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-deployer</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- </dependency>
-
- <!-- Bundle Dependencies -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.http.jetty</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.metatype</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>apache-xerces-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jaxb-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-common-core-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jmx</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jndi</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-microcontainer</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jbossxb-bundle</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
<!-- Build -->
<build>
<plugins>
Copied: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java (from rev 88408, projects/jboss-osgi/trunk/bundle/blueprint/src/test/java/org/jboss/test/osgi/blueprint/bootstrap/BundleTestCase.java)
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BundleTestCase.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -0,0 +1,143 @@
+/*
+ * 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.
+ */
+
+
+//$Id$
+package org.jboss.test.osgi.bootstrap;
+
+import org.jboss.osgi.spi.testing.AbstractBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * Test OSGi System bundle access
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 23-Jan-2009
+ */
+public class BundleTestCase extends OSGiTest
+{
+ public void testApacheXercesBundle() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/apache-xerces-bundle.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ public void testJAXBBundle() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/jaxb-bundle.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ public void testJBossCommonCoreBundle() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/apache-xerces-bundle.jar");
+ bundle = runtime.installBundle("bundles/jboss-common-core-bundle.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ public void testJBossXBBundle() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/apache-xerces-bundle.jar");
+ bundle = runtime.installBundle("bundles/jboss-common-core-bundle.jar");
+ bundle = runtime.installBundle("bundles/jaxb-bundle.jar");
+ bundle = runtime.installBundle("bundles/jbossxb-bundle.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ public void testJNDIBundle() throws BundleException
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/jboss-common-core-bundle.jar");
+ bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+
+ public void testJMXBundle() throws Exception
+ {
+ OSGiRuntime runtime = getEmbeddedRuntime();
+ try
+ {
+ AbstractBundle bundle = runtime.installBundle("bundles/jboss-common-core-bundle.jar");
+ bundle = runtime.installBundle("bundles/jboss-osgi-jndi.jar");
+ bundle = runtime.installBundle("bundles/jboss-osgi-jmx.jar");
+ bundle.start();
+
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,86 +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.bootstrap;
-
-//$Id: MockFramework.java 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $
-
-import java.net.URL;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.osgi.spi.framework.OSGiFramework;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * A mock framework
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Feb-2009
- */
-public class MockFramework implements OSGiFramework
-{
- public Bundle getBundle()
- {
- return null;
- }
-
- public BundleContext getBundleContext()
- {
- return null;
- }
-
- public List<URL> getAutoInstall()
- {
- return null;
- }
-
- public List<URL> getAutoStart()
- {
- return null;
- }
-
- public Map<String, Object> getProperties()
- {
- return null;
- }
-
- public void setAutoInstall(List<URL> autoInstall)
- {
- }
-
- public void setAutoStart(List<URL> autoStart)
- {
- }
-
- public void setProperties(Map<String, Object> props)
- {
- }
-
- public void start()
- {
- }
-
- public void stop()
- {
- }
-}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -1,35 +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.bootstrap;
-
-//$Id: SomeBean.java 84917 2009-03-02 08:18:40Z thomas.diesler at jboss.com $
-
-
-/**
- * Some pojo
- *
- * @author thomas.diesler at jboss.com
- * @since 25-Feb-2009
- */
-public class SomeBean
-{
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java 2009-05-08 10:12:51 UTC (rev 88419)
@@ -23,9 +23,8 @@
//$Id: Foo.java 86968 2009-04-08 15:51:12Z thomas.diesler at jboss.com $
-import org.jboss.aop.microcontainer.aspects.jmx.JMX;
- at JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
+//@JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
public class Foo implements FooMBean
{
public String echo(String msg)
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-08 09:45:27 UTC (rev 88418)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-05-08 10:12:51 UTC (rev 88419)
@@ -19,6 +19,104 @@
<module>functional</module>
</modules>
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <!-- Bundle Dependencies -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.configadmin</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.http.jetty</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.metatype</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jaxb-bundle</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-common-core-bundle</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jmx</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jndi</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-microcontainer</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.naming</groupId>
+ <artifactId>jnpserver</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
<!-- Build -->
<build>
<testResources>
More information about the jboss-osgi-commits
mailing list