JBoss-OSGI SVN: r87433 - in projects/jboss-osgi/trunk/runtime: felix/src/main/resources and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 11:08:34 -0400 (Thu, 16 Apr 2009)
New Revision: 87433
Added:
projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
Modified:
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
Log:
[JBOSGI-37] First cut of BundleStructureDeployer
Added: projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java 2009-04-16 15:08:34 UTC (rev 87433)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.deployer;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+
+/**
+ * Determine the structure of a Bundle deployment.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 16-Apr-2009
+ */
+public class BundleStructureDeployer extends AbstractVFSStructureDeployer
+{
+ /*
+ * * Sets the default relative order 9000.
+ */
+ public BundleStructureDeployer()
+ {
+ setRelativeOrder(9000);
+ }
+
+ public boolean determineStructure(StructureContext structureContext) throws DeploymentException
+ {
+ ContextInfo context = null;
+ VirtualFile file = structureContext.getFile();
+ VirtualFile root = structureContext.getRoot();
+
+ try
+ {
+ boolean trace = log.isTraceEnabled();
+
+ if (JarUtils.isArchive(file.getName()) == true && file != root)
+ {
+ if (trace)
+ log.trace("... no - ignoring child archive");
+
+ return false;
+ }
+
+ if (isLeaf(file) == false)
+ {
+ // For non top level directories that don't look like jars
+ // we require a META-INF otherwise each subdirectory would be a subdeployment
+ if (JarUtils.isArchive(file.getName()) == false)
+ {
+ if (structureContext.isTopLevel() == false)
+ {
+ try
+ {
+ VirtualFile child = file.getChild("META-INF");
+ if (child != null)
+ {
+ if (trace)
+ log.trace("... ok - non top level directory has a META-INF subdirectory");
+ }
+ else
+ {
+ if (trace)
+ log.trace("... no - doesn't look like a jar and no META-INF subdirectory.");
+
+ return false;
+ }
+ }
+ catch (IOException e)
+ {
+ log.warn("Exception while checking if file is a jar: " + e);
+ return false;
+ }
+ }
+ else if (trace)
+ {
+ log.trace("... ok - doesn't look like a jar but it is a top level directory.");
+ }
+ }
+ }
+ else if (JarUtils.isArchive(file.getName()))
+ {
+ if (trace)
+ log.trace("... ok - its an archive or at least pretending to be.");
+ }
+ else
+ {
+ if (trace)
+ log.trace("... no - not a directory or an archive.");
+ return false;
+ }
+
+ boolean valid = true;
+
+ if (isSupportsCandidateAnnotations())
+ {
+ StructureContext parentContext = structureContext.getParentContext();
+ if (parentContext != null && parentContext.isCandidateAnnotationScanning())
+ valid = checkCandidateAnnotations(structureContext, file);
+ }
+
+ if (valid)
+ {
+ // Create a context for this jar file with META-INF as the location for metadata
+ context = createContext(structureContext, "META-INF");
+
+ // The classpath is the root
+ addClassPath(structureContext, file, true, true, context);
+
+ // We try all the children as potential subdeployments
+ addAllChildren(structureContext);
+ }
+ return valid;
+ }
+ catch (Exception e)
+ {
+ // Remove the invalid context
+ if (context != null)
+ structureContext.removeChild(context);
+
+ throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStructureDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 14:33:50 UTC (rev 87432)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 15:08:34 UTC (rev 87433)
@@ -72,6 +72,9 @@
<!-- The OSGi MetaData Deployer -->
<bean name="jboss.osgi:service=BundleMetaDataDeployer" class="org.jboss.osgi.deployer.BundleMetaDataDeployer" />
+ <!-- The OSGi Bundle Structure Deployer -->
+ <bean name="jboss.osgi:service=BundleStructureDeployer" class="org.jboss.osgi.deployer.BundleStructureDeployer" />
+
<!-- The OSGi Bundle Deployer -->
<bean name="jboss.osgi:service=BundleRealDeployer" class="org.jboss.osgi.deployer.BundleRealDeployer">
<property name="systemContext"><inject bean="jboss.osgi:service=Framework" property="systemBundleContext" /></property>
16 years, 8 months
JBoss-OSGI SVN: r87429 - in projects/jboss-osgi/trunk: runtime/felix and 4 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 10:18:03 -0400 (Thu, 16 Apr 2009)
New Revision: 87429
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java
Modified:
projects/jboss-osgi/trunk/runtime/equinox/pom.xml
projects/jboss-osgi/trunk/runtime/felix/pom.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
Log:
[FELIX-1040] Bundle may start with unresolved packages
Modified: projects/jboss-osgi/trunk/runtime/equinox/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 14:15:38 UTC (rev 87428)
+++ projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 14:18:03 UTC (rev 87429)
@@ -52,8 +52,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 14:15:38 UTC (rev 87428)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 14:18:03 UTC (rev 87429)
@@ -65,8 +65,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 14:15:38 UTC (rev 87428)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 14:18:03 UTC (rev 87429)
@@ -52,8 +52,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 14:15:38 UTC (rev 87428)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 14:18:03 UTC (rev 87429)
@@ -87,8 +87,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 14:15:38 UTC (rev 87428)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 14:18:03 UTC (rev 87429)
@@ -87,8 +87,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -293,6 +293,8 @@
<!-- Exclude tests that require remote access -->
<exclude>org/jboss/test/osgi/deployer/**</exclude>
<exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+ <!-- https://issues.apache.org/jira/browse/FELIX-1040 -->
+ <exclude>org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -326,6 +328,9 @@
<configuration>
<!-- argLine>${surefire.security.args}</argLine -->
<excludes>
+ <exclude>org/jboss/test/osgi/jbosgi37/*RemoteTestCase.java</exclude>
+ <!-- https://issues.apache.org/jira/browse/FELIX-1040 -->
+ <exclude>org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java</exclude>
</excludes>
</configuration>
</plugin>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java 2009-04-16 14:18:03 UTC (rev 87429)
@@ -0,0 +1,66 @@
+/*
+ * 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.jbosgi37;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-37] Prevent creation of deployment unit for nested jars
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-37
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class OSGI37RemoteTestCase extends IntegrationTest
+{
+ public void testNestedBundle() throws Exception
+ {
+ RemoteBundle bundleA = deployBundle("jbosgi37-bundleA.jar");
+ try
+ {
+ assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
+
+ List<String> relevant = new ArrayList<String>();
+ for (RemoteBundle bundle : getRemoteFramework().getBundles())
+ {
+ String symbolicName = bundle.getSymbolicName();
+ if (symbolicName.startsWith("jbosgi37"))
+ relevant.add(symbolicName);
+ }
+
+ assertEquals("No Sub Bundle", 1, relevant.size());
+ assertEquals("jbosgi37-bundleA", relevant.get(0));
+ }
+ finally
+ {
+ undeployBundle("jbosgi37-bundleA.jar");
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37RemoteTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 8 months
JBoss-OSGI SVN: r87424 - in projects/jboss-osgi/trunk: bundle/logging/src/main/java/org/jboss/osgi/service/logging and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 09:30:52 -0400 (Thu, 16 Apr 2009)
New Revision: 87424
Added:
projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingActivator.java
projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingLogListener.java
Removed:
projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/JBossLoggingLogListener.java
projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingServiceActivator.java
Modified:
projects/jboss-osgi/trunk/bundle/logging/pom.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java
Log:
Pull up LogEntryTracking to OSGiTest
Modified: projects/jboss-osgi/trunk/bundle/logging/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 13:30:52 UTC (rev 87424)
@@ -47,7 +47,7 @@
<configuration>
<instructions>
<Bundle-SymbolicName>org.jboss.osgi.service.logging</Bundle-SymbolicName>
- <Bundle-Activator>org.jboss.osgi.service.logging.LoggingServiceActivator</Bundle-Activator>
+ <Bundle-Activator>org.jboss.osgi.service.logging.LoggingActivator</Bundle-Activator>
<Private-Package>org.jboss.osgi.service.logging</Private-Package>
<Import-Package>
org.jboss.logging,
Deleted: projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/JBossLoggingLogListener.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/JBossLoggingLogListener.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/JBossLoggingLogListener.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -1,61 +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.logging;
-
-//$Id$
-
-import org.jboss.logging.Logger;
-import org.osgi.framework.Bundle;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogListener;
-import org.osgi.service.log.LogService;
-
-/**
- * A LogListener the logs LogEntrys to JBossLogging.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 04-Mar-2009
- */
-public class JBossLoggingLogListener implements LogListener
-{
- public void logged(LogEntry entry)
- {
- Bundle bundle = entry.getBundle();
- int level = entry.getLevel();
- Throwable throwable = entry.getException();
-
- String loggerName = bundle.getSymbolicName();
- Logger log = Logger.getLogger(loggerName);
-
- if (level == LogService.LOG_DEBUG)
- log.debug(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_INFO)
- log.info(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_WARNING)
- log.warn(entry.getMessage(), throwable);
-
- else if (level == LogService.LOG_ERROR)
- log.error(entry.getMessage(), throwable);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingActivator.java (from rev 87408, projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingServiceActivator.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingActivator.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -0,0 +1,75 @@
+/*
+ * 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.logging;
+
+//$Id$
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogListener;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * The LoggingServiceActivator Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class LoggingActivator implements BundleActivator
+{
+ /**
+ * Implements BundleActivator.start().
+ *
+ * Track LogReaderService and add/remove LogListener
+ */
+ public void start(BundleContext context)
+ {
+ final LogListener listener = new LoggingLogListener();
+
+ final ServiceTracker tracker = new ServiceTracker(context, LogService.class.getName(), null);
+ tracker.open();
+
+ // Track LogReaderService and add/remove LogListener
+ ServiceTracker logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ LogReaderService logReader = (LogReaderService)super.addingService(reference);
+ logReader.addLogListener(listener);
+ return logReader;
+ }
+ };
+ logTracker.open();
+ }
+
+ /*
+ * Implements BundleActivator.stop().
+ */
+ public void stop(BundleContext context)
+ {
+ // NOTE: The service is automatically unregistered.
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingLogListener.java (from rev 87408, projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/JBossLoggingLogListener.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingLogListener.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingLogListener.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -0,0 +1,61 @@
+/*
+ * 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.logging;
+
+//$Id$
+
+import org.jboss.logging.Logger;
+import org.osgi.framework.Bundle;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogListener;
+import org.osgi.service.log.LogService;
+
+/**
+ * A LogListener the logs LogEntrys to JBossLogging.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class LoggingLogListener implements LogListener
+{
+ public void logged(LogEntry entry)
+ {
+ Bundle bundle = entry.getBundle();
+ int level = entry.getLevel();
+ Throwable throwable = entry.getException();
+
+ String loggerName = bundle.getSymbolicName();
+ Logger log = Logger.getLogger(loggerName);
+
+ if (level == LogService.LOG_DEBUG)
+ log.debug(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_INFO)
+ log.info(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_WARNING)
+ log.warn(entry.getMessage(), throwable);
+
+ else if (level == LogService.LOG_ERROR)
+ log.error(entry.getMessage(), throwable);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingServiceActivator.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/bundle/logging/src/main/java/org/jboss/osgi/service/logging/LoggingServiceActivator.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -1,81 +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.logging;
-
-//$Id$
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogListener;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * The LoggingServiceActivator Activator
- *
- * @author thomas.diesler(a)jboss.com
- * @since 23-Jan-2009
- */
-public class LoggingServiceActivator implements BundleActivator
-{
- private ServiceTracker logTracker;
-
- /**
- * Implements BundleActivator.start().
- *
- * Track LogReaderService and add/remove LogListener
- */
- public void start(BundleContext context)
- {
- final LogListener listener = new JBossLoggingLogListener();
-
- // Track LogReaderService and add/remove LogListener
- logTracker = new ServiceTracker(context, LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference reference)
- {
- LogReaderService logReader = (LogReaderService)super.addingService(reference);
- logReader.addLogListener(listener);
- return logReader;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- super.removedService(reference, service);
- LogReaderService logReader = (LogReaderService)service;
- logReader.removeLogListener(listener);
- }
- };
- logTracker.open();
- }
-
- /*
- * Implements BundleActivator.stop().
- */
- public void stop(BundleContext context)
- {
- // NOTE: The service is automatically unregistered.
- }
-}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -35,10 +35,7 @@
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.SynchronousBundleListener;
/**
* An abstraction of an OSGi Framework
@@ -128,17 +125,6 @@
if (context == null)
throw new FrameworkException("Cannot obtain system context");
- BundleListener bndListener = new SynchronousBundleListener()
- {
- public void bundleChanged(BundleEvent event)
- {
- String symName = event.getBundle().getSymbolicName();
- String evType = bundleEvent(event.getType());
- //System.out.println("#1 BundleEvent " + symName + " " + evType);
- }
- };
- context.addBundleListener(bndListener);
-
Map<URI, Bundle> autoBundles = new HashMap<URI, Bundle>();
// Add the autoStart bundles to autoInstall
@@ -192,33 +178,4 @@
}
}
}
-
- /*
- * * Return the string representation of a {@link BundleEvent} type
- */
- private String bundleEvent(int eventType)
- {
- String retType = "[" + eventType + "]";
- if (BundleEvent.INSTALLED == eventType)
- retType = "INSTALLED";
- else if (BundleEvent.LAZY_ACTIVATION == eventType)
- retType = "LAZY_ACTIVATION";
- else if (BundleEvent.RESOLVED == eventType)
- retType = "RESOLVED";
- else if (BundleEvent.STARTING == eventType)
- retType = "STARTING";
- else if (BundleEvent.STARTED == eventType)
- retType = "STARTED";
- else if (BundleEvent.STOPPING == eventType)
- retType = "STOPPING";
- else if (BundleEvent.STOPPED == eventType)
- retType = "STOPPED";
- else if (BundleEvent.UNINSTALLED == eventType)
- retType = "UNINSTALLED";
- else if (BundleEvent.UNRESOLVED == eventType)
- retType = "UNRESOLVED";
- else if (BundleEvent.UPDATED == eventType)
- retType = "UPDATED";
- return retType;
- }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -50,14 +50,14 @@
return delegate;
}
- protected void startRemoteLogging(LogEntryCache entryCache) throws Exception
+ protected void startRemoteLogEntryTracking(LogEntryCache entryCache) throws Exception
{
- getDelegate().startRemoteLogging(entryCache);
+ getDelegate().startRemoteLogEntryTracking(entryCache);
}
- protected void stopRemoteLogging() throws Exception
+ protected void stopRemoteLogEntryTracking() throws Exception
{
- getDelegate().stopRemoteLogging();
+ getDelegate().stopRemoteLogEntryTracking();
}
protected boolean isRemoteIntegration()
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -70,7 +70,7 @@
setBootstrapProvider(bootProvider);
}
- protected void startRemoteLogging(final LogEntryCache logEntryCache) throws Exception
+ protected void startRemoteLogEntryTracking(final LogEntryCache logEntryCache) throws Exception
{
// Bootstrap the Framework and get the system bundle
OSGiFramework framework = getBootstrapProvider().getFramework();
@@ -98,7 +98,7 @@
deployBundle("bundles/jboss-osgi-remotelog.jar");
}
- protected void stopRemoteLogging() throws Exception
+ protected void stopRemoteLogEntryTracking() throws Exception
{
// Undeploy the RemoteLogListener from the remote OSGiFramework.
undeployBundle("bundles/jboss-osgi-remotelog.jar");
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -29,6 +29,7 @@
import org.jboss.logging.Logger;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.virtual.VFS;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -53,6 +54,15 @@
VFS.init();
}
+ private OSGiTestHelper getDelegate()
+ {
+ if (delegate == null)
+ {
+ delegate = new OSGiTestHelper();
+ }
+ return delegate;
+ }
+
protected OSGiBootstrapProvider createBootstrapProvider()
{
return delegate.createBootstrapProvider();
@@ -68,6 +78,16 @@
delegate.setBootstrapProvider(bootProvider);
}
+ protected void startLogEntryTracking(LogEntryCache entryCache) throws Exception
+ {
+ getDelegate().startLogEntryTracking(entryCache);
+ }
+
+ protected void stopLogEntryTracking() throws Exception
+ {
+ getDelegate().stopLogEntryTracking();
+ }
+
@Override
protected void setUp() throws Exception
{
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -27,9 +27,14 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.logging.LogEntryCache;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
/**
* An OSGi Test Helper
@@ -66,6 +71,30 @@
this.bootProvider = bootProvider;
}
+ protected void startLogEntryTracking(final LogEntryCache logEntryCache) throws Exception
+ {
+ // Bootstrap the Framework and get the system bundle
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+ ServiceTracker tracker = new ServiceTracker(sysContext, LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService service = (LogReaderService)super.addingService(sref);
+ service.addLogListener(logEntryCache);
+ return service;
+ }
+ };
+ tracker.open();
+ }
+
+ protected void stopLogEntryTracking() throws Exception
+ {
+ }
+
/** Try to discover the URL for the test resource */
public URL getResourceURL(String resource)
{
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -50,13 +50,13 @@
super.setUp();
logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
- startRemoteLogging(logEntryCache);
+ startRemoteLogEntryTracking(logEntryCache);
}
@Override
protected void tearDown() throws Exception
{
- stopRemoteLogging();
+ stopRemoteLogEntryTracking();
super.tearDown();
}
@@ -68,6 +68,9 @@
// Verify that the bundle is active
assertEquals("Remote bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+ // Wait a little for the asynchronous log entry to arrive
+ Thread.sleep(200);
+
// Undeploy the test bundle
undeployBundle("example/example-log.jar");
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-04-16 13:03:25 UTC (rev 87423)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-16 13:30:52 UTC (rev 87424)
@@ -26,18 +26,14 @@
import java.net.URL;
import java.util.List;
-import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.junit.OSGiTest;
import org.jboss.osgi.spi.logging.LogEntryCache;
import org.jboss.osgi.spi.logging.LogEntryFilter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
/**
* This example demonstrates the usage of the {@link LogService}
@@ -47,49 +43,44 @@
*/
public class LogServiceTestCase extends OSGiTest
{
+ private LogEntryCache logEntryCache;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+ startLogEntryTracking(logEntryCache);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ stopLogEntryTracking();
+ super.tearDown();
+ }
+
public void testLogEntryFilter() throws Exception
{
// Bootstrap the Framework and get the system bundle
- OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ OSGiFramework framework = getBootstrapProvider().getFramework();
BundleContext sysContext = framework.getSystemBundleContext();
- // Setup the LogEntryCache
- final LogEntryCache logEntryCache = new LogEntryCache();
- logEntryCache.addFilter(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
-
- // Track the LogReaderService to add the LogEntryCache as LogListener
- ServiceTracker tracker = new ServiceTracker(sysContext, LogReaderService.class.getName(), null)
- {
- @Override
- public Object addingService(ServiceReference sref)
- {
- LogReaderService service = (LogReaderService)super.addingService(sref);
- service.addLogListener(logEntryCache);
- return service;
- }
- };
- tracker.open();
-
- // Install and start the 3rd party LogService.
- // This will register the LogReaderService that we track above.
- URL testURL = getTestArchiveURL("bundles/org.apache.felix.log.jar");
- Bundle logServiceBundle = sysContext.installBundle(testURL.toExternalForm());
- logServiceBundle.start();
-
// Install and start the test bundle
- testURL = getTestArchiveURL("example/example-log.jar");
+ URL testURL = getTestArchiveURL("example/example-log.jar");
Bundle bundleA = sysContext.installBundle(testURL.toExternalForm());
bundleA.start();
// Verify that the bundle is active
assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+ // Wait a little for the asynchronous log entry to arrive
+ Thread.sleep(200);
+
// Uninstall the test bundle
bundleA.uninstall();
- // Uninstall the 3rd party LogService
- logServiceBundle.uninstall();
-
// Verify the received log entries
List<LogEntry> entries = logEntryCache.getLog();
assertEquals("Number of entries", 1, entries.size());
16 years, 8 months
JBoss-OSGI SVN: r87415 - in projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs: jbossosgi-jdk16 and 1 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 08:36:42 -0400 (Thu, 16 Apr 2009)
New Revision: 87415
Modified:
projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml
projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
Log:
Fix Hudson JavaDoc locataion
Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml 2009-04-16 12:36:14 UTC (rev 87414)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk15/config.xml 2009-04-16 12:36:42 UTC (rev 87415)
@@ -59,10 +59,6 @@
</hudson.tasks.Shell>
</builders>
<publishers class="vector">
- <hudson.tasks.JavadocArchiver>
- <javadocDir>jboss-osgi/runtime/spi/target/apidocs</javadocDir>
- <keepAll>false</keepAll>
- </hudson.tasks.JavadocArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
<testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
</hudson.tasks.junit.JUnitResultArchiver>
Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-04-16 12:36:14 UTC (rev 87414)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-jdk16/config.xml 2009-04-16 12:36:42 UTC (rev 87415)
@@ -60,7 +60,7 @@
</builders>
<publishers class="vector">
<hudson.tasks.JavadocArchiver>
- <javadocDir>jboss-osgi/runtime/spi/target/apidocs</javadocDir>
+ <javadocDir>jboss-osgi/spi/target/apidocs</javadocDir>
<keepAll>false</keepAll>
</hudson.tasks.JavadocArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-04-16 12:36:14 UTC (rev 87414)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/jobs/jbossosgi-matrix/config.xml 2009-04-16 12:36:42 UTC (rev 87415)
@@ -78,10 +78,6 @@
</hudson.tasks.Shell>
</builders>
<publishers class="vector">
- <hudson.tasks.JavadocArchiver>
- <javadocDir>jboss-osgi/runtime/spi/target/apidocs</javadocDir>
- <keepAll>false</keepAll>
- </hudson.tasks.JavadocArchiver>
<hudson.tasks.junit.JUnitResultArchiver>
<testResults>jboss-osgi/**/target/surefire-reports/TEST-*.xml</testResults>
</hudson.tasks.junit.JUnitResultArchiver>
16 years, 8 months
JBoss-OSGI SVN: r87409 - in projects/jboss-osgi/trunk: build/distribution/src/main/resources/installer and 32 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 07:05:27 -0400 (Thu, 16 Apr 2009)
New Revision: 87409
Added:
projects/jboss-osgi/trunk/bundle/common/
projects/jboss-osgi/trunk/bundle/common/.classpath
projects/jboss-osgi/trunk/bundle/common/.project
projects/jboss-osgi/trunk/bundle/common/.settings/
projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/bundle/common/pom.xml
projects/jboss-osgi/trunk/bundle/common/src/
projects/jboss-osgi/trunk/bundle/common/src/main/
projects/jboss-osgi/trunk/bundle/common/src/main/java/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/StringConstants.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/internal/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/internal/LogEntryImpl.java
Removed:
projects/jboss-osgi/trunk/bundle/common/.classpath
projects/jboss-osgi/trunk/bundle/common/.project
projects/jboss-osgi/trunk/bundle/common/.settings/
projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/bundle/common/pom.xml
projects/jboss-osgi/trunk/bundle/common/src/
projects/jboss-osgi/trunk/bundle/common/src/main/
projects/jboss-osgi/trunk/bundle/common/src/main/java/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/
Modified:
projects/jboss-osgi/trunk/build/distribution/pom.xml
projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/bundle/logging/pom.xml
projects/jboss-osgi/trunk/bundle/pom.xml
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
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/RemoteLogReaderServiceImpl.java
projects/jboss-osgi/trunk/runtime/felix/pom.xml
projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.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/log/LogServiceRemoteTestCase.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/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
Log:
Cleanup dependencie on logging API
Modified: projects/jboss-osgi/trunk/build/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -36,6 +36,17 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <classifier>sources</classifier>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
</dependency>
Modified: projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -119,6 +119,7 @@
<include name="jboss-osgi-runtime-deployer.jar" />
<include name="jboss-osgi-runtime-felix.jar" />
<include name="jboss-osgi-spi.jar" />
+ <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
<include name="org.apache.felix.framework.jar" />
@@ -135,6 +136,7 @@
<include name="jboss-osgi-runtime-deployer-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
<include name="jboss-osgi-spi-sources.jar" />
+ <include name="jboss-osgi-common-sources.jar" />
<include name="jboss-osgi-logging-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
</fileset>
@@ -169,6 +171,7 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
+ <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
@@ -244,6 +247,7 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
+ <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
Copied: projects/jboss-osgi/trunk/bundle/common (from rev 87406, projects/jboss-osgi/trunk/bundle/common)
Property changes on: projects/jboss-osgi/trunk/bundle/common
___________________________________________________________________
Name: svn:ignore
+ target
Deleted: projects/jboss-osgi/trunk/bundle/common/.classpath
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.classpath 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/.classpath 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Copied: projects/jboss-osgi/trunk/bundle/common/.classpath (from rev 87406, projects/jboss-osgi/trunk/bundle/common/.classpath)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.classpath (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/.classpath 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Deleted: projects/jboss-osgi/trunk/bundle/common/.project
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.project 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/.project 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jboss-osgi-common</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- </natures>
-</projectDescription>
Copied: projects/jboss-osgi/trunk/bundle/common/.project (from rev 87406, projects/jboss-osgi/trunk/bundle/common/.project)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.project (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/.project 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Copied: projects/jboss-osgi/trunk/bundle/common/.settings (from rev 87406, projects/jboss-osgi/trunk/bundle/common/.settings)
Deleted: projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,5 +0,0 @@
-#Tue Apr 14 17:48:49 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.source=1.5
Copied: projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs (from rev 87406, projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/.settings/org.eclipse.jdt.core.prefs 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,5 @@
+#Tue Apr 14 17:48:49 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Deleted: projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,9 +0,0 @@
-#Tue Apr 14 17:48:48 CEST 2009
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
Copied: projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs (from rev 87406, projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/.settings/org.maven.ide.eclipse.prefs 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,9 @@
+#Tue Apr 14 17:48:48 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Deleted: projects/jboss-osgi/trunk/bundle/common/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,59 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <name>JBossOSGi - Bundle Common</name>
- <artifactId>jboss-osgi-common</artifactId>
- <packaging>bundle</packaging>
-
- <parent>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-bundle</artifactId>
- <version>1.0.0.Beta1</version>
- </parent>
-
- <!-- Properties -->
- <properties>
- </properties>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-SymbolicName>org.jboss.osgi.common</Bundle-SymbolicName>
- <Export-Package>
- org.jboss.osgi.common,
- org.jboss.osgi.common.log
- </Export-Package>
- <Private-Package>
- org.jboss.osgi.common.log.internal
- </Private-Package>
- <Import-Package>
- org.osgi.framework;version=1.4,
- org.osgi.service.log;version=1.3,
- org.osgi.util.tracker
- </Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
Copied: projects/jboss-osgi/trunk/bundle/common/pom.xml (from rev 87406, projects/jboss-osgi/trunk/bundle/common/pom.xml)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,64 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - Bundle Common</name>
+ <artifactId>jboss-osgi-common</artifactId>
+ <packaging>bundle</packaging>
+
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-bundle</artifactId>
+ <version>1.0.0.Beta1</version>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ </properties>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.jboss.osgi.common</Bundle-SymbolicName>
+ <Export-Package>
+ org.jboss.osgi.common,
+ org.jboss.osgi.common.log
+ </Export-Package>
+ <Private-Package>
+ org.jboss.osgi.common.log.internal
+ </Private-Package>
+ <Import-Package>
+ org.osgi.framework;version=1.4,
+ org.osgi.service.log;version=1.3,
+ org.osgi.util.tracker
+ </Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Copied: projects/jboss-osgi/trunk/bundle/common/src (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common)
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log)
Deleted: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,81 +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.common.log;
-
-//$Id$
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * A basic LogService that writes to System.out
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class LogServiceTracker extends ServiceTracker implements LogService
-{
- private LogService log;
-
- public LogServiceTracker(BundleContext context)
- {
- super(context, LogService.class.getName(), null);
- log = new SystemLogService(context);
- open();
- }
-
- @Override
- public Object addingService(ServiceReference reference)
- {
- log = (LogService)super.addingService(reference);
- return log;
- }
-
- @Override
- public void removedService(ServiceReference reference, Object service)
- {
- super.removedService(reference, service);
- log = new SystemLogService(context);
- }
-
- public void log(int level, String message)
- {
- log.log(level, message);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- log.log(level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- log.log(sr, level, message);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- log.log(sr, level, message, exception);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,81 @@
+/*
+ * 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.common.log;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A basic LogService that writes to System.out
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class LogServiceTracker extends ServiceTracker implements LogService
+{
+ private LogService log;
+
+ public LogServiceTracker(BundleContext context)
+ {
+ super(context, LogService.class.getName(), null);
+ log = new SystemLogService(context);
+ open();
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ log = (LogService)super.addingService(reference);
+ return log;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ log = new SystemLogService(context);
+ }
+
+ public void log(int level, String message)
+ {
+ log.log(level, message);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ log.log(level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ log.log(sr, level, message);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ log.log(sr, level, message, exception);
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-04-16 08:53:22 UTC (rev 87406)
+++ projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -1,77 +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.common.log;
-
-//$Id$
-
-import org.jboss.osgi.common.log.internal.LogEntryImpl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
-
-/**
- * A basic LogService that writes to System.out
- *
- * @author thomas.diesler(a)jboss.com
- * @since 11-Apr-2009
- */
-public class SystemLogService implements LogService
-{
- private BundleContext context;
-
- public SystemLogService(BundleContext context)
- {
- this.context = context;
- }
-
- public void log(int level, String message)
- {
- logInternal(null, level, message, null);
- }
-
- public void log(int level, String message, Throwable exception)
- {
- logInternal(null, level, message, exception);
- }
-
- public void log(ServiceReference sr, int level, String message)
- {
- logInternal(sr, level, message, null);
- }
-
- public void log(ServiceReference sr, int level, String message, Throwable exception)
- {
- logInternal(sr, level, message, exception);
- }
-
- private void logInternal(ServiceReference sr, int level, String message, Throwable exception)
- {
- long time = System.currentTimeMillis();
- Bundle bundle = context.getBundle();
-
- System.out.println(new LogEntryImpl(time, bundle, sr, level, message, exception));
-
- if (exception != null)
- exception.printStackTrace(System.out);
- }
-}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java (from rev 87406, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java)
===================================================================
--- projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java (rev 0)
+++ projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,115 @@
+/*
+ * 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.common.log;
+
+//$Id$
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+
+/**
+ * A basic LogService that writes to System.out
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class SystemLogService implements LogService
+{
+ private BundleContext context;
+
+ public SystemLogService(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void log(int level, String message)
+ {
+ logInternal(null, level, message, null);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ logInternal(null, level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ logInternal(sr, level, message, null);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ logInternal(sr, level, message, exception);
+ }
+
+ private void logInternal(ServiceReference sref, int level, String message, Throwable exception)
+ {
+ long time = System.currentTimeMillis();
+ Bundle bundle = context.getBundle();
+
+ String bndStr = bundle.getSymbolicName();
+
+ String srefStr = null;
+ if (sref != null && sref.getBundle() != null)
+ srefStr = sref.getBundle().getSymbolicName();
+
+ String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
+ String l = " " + logLevel(level);
+ String s = srefStr != null ? ",sref=" + srefStr : "";
+ String b = ",bnd=" + bndStr;
+ String m = ",msg=" + message;
+ String e = exception != null ? ",ex=" + exception : "";
+
+ System.out.println("[" + t + l + b + s + m + e + "]");
+
+ if (exception != null)
+ exception.printStackTrace(System.out);
+ }
+
+ private String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/bundle/logging/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -22,6 +22,11 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -31,11 +36,6 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <scope>provided</scope>
- </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -13,6 +13,7 @@
<!-- Modules -->
<modules>
+ <module>common</module>
<module>logging</module>
<module>remotelog</module>
<module>webconsole</module>
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -84,7 +84,7 @@
org.osgi.framework,
org.osgi.service.log,
org.osgi.util.tracker,
-
+
javax.crypto;resolution:=optional,
javax.crypto.spec;resolution:=optional,
javax.management,
@@ -96,7 +96,7 @@
org.apache.log4j,
org.jboss.logging,
org.jboss.mx.util;resolution:=optional,
- org.jboss.osgi.spi.service.log,
+ org.jboss.osgi.spi.logging,
org.jboss.remoting;resolution:=optional,
org.jboss.remoting.*;resolution:=optional,
org.jboss.util.*,
Modified: 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-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -26,7 +26,7 @@
import java.util.Properties;
import org.jboss.osgi.service.remotelog.internal.RemoteLogReaderServiceImpl;
-import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
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-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -32,7 +32,7 @@
import org.jboss.osgi.service.remotelog.NotImplementedException;
import org.jboss.osgi.service.remotelog.RemoteLogActivator;
-import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvocationHandler;
Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -47,6 +47,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -16,6 +16,7 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -11,7 +11,7 @@
<entry>
<key>org.osgi.framework.system.packages</key>
<value>
- org.jboss.osgi.spi.service.log,
+ org.jboss.osgi.spi.logging,
org.osgi.framework; version=1.4,
org.osgi.service.log; version=1.3,
org.osgi.util.tracker; version=1.3,
@@ -40,6 +40,7 @@
<property name="autoStart">
<list elementClass="java.net.URI">
<value>file://${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
+ <value>file://${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
<value>file://${test.archive.directory}/bundles/jboss-osgi-logging.jar</value>
</list>
</property>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -16,8 +16,8 @@
javax.management,
javax.xml.parsers,
org.jboss.logging,
+ org.jboss.osgi.spi.logging,
org.jboss.osgi.spi.management,
- org.jboss.osgi.spi.service.log,
org.jboss.osgi.spi.service.microcontainer,
org.osgi.framework; version=1.4,
org.osgi.service.packageadmin; version=1.2,
@@ -51,6 +51,7 @@
<property name="autoStart">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.jar</value>
+ <value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-logging.jar</value>
</list>
</property>
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -29,7 +29,7 @@
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.framework.RemoteFramework;
-import org.jboss.osgi.spi.service.log.LogEntryCache;
+import org.jboss.osgi.spi.logging.LogEntryCache;
/**
* An integration test case
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -41,12 +41,12 @@
import org.jboss.osgi.spi.framework.RemoteBundle;
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.service.log.LogEntryCache;
-import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java (from rev 87408, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryCache.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryCache.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,171 @@
+/*
+ * 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.logging;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.logging.internal.LogEntryImpl;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogListener;
+
+/**
+ * A LogListener that caches LogEntry objects for later retrieval.
+ *
+ * The entries can be filtered with a list of {@link LogEntryFilter} instances.
+ * A log entry is cached if it matches at least one of the registered filters.
+ * If there is no filter registered entries are cached unconditionally.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryCache implements LogListener
+{
+ private List<LogEntry> entries = new ArrayList<LogEntry>();
+ private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
+
+ /**
+ * Create a LogEntryCache with a single associated filter
+ */
+ public LogEntryCache(LogEntryFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ /**
+ * Create a LogEntryCache with no associated filters
+ */
+ public LogEntryCache()
+ {
+ }
+
+ /**
+ * Add a LogEntryFilter
+ */
+ public void addFilter(LogEntryFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ /**
+ * Clear the list of cached entries.
+ */
+ public void clear()
+ {
+ synchronized (entries)
+ {
+ entries.clear();
+ }
+ }
+
+ /**
+ * Clear the list of registered filters.
+ */
+ public void clearFilters()
+ {
+ // filters.clear() would need synchronization
+ filters = new ArrayList<LogEntryFilter>();
+ }
+
+ /**
+ * Get the list of cached entries.
+ *
+ * Note, that the LogService delivers LogEntries asynchronously.
+ * Client should not rely on a certain LogEntry already beein delivered
+ * when calling this method.
+ */
+ public List<LogEntry> getLog()
+ {
+ return getLog(false);
+ }
+
+ /**
+ * Get the list of cached entries and optionally clears the list.
+ *
+ * Note, that the LogService delivers LogEntries asynchronously.
+ * Client should not rely on a certain LogEntry already beein delivered
+ * when calling this method.
+ */
+ public List<LogEntry> getLog(boolean clear)
+ {
+ synchronized (entries)
+ {
+ ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
+ if (clear == true)
+ entries.clear();
+
+ return retList;
+ }
+ }
+
+ /**
+ * Listener method called for each LogEntry object created.
+ */
+ public void logged(LogEntry entry)
+ {
+ // Replace entry with a unified wrapper
+ entry = new LogEntryImpl(entry);
+
+ List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
+ synchronized (entries)
+ {
+ if (snapshot.size() == 0)
+ {
+ entries.add(entry);
+ return;
+ }
+
+ // Add the entry if if matches at least one filter
+ for (LogEntryFilter filter : snapshot)
+ {
+ if (match(filter, entry))
+ {
+ entries.add(entry);
+ break;
+ }
+ }
+ }
+ }
+
+ private boolean match(LogEntryFilter filter, LogEntry entry)
+ {
+ boolean match = entry.getLevel() <= filter.getLevel();
+
+ if (match && filter.getBundleRegex() != null)
+ {
+ String entryBnd = entry.getBundle().getSymbolicName();
+ String filterRegex = filter.getBundleRegex();
+ match = entryBnd.matches(filterRegex);
+ }
+
+ if (match && filter.getMessageRegex() != null)
+ {
+ String entryMsg = entry.getMessage();
+ String filterRegex = filter.getMessageRegex();
+ match = entryMsg.matches(filterRegex);
+ }
+
+ return match;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java (from rev 87408, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryFilter.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/LogEntryFilter.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -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.osgi.spi.logging;
+
+//$Id$
+
+
+/**
+ * A LogEntry filter that can be used with the LogEntryCache
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryFilter
+{
+ private int level;
+ private String bndRegex;
+ private String msgRegex;
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ * @param level The maximum log level accepted by this filter
+ * @param msgRegex A regex that matches the log message
+ */
+ public LogEntryFilter(String bndRegex, int level, String msgRegex)
+ {
+ this.bndRegex = bndRegex;
+ this.msgRegex = msgRegex;
+ this.level = level < 1 ? Integer.MAX_VALUE : level;
+ }
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ * @param level The maximum log level accepted by this filter
+ */
+ public LogEntryFilter(String bndRegex, int level)
+ {
+ this(bndRegex, level, null);
+ }
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ */
+ public LogEntryFilter(String bndRegex)
+ {
+ this(bndRegex, Integer.MAX_VALUE, null);
+ }
+
+ /**
+ * Get the Bundle Symbolic-Name regex.
+ */
+ public String getBundleRegex()
+ {
+ return bndRegex;
+ }
+
+ /**
+ * Get the log message regex.
+ */
+ public String getMessageRegex()
+ {
+ return msgRegex;
+ }
+
+ /**
+ * Get the log entry maximum log level.
+ */
+ public int getLevel()
+ {
+ return level;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java (from rev 87408, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/RemoteLogReaderService.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/RemoteLogReaderService.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,36 @@
+/*
+ * 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.logging;
+
+//$Id$
+
+import org.osgi.service.log.LogReaderService;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Apr-2009
+ */
+public interface RemoteLogReaderService extends LogReaderService
+{
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/StringConstants.java (from rev 87408, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/StringConstants.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/StringConstants.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/StringConstants.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,113 @@
+/*
+ * 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.logging;
+
+//$Id$
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+import org.osgi.service.log.LogService;
+
+/**
+ * String representation for common OSGi Constants
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public abstract class StringConstants
+{
+ /**
+ * Return the string representation of a {@link Bundle} state
+ */
+ public static String bundleState(int bundleState)
+ {
+ String retState = "[" + bundleState + "]";
+ if (Bundle.UNINSTALLED == bundleState)
+ retState = "UNINSTALLED";
+ else if (Bundle.INSTALLED == bundleState)
+ retState = "INSTALLED";
+ else if (Bundle.RESOLVED == bundleState)
+ retState = "RESOLVED";
+ else if (Bundle.STARTING == bundleState)
+ retState = "STARTING";
+ else if (Bundle.STOPPING == bundleState)
+ retState = "STOPPING";
+ else if (Bundle.ACTIVE == bundleState)
+ retState = "ACTIVE";
+ return retState;
+ }
+
+ /**
+ * Return the string representation of a {@link BundleEvent} type
+ */
+ public static String bundleEvent(int eventType)
+ {
+ String retType = "[" + eventType + "]";
+ if (BundleEvent.INSTALLED == eventType)
+ retType = "INSTALLED";
+ else if (BundleEvent.LAZY_ACTIVATION == eventType)
+ retType = "LAZY_ACTIVATION";
+ else if (BundleEvent.RESOLVED == eventType)
+ retType = "RESOLVED";
+ else if (BundleEvent.STARTING == eventType)
+ retType = "STARTING";
+ else if (BundleEvent.STARTED == eventType)
+ retType = "STARTED";
+ else if (BundleEvent.STOPPING == eventType)
+ retType = "STOPPING";
+ else if (BundleEvent.STOPPED == eventType)
+ retType = "STOPPED";
+ else if (BundleEvent.UNINSTALLED == eventType)
+ retType = "UNINSTALLED";
+ else if (BundleEvent.UNRESOLVED == eventType)
+ retType = "UNRESOLVED";
+ else if (BundleEvent.UPDATED == eventType)
+ retType = "UPDATED";
+ return retType;
+ }
+
+ /**
+ * Return the string representation of a {@link LogService} level
+ */
+ public static String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/internal/LogEntryImpl.java (from rev 87408, projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/LogEntryImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/internal/LogEntryImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/logging/internal/LogEntryImpl.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -0,0 +1,137 @@
+/*
+ * 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.logging.internal;
+
+// $Id$
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogService;
+
+/**
+ * A unified implementation of a LogEntry.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryImpl implements LogEntry
+{
+ private long time;
+ private int level;
+ private Bundle bundle;
+ private ServiceReference sref;
+ private String message;
+ private Throwable exception;
+
+ private String bndStr;
+ private String srefStr;
+
+ public LogEntryImpl(LogEntry le)
+ {
+ this(le.getTime(), le.getBundle(), le.getServiceReference(), le.getLevel(), le.getMessage(), le.getException());
+ }
+
+ public LogEntryImpl(long time, Bundle bundle, ServiceReference sref, int level, String message, Throwable exception)
+ {
+ this.time = time;
+ this.bundle = bundle;
+ this.sref = sref;
+ this.level = level;
+ this.message = message;
+ this.exception = exception;
+
+ if (bundle != null)
+ bndStr = bundle.getSymbolicName();
+
+ if (sref != null && sref.getBundle() != null)
+ srefStr = sref.getBundle().getSymbolicName();
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public Throwable getException()
+ {
+ return exception;
+ }
+
+ public int getLevel()
+ {
+ return level;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public ServiceReference getServiceReference()
+ {
+ return sref;
+ }
+
+ public long getTime()
+ {
+ return time;
+ }
+
+ private String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+
+ @Override
+ public String toString()
+ {
+ String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
+ String l = " " + logLevel(level);
+ String s = srefStr != null ? ",sref=" + srefStr : "";
+ String b = ",bnd=" + bndStr;
+ String m = ",msg=" + message;
+ String e = exception != null ? ",ex=" + exception : "";
+ return "[" + t + l + b + s + m + e + "]";
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -63,6 +63,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -16,6 +16,7 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -27,9 +27,9 @@
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.junit.IntegrationTest;
-import org.jboss.osgi.spi.service.log.LogEntryCache;
-import org.jboss.osgi.spi.service.log.LogEntryFilter;
-import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
+import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.logging.LogEntryFilter;
+import org.jboss.osgi.spi.logging.RemoteLogReaderService;
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogService;
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-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -29,8 +29,8 @@
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.junit.OSGiTest;
-import org.jboss.osgi.spi.service.log.LogEntryCache;
-import org.jboss.osgi.spi.service.log.LogEntryFilter;
+import org.jboss.osgi.spi.logging.LogEntryCache;
+import org.jboss.osgi.spi.logging.LogEntryFilter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -25,7 +25,7 @@
import static org.osgi.service.log.LogService.LOG_INFO;
-import org.jboss.osgi.spi.service.log.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -63,6 +63,12 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 11:05:27 UTC (rev 87409)
@@ -16,6 +16,7 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -23,7 +23,7 @@
//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.spi.service.log.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subA.PojoA;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -23,7 +23,7 @@
//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.spi.service.log.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subB.PojoB;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-16 10:17:13 UTC (rev 87408)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-16 11:05:27 UTC (rev 87409)
@@ -23,7 +23,7 @@
//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.spi.service.log.LogServiceTracker;
+import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
16 years, 8 months
JBoss-OSGI SVN: r87408 - in projects/jboss-osgi/trunk: build/distribution and 33 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 06:17:13 -0400 (Thu, 16 Apr 2009)
New Revision: 87408
Added:
projects/jboss-osgi/trunk/spi/
projects/jboss-osgi/trunk/spi/pom.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryCache.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryFilter.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogServiceTracker.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/RemoteLogReaderService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/StringConstants.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/SystemLogService.java
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/LogEntryImpl.java
Removed:
projects/jboss-osgi/trunk/bundle/common/
projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogReaderService.java
projects/jboss-osgi/trunk/runtime/spi/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/service/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/framework/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/internal/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/management/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/service/
projects/jboss-osgi/trunk/spi/pom.xml
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/service/
projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/junit/
Modified:
projects/jboss-osgi/trunk/build/distribution/pom.xml
projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/bundle/logging/pom.xml
projects/jboss-osgi/trunk/bundle/pom.xml
projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
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/RemoteLogReaderServiceImpl.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/deployer/pom.xml
projects/jboss-osgi/trunk/runtime/equinox/pom.xml
projects/jboss-osgi/trunk/runtime/felix/pom.xml
projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
projects/jboss-osgi/trunk/runtime/pom.xml
projects/jboss-osgi/trunk/runtime/testing/pom.xml
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.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/log/LogServiceRemoteTestCase.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/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
Log:
Refactor common log stuff to SPI
Modified: projects/jboss-osgi/trunk/build/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -36,11 +36,6 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
</dependency>
@@ -63,18 +58,18 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<classifier>sources</classifier>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<classifier>javadoc</classifier>
<version>${version}</version>
</dependency>
Modified: projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -108,7 +108,7 @@
</fileset>
<!-- JBossOSGi Docs -->
- <file src="@{deploy.artifacts.dir}/lib/jboss-osgi-runtime-spi-javadoc.jar" targetdir="$INSTALL_PATH/docs/apidocs" unpack="true" override="true" />
+ <file src="@{deploy.artifacts.dir}/lib/jboss-osgi-spi-javadoc.jar" targetdir="$INSTALL_PATH/docs/apidocs" unpack="true" override="true" />
<fileset dir="@{deploy.artifacts.dir}/docs/userguide" targetdir="$INSTALL_PATH/docs/userguide" override="true"/>
<!-- JBossOSGi Examples -->
@@ -116,10 +116,9 @@
<!-- JBossOSGi Lib -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/lib" override="true">
- <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-runtime-deployer.jar" />
<include name="jboss-osgi-runtime-felix.jar" />
- <include name="jboss-osgi-runtime-spi.jar" />
+ <include name="jboss-osgi-spi.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
<include name="org.apache.felix.framework.jar" />
@@ -135,7 +134,7 @@
<fileset dir="@{deploy.artifacts.dir}/source" targetdir="$INSTALL_PATH/source" override="true">
<include name="jboss-osgi-runtime-deployer-sources.jar" />
<include name="jboss-osgi-runtime-felix-sources.jar" />
- <include name="jboss-osgi-runtime-spi-sources.jar" />
+ <include name="jboss-osgi-spi-sources.jar" />
<include name="jboss-osgi-logging-sources.jar" />
<include name="jboss-osgi-webconsole-sources.jar" />
</fileset>
@@ -161,7 +160,7 @@
<!-- JBossOSGi Runtime deployers/osgi.deployer -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/runtime/server/default/deployers/osgi.deployer" override="true">
<include name="jboss-osgi-runtime-deployer.jar" />
- <include name="jboss-osgi-runtime-spi.jar" />
+ <include name="jboss-osgi-spi.jar" />
</fileset>
<!-- JBossOSGi Runtime deploy/osgi -->
@@ -170,7 +169,6 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
- <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
@@ -237,7 +235,7 @@
<!-- deployers/osgi.deployer -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/osgi.deployer" override="true">
<include name="jboss-osgi-runtime-deployer.jar" />
- <include name="jboss-osgi-runtime-spi.jar" />
+ <include name="jboss-osgi-spi.jar" />
</fileset>
<!-- deploy/osgi -->
@@ -246,7 +244,6 @@
<include name="org.apache.felix.http.jetty.jar" />
<include name="org.apache.felix.log.jar" />
<include name="org.apache.felix.metatype.jar" />
- <include name="jboss-osgi-common.jar" />
<include name="jboss-osgi-logging.jar" />
<include name="jboss-osgi-webconsole.jar" />
</fileset>
Modified: projects/jboss-osgi/trunk/bundle/logging/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/logging/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -36,11 +36,6 @@
<artifactId>jboss-logging-spi</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/trunk/bundle/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -13,7 +13,6 @@
<!-- Modules -->
<modules>
- <module>common</module>
<module>logging</module>
<module>remotelog</module>
<module>webconsole</module>
Modified: projects/jboss-osgi/trunk/bundle/remotelog/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/remotelog/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -25,6 +25,11 @@
<!-- Dependencies -->
<dependencies>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -90,7 +95,8 @@
javax.servlet.http;resolution:=optional,
org.apache.log4j,
org.jboss.logging,
- org.jboss.mx.util;resolution:=optional,
+ org.jboss.mx.util;resolution:=optional,
+ org.jboss.osgi.spi.service.log,
org.jboss.remoting;resolution:=optional,
org.jboss.remoting.*;resolution:=optional,
org.jboss.util.*,
Modified: 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-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogActivator.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -26,6 +26,7 @@
import java.util.Properties;
import org.jboss.osgi.service.remotelog.internal.RemoteLogReaderServiceImpl;
+import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
Deleted: projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogReaderService.java
===================================================================
--- projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogReaderService.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogReaderService.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -1,36 +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 org.osgi.service.log.LogReaderService;
-
-/**
- * [TODO]
- *
- * @author thomas.diesler(a)jboss.com
- * @since 12-Apr-2009
- */
-public interface RemoteLogReaderService extends LogReaderService
-{
-}
\ No newline at end of file
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-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/internal/RemoteLogReaderServiceImpl.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -32,7 +32,7 @@
import org.jboss.osgi.service.remotelog.NotImplementedException;
import org.jboss.osgi.service.remotelog.RemoteLogActivator;
-import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
+import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
import org.jboss.remoting.InvocationRequest;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.ServerInvocationHandler;
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -30,6 +30,7 @@
<modules>
<module>microcontainer</module>
<module>repository</module>
+ <module>spi</module>
<module>bundle</module>
<module>runtime</module>
<module>testsuite</module>
Modified: projects/jboss-osgi/trunk/runtime/deployer/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/deployer/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/deployer/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -33,7 +33,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/runtime/equinox/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -28,7 +28,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -23,7 +23,7 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
@@ -47,12 +47,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -16,7 +16,6 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
- <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -35,7 +35,10 @@
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
import org.osgi.framework.BundleException;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.SynchronousBundleListener;
/**
* An abstraction of an OSGi Framework
@@ -119,50 +122,61 @@
}
public void start()
- {
- // Get system bundle context
- BundleContext context = framework.getBundleContext();
- if (context == null)
- throw new FrameworkException("Cannot obtain system context");
-
- Map<URI, Bundle> autoBundles = new HashMap<URI, Bundle>();
+ {
+ // Get system bundle context
+ BundleContext context = framework.getBundleContext();
+ if (context == null)
+ throw new FrameworkException("Cannot obtain system context");
- // Add the autoStart bundles to autoInstall
- for (URI bundleURI : autoStart)
- {
- autoInstall.add(bundleURI);
- }
+ BundleListener bndListener = new SynchronousBundleListener()
+ {
+ public void bundleChanged(BundleEvent event)
+ {
+ String symName = event.getBundle().getSymbolicName();
+ String evType = bundleEvent(event.getType());
+ //System.out.println("#1 BundleEvent " + symName + " " + evType);
+ }
+ };
+ context.addBundleListener(bndListener);
- // Install autoInstall bundles
- for (URI bundleURI : autoInstall)
- {
- try
+ Map<URI, Bundle> autoBundles = new HashMap<URI, Bundle>();
+
+ // Add the autoStart bundles to autoInstall
+ for (URI bundleURI : autoStart)
{
- Bundle bundle = context.installBundle(bundleURI.toString());
- log.info("Installed bundle: " + bundle.getSymbolicName());
- autoBundles.put(bundleURI, bundle);
+ autoInstall.add(bundleURI);
}
- catch (BundleException ex)
+
+ // Install autoInstall bundles
+ for (URI bundleURI : autoInstall)
{
- log.error("Cannot install bundle: " + bundleURI, ex);
+ try
+ {
+ Bundle bundle = context.installBundle(bundleURI.toString());
+ log.info("Installed bundle: " + bundle.getSymbolicName());
+ autoBundles.put(bundleURI, bundle);
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot install bundle: " + bundleURI, ex);
+ }
}
- }
- // Start autoStart bundles
- for (URI bundleURI : autoStart)
- {
- try
+ // Start autoStart bundles
+ for (URI bundleURI : autoStart)
{
- Bundle bundle = autoBundles.get(bundleURI);
- bundle.start();
- log.info("Started bundle: " + bundle.getSymbolicName());
+ try
+ {
+ Bundle bundle = autoBundles.get(bundleURI);
+ bundle.start();
+ log.info("Started bundle: " + bundle.getSymbolicName());
+ }
+ catch (BundleException ex)
+ {
+ log.error("Cannot start bundle: " + bundleURI, ex);
+ }
}
- catch (BundleException ex)
- {
- log.error("Cannot start bundle: " + bundleURI, ex);
- }
- }
- }
+ }
public void stop()
{
@@ -178,4 +192,33 @@
}
}
}
+
+ /*
+ * * Return the string representation of a {@link BundleEvent} type
+ */
+ private String bundleEvent(int eventType)
+ {
+ String retType = "[" + eventType + "]";
+ if (BundleEvent.INSTALLED == eventType)
+ retType = "INSTALLED";
+ else if (BundleEvent.LAZY_ACTIVATION == eventType)
+ retType = "LAZY_ACTIVATION";
+ else if (BundleEvent.RESOLVED == eventType)
+ retType = "RESOLVED";
+ else if (BundleEvent.STARTING == eventType)
+ retType = "STARTING";
+ else if (BundleEvent.STARTED == eventType)
+ retType = "STARTED";
+ else if (BundleEvent.STOPPING == eventType)
+ retType = "STOPPING";
+ else if (BundleEvent.STOPPED == eventType)
+ retType = "STOPPED";
+ else if (BundleEvent.UNINSTALLED == eventType)
+ retType = "UNINSTALLED";
+ else if (BundleEvent.UNRESOLVED == eventType)
+ retType = "UNRESOLVED";
+ else if (BundleEvent.UPDATED == eventType)
+ retType = "UPDATED";
+ return retType;
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/jboss-osgi-beans.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -11,10 +11,11 @@
<entry>
<key>org.osgi.framework.system.packages</key>
<value>
+ org.jboss.osgi.spi.service.log,
org.osgi.framework; version=1.4,
org.osgi.service.log; version=1.3,
org.osgi.util.tracker; version=1.3,
-
+
<!-- needed by jboss-remoting -->
javax.management,
javax.naming,
@@ -39,7 +40,6 @@
<property name="autoStart">
<list elementClass="java.net.URI">
<value>file://${test.archive.directory}/bundles/org.apache.felix.log.jar</value>
- <value>file://${test.archive.directory}/bundles/jboss-osgi-common.jar</value>
<value>file://${test.archive.directory}/bundles/jboss-osgi-logging.jar</value>
</list>
</property>
Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/resources/osgi-deployers-jboss-beans.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -16,8 +16,9 @@
javax.management,
javax.xml.parsers,
org.jboss.logging,
+ org.jboss.osgi.spi.management,
+ org.jboss.osgi.spi.service.log,
org.jboss.osgi.spi.service.microcontainer,
- org.jboss.osgi.spi.management,
org.osgi.framework; version=1.4,
org.osgi.service.packageadmin; version=1.2,
org.osgi.service.startlevel; version=1.1,
@@ -50,7 +51,6 @@
<property name="autoStart">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}/deploy/osgi/org.osgi.compendium.jar</value>
- <value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-common.jar</value>
<value>${jboss.server.home.url}/deploy/osgi/jboss-osgi-logging.jar</value>
</list>
</property>
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -28,7 +28,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
Modified: projects/jboss-osgi/trunk/runtime/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -12,7 +12,6 @@
</parent>
<modules>
- <module>spi</module>
<module>deployer</module>
<module>testing</module>
<module>equinox</module>
Modified: projects/jboss-osgi/trunk/runtime/testing/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/testing/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -20,21 +20,20 @@
<dependencies>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
<version>${version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
</dependency>
+
+ <!-- Provided Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
@@ -45,10 +44,6 @@
<artifactId>org.osgi.compendium</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
</dependencies>
<build>
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -27,9 +27,9 @@
import javax.management.MBeanServerConnection;
-import org.jboss.osgi.common.log.LogEntryCache;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.framework.RemoteFramework;
+import org.jboss.osgi.spi.service.log.LogEntryCache;
/**
* An integration test case
Modified: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -36,8 +36,6 @@
import javax.naming.NamingException;
import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.osgi.common.log.LogEntryCache;
-import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.framework.RemoteBundle;
@@ -47,6 +45,8 @@
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.service.log.LogEntryCache;
+import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
Copied: projects/jboss-osgi/trunk/spi (from rev 87400, projects/jboss-osgi/trunk/runtime/spi)
Property changes on: projects/jboss-osgi/trunk/spi
___________________________________________________________________
Name: svn:ignore
+ target
Name: svn:mergeinfo
+
Deleted: projects/jboss-osgi/trunk/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/spi/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <name>JBossOSGi - Runtime SPI</name>
- <description>JBossOSGi - Runtime SPI</description>
-
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
- <packaging>jar</packaging>
-
- <!-- Parent -->
- <parent>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime</artifactId>
- <version>1.0.0.Beta1</version>
- </parent>
-
- <!-- Dependencies -->
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <quiet>true</quiet>
- <excludePackageNames>*.internal</excludePackageNames>
- </configuration>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
Copied: projects/jboss-osgi/trunk/spi/pom.xml (from rev 87404, projects/jboss-osgi/trunk/runtime/spi/pom.xml)
===================================================================
--- projects/jboss-osgi/trunk/spi/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/spi/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - SPI</name>
+ <description>JBossOSGi - SPI</description>
+
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi</artifactId>
+ <version>1.0.0.Beta1</version>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <excludePackageNames>*.internal</excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryCache.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogEntryCache.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryCache.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryCache.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,171 @@
+/*
+ * 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.service.log;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.service.log.internal.LogEntryImpl;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogListener;
+
+/**
+ * A LogListener that caches LogEntry objects for later retrieval.
+ *
+ * The entries can be filtered with a list of {@link LogEntryFilter} instances.
+ * A log entry is cached if it matches at least one of the registered filters.
+ * If there is no filter registered entries are cached unconditionally.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryCache implements LogListener
+{
+ private List<LogEntry> entries = new ArrayList<LogEntry>();
+ private List<LogEntryFilter> filters = new ArrayList<LogEntryFilter>();
+
+ /**
+ * Create a LogEntryCache with a single associated filter
+ */
+ public LogEntryCache(LogEntryFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ /**
+ * Create a LogEntryCache with no associated filters
+ */
+ public LogEntryCache()
+ {
+ }
+
+ /**
+ * Add a LogEntryFilter
+ */
+ public void addFilter(LogEntryFilter filter)
+ {
+ filters.add(filter);
+ }
+
+ /**
+ * Clear the list of cached entries.
+ */
+ public void clear()
+ {
+ synchronized (entries)
+ {
+ entries.clear();
+ }
+ }
+
+ /**
+ * Clear the list of registered filters.
+ */
+ public void clearFilters()
+ {
+ // filters.clear() would need synchronization
+ filters = new ArrayList<LogEntryFilter>();
+ }
+
+ /**
+ * Get the list of cached entries.
+ *
+ * Note, that the LogService delivers LogEntries asynchronously.
+ * Client should not rely on a certain LogEntry already beein delivered
+ * when calling this method.
+ */
+ public List<LogEntry> getLog()
+ {
+ return getLog(false);
+ }
+
+ /**
+ * Get the list of cached entries and optionally clears the list.
+ *
+ * Note, that the LogService delivers LogEntries asynchronously.
+ * Client should not rely on a certain LogEntry already beein delivered
+ * when calling this method.
+ */
+ public List<LogEntry> getLog(boolean clear)
+ {
+ synchronized (entries)
+ {
+ ArrayList<LogEntry> retList = new ArrayList<LogEntry>(entries);
+ if (clear == true)
+ entries.clear();
+
+ return retList;
+ }
+ }
+
+ /**
+ * Listener method called for each LogEntry object created.
+ */
+ public void logged(LogEntry entry)
+ {
+ // Replace entry with a unified wrapper
+ entry = new LogEntryImpl(entry);
+
+ List<LogEntryFilter> snapshot = new ArrayList<LogEntryFilter>(filters);
+ synchronized (entries)
+ {
+ if (snapshot.size() == 0)
+ {
+ entries.add(entry);
+ return;
+ }
+
+ // Add the entry if if matches at least one filter
+ for (LogEntryFilter filter : snapshot)
+ {
+ if (match(filter, entry))
+ {
+ entries.add(entry);
+ break;
+ }
+ }
+ }
+ }
+
+ private boolean match(LogEntryFilter filter, LogEntry entry)
+ {
+ boolean match = entry.getLevel() <= filter.getLevel();
+
+ if (match && filter.getBundleRegex() != null)
+ {
+ String entryBnd = entry.getBundle().getSymbolicName();
+ String filterRegex = filter.getBundleRegex();
+ match = entryBnd.matches(filterRegex);
+ }
+
+ if (match && filter.getMessageRegex() != null)
+ {
+ String entryMsg = entry.getMessage();
+ String filterRegex = filter.getMessageRegex();
+ match = entryMsg.matches(filterRegex);
+ }
+
+ return match;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryFilter.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogEntryFilter.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryFilter.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogEntryFilter.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -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.osgi.spi.service.log;
+
+//$Id$
+
+
+/**
+ * A LogEntry filter that can be used with the LogEntryCache
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryFilter
+{
+ private int level;
+ private String bndRegex;
+ private String msgRegex;
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ * @param level The maximum log level accepted by this filter
+ * @param msgRegex A regex that matches the log message
+ */
+ public LogEntryFilter(String bndRegex, int level, String msgRegex)
+ {
+ this.bndRegex = bndRegex;
+ this.msgRegex = msgRegex;
+ this.level = level < 1 ? Integer.MAX_VALUE : level;
+ }
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ * @param level The maximum log level accepted by this filter
+ */
+ public LogEntryFilter(String bndRegex, int level)
+ {
+ this(bndRegex, level, null);
+ }
+
+ /**
+ * Create a LogEntryFilter with the associated criteria.
+ *
+ * @param bndRegex A regex that matches a Bundle's SymbolicName
+ */
+ public LogEntryFilter(String bndRegex)
+ {
+ this(bndRegex, Integer.MAX_VALUE, null);
+ }
+
+ /**
+ * Get the Bundle Symbolic-Name regex.
+ */
+ public String getBundleRegex()
+ {
+ return bndRegex;
+ }
+
+ /**
+ * Get the log message regex.
+ */
+ public String getMessageRegex()
+ {
+ return msgRegex;
+ }
+
+ /**
+ * Get the log entry maximum log level.
+ */
+ public int getLevel()
+ {
+ return level;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogServiceTracker.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/LogServiceTracker.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogServiceTracker.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/LogServiceTracker.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,81 @@
+/*
+ * 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.service.log;
+
+//$Id$
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * A basic LogService that writes to System.out
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class LogServiceTracker extends ServiceTracker implements LogService
+{
+ private LogService log;
+
+ public LogServiceTracker(BundleContext context)
+ {
+ super(context, LogService.class.getName(), null);
+ log = new SystemLogService(context);
+ open();
+ }
+
+ @Override
+ public Object addingService(ServiceReference reference)
+ {
+ log = (LogService)super.addingService(reference);
+ return log;
+ }
+
+ @Override
+ public void removedService(ServiceReference reference, Object service)
+ {
+ super.removedService(reference, service);
+ log = new SystemLogService(context);
+ }
+
+ public void log(int level, String message)
+ {
+ log.log(level, message);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ log.log(level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ log.log(sr, level, message);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ log.log(sr, level, message, exception);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/RemoteLogReaderService.java (from rev 87400, projects/jboss-osgi/trunk/bundle/remotelog/src/main/java/org/jboss/osgi/service/remotelog/RemoteLogReaderService.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/RemoteLogReaderService.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/RemoteLogReaderService.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,36 @@
+/*
+ * 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.service.log;
+
+//$Id$
+
+import org.osgi.service.log.LogReaderService;
+
+/**
+ * [TODO]
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Apr-2009
+ */
+public interface RemoteLogReaderService extends LogReaderService
+{
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/StringConstants.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/StringConstants.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/StringConstants.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/StringConstants.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,113 @@
+/*
+ * 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.service.log;
+
+//$Id$
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleEvent;
+import org.osgi.service.log.LogService;
+
+/**
+ * String representation for common OSGi Constants
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public abstract class StringConstants
+{
+ /**
+ * Return the string representation of a {@link Bundle} state
+ */
+ public static String bundleState(int bundleState)
+ {
+ String retState = "[" + bundleState + "]";
+ if (Bundle.UNINSTALLED == bundleState)
+ retState = "UNINSTALLED";
+ else if (Bundle.INSTALLED == bundleState)
+ retState = "INSTALLED";
+ else if (Bundle.RESOLVED == bundleState)
+ retState = "RESOLVED";
+ else if (Bundle.STARTING == bundleState)
+ retState = "STARTING";
+ else if (Bundle.STOPPING == bundleState)
+ retState = "STOPPING";
+ else if (Bundle.ACTIVE == bundleState)
+ retState = "ACTIVE";
+ return retState;
+ }
+
+ /**
+ * Return the string representation of a {@link BundleEvent} type
+ */
+ public static String bundleEvent(int eventType)
+ {
+ String retType = "[" + eventType + "]";
+ if (BundleEvent.INSTALLED == eventType)
+ retType = "INSTALLED";
+ else if (BundleEvent.LAZY_ACTIVATION == eventType)
+ retType = "LAZY_ACTIVATION";
+ else if (BundleEvent.RESOLVED == eventType)
+ retType = "RESOLVED";
+ else if (BundleEvent.STARTING == eventType)
+ retType = "STARTING";
+ else if (BundleEvent.STARTED == eventType)
+ retType = "STARTED";
+ else if (BundleEvent.STOPPING == eventType)
+ retType = "STOPPING";
+ else if (BundleEvent.STOPPED == eventType)
+ retType = "STOPPED";
+ else if (BundleEvent.UNINSTALLED == eventType)
+ retType = "UNINSTALLED";
+ else if (BundleEvent.UNRESOLVED == eventType)
+ retType = "UNRESOLVED";
+ else if (BundleEvent.UPDATED == eventType)
+ retType = "UPDATED";
+ return retType;
+ }
+
+ /**
+ * Return the string representation of a {@link LogService} level
+ */
+ public static String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+}
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/SystemLogService.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/SystemLogService.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/SystemLogService.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/SystemLogService.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,77 @@
+/*
+ * 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.service.log;
+
+//$Id$
+
+import org.jboss.osgi.spi.service.log.internal.LogEntryImpl;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogService;
+
+/**
+ * A basic LogService that writes to System.out
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class SystemLogService implements LogService
+{
+ private BundleContext context;
+
+ public SystemLogService(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ public void log(int level, String message)
+ {
+ logInternal(null, level, message, null);
+ }
+
+ public void log(int level, String message, Throwable exception)
+ {
+ logInternal(null, level, message, exception);
+ }
+
+ public void log(ServiceReference sr, int level, String message)
+ {
+ logInternal(sr, level, message, null);
+ }
+
+ public void log(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ logInternal(sr, level, message, exception);
+ }
+
+ private void logInternal(ServiceReference sr, int level, String message, Throwable exception)
+ {
+ long time = System.currentTimeMillis();
+ Bundle bundle = context.getBundle();
+
+ System.out.println(new LogEntryImpl(time, bundle, sr, level, message, exception));
+
+ if (exception != null)
+ exception.printStackTrace(System.out);
+ }
+}
\ No newline at end of file
Copied: projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/LogEntryImpl.java (from rev 87400, projects/jboss-osgi/trunk/bundle/common/src/main/java/org/jboss/osgi/common/log/internal/LogEntryImpl.java)
===================================================================
--- projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/LogEntryImpl.java (rev 0)
+++ projects/jboss-osgi/trunk/spi/src/main/java/org/jboss/osgi/spi/service/log/internal/LogEntryImpl.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -0,0 +1,137 @@
+/*
+ * 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.service.log.internal;
+
+// $Id$
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogService;
+
+/**
+ * A unified implementation of a LogEntry.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogEntryImpl implements LogEntry
+{
+ private long time;
+ private int level;
+ private Bundle bundle;
+ private ServiceReference sref;
+ private String message;
+ private Throwable exception;
+
+ private String bndStr;
+ private String srefStr;
+
+ public LogEntryImpl(LogEntry le)
+ {
+ this(le.getTime(), le.getBundle(), le.getServiceReference(), le.getLevel(), le.getMessage(), le.getException());
+ }
+
+ public LogEntryImpl(long time, Bundle bundle, ServiceReference sref, int level, String message, Throwable exception)
+ {
+ this.time = time;
+ this.bundle = bundle;
+ this.sref = sref;
+ this.level = level;
+ this.message = message;
+ this.exception = exception;
+
+ if (bundle != null)
+ bndStr = bundle.getSymbolicName();
+
+ if (sref != null && sref.getBundle() != null)
+ srefStr = sref.getBundle().getSymbolicName();
+ }
+
+ public Bundle getBundle()
+ {
+ return bundle;
+ }
+
+ public Throwable getException()
+ {
+ return exception;
+ }
+
+ public int getLevel()
+ {
+ return level;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public ServiceReference getServiceReference()
+ {
+ return sref;
+ }
+
+ public long getTime()
+ {
+ return time;
+ }
+
+ private String logLevel(int level)
+ {
+ String logLevel;
+ switch (level)
+ {
+ case LogService.LOG_DEBUG:
+ logLevel = "DEBUG";
+ break;
+ case LogService.LOG_INFO:
+ logLevel = "INFO";
+ break;
+ case LogService.LOG_WARNING:
+ logLevel = "WARN";
+ break;
+ case LogService.LOG_ERROR:
+ logLevel = "ERROR";
+ break;
+ default:
+ logLevel = "Level=" + level;
+ }
+ return logLevel;
+ }
+
+ @Override
+ public String toString()
+ {
+ String t = new SimpleDateFormat("dd-MMM-yyyy HH:mm.ss.SSS").format(new Date(time));
+ String l = " " + logLevel(level);
+ String s = srefStr != null ? ",sref=" + srefStr : "";
+ String b = ",bnd=" + bndStr;
+ String m = ",msg=" + message;
+ String e = exception != null ? ",ex=" + exception : "";
+ return "[" + t + l + b + s + m + e + "]";
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
@@ -63,12 +63,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -16,7 +16,6 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
- <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -25,11 +25,11 @@
import java.util.List;
-import org.jboss.osgi.common.log.LogEntryCache;
-import org.jboss.osgi.common.log.LogEntryFilter;
-import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
import org.jboss.osgi.spi.framework.RemoteBundle;
import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.service.log.LogEntryCache;
+import org.jboss.osgi.spi.service.log.LogEntryFilter;
+import org.jboss.osgi.spi.service.log.RemoteLogReaderService;
import org.osgi.framework.Bundle;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogService;
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-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -26,11 +26,11 @@
import java.net.URL;
import java.util.List;
-import org.jboss.osgi.common.log.LogEntryCache;
-import org.jboss.osgi.common.log.LogEntryFilter;
import org.jboss.osgi.spi.framework.OSGiBootstrap;
import org.jboss.osgi.spi.framework.OSGiFramework;
import org.jboss.osgi.spi.junit.OSGiTest;
+import org.jboss.osgi.spi.service.log.LogEntryCache;
+import org.jboss.osgi.spi.service.log.LogEntryFilter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@@ -76,11 +76,6 @@
Bundle logServiceBundle = sysContext.installBundle(testURL.toExternalForm());
logServiceBundle.start();
- // Install and start JBossOSGi Common
- testURL = getTestArchiveURL("bundles/jboss-osgi-common.jar");
- Bundle commonBundle = sysContext.installBundle(testURL.toExternalForm());
- commonBundle.start();
-
// Install and start the test bundle
testURL = getTestArchiveURL("example/example-log.jar");
Bundle bundleA = sysContext.installBundle(testURL.toExternalForm());
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -25,7 +25,7 @@
import static org.osgi.service.log.LogService.LOG_INFO;
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <artifactId>jboss-osgi-spi</artifactId>
<version>${version}</version>
</dependency>
<dependency>
@@ -63,12 +63,6 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-logging</artifactId>
<version>${version}</version>
<scope>provided</scope>
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 10:17:13 UTC (rev 87408)
@@ -16,7 +16,6 @@
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
<include>*:org.apache.felix.log:jar</include>
- <include>*:jboss-osgi-common:jar</include>
<include>*:jboss-osgi-logging:jar</include>
<include>*:jboss-osgi-remotelog:jar</include>
</includes>
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -23,7 +23,7 @@
//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subA.PojoA;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -23,7 +23,7 @@
//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.log.LogServiceTracker;
import org.jboss.test.osgi.jbosgi37.subB.PojoB;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-16 09:06:20 UTC (rev 87407)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-16 10:17:13 UTC (rev 87408)
@@ -23,7 +23,7 @@
//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
-import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.osgi.spi.service.log.LogServiceTracker;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
16 years, 8 months
JBoss-OSGI SVN: r87406 - in projects/jboss-osgi/trunk: build/distribution/scripts and 7 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 04:53:22 -0400 (Thu, 16 Apr 2009)
New Revision: 87406
Added:
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples.xml
Modified:
projects/jboss-osgi/trunk/build/distribution/pom.xml
projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml
projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
projects/jboss-osgi/trunk/runtime/equinox/scripts/assembly-config.xml
projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-config.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/scripts/assembly-config.xml
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
Log:
Include examples in distribution
Modified: projects/jboss-osgi/trunk/build/distribution/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/build/distribution/pom.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -74,30 +74,51 @@
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-webconsole</artifactId>
+ <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <classifier>javadoc</classifier>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-webconsole</artifactId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
<classifier>sources</classifier>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <classifier>javadoc</classifier>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testsuite-example</artifactId>
+ <version>${version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-userguide</artifactId>
<version>${version}</version>
<type>jdocbook</type>
</dependency>
-
- <!-- javadoc -->
<dependency>
<groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-spi</artifactId>
- <classifier>javadoc</classifier>
+ <artifactId>jboss-osgi-webconsole</artifactId>
<version>${version}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-webconsole</artifactId>
+ <classifier>sources</classifier>
+ <version>${version}</version>
+ </dependency>
+
<!-- Equinox Dependencies -->
<dependency>
<groupId>org.jboss.osgi</groupId>
Modified: projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/build/distribution/scripts/assembly-deploy-artifacts.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,5 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>deploy-artifacts</id>
<formats>
Modified: projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/build/distribution/src/main/resources/installer/install-definition.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -111,6 +111,9 @@
<file src="@{deploy.artifacts.dir}/lib/jboss-osgi-runtime-spi-javadoc.jar" targetdir="$INSTALL_PATH/docs/apidocs" unpack="true" override="true" />
<fileset dir="@{deploy.artifacts.dir}/docs/userguide" targetdir="$INSTALL_PATH/docs/userguide" override="true"/>
+ <!-- JBossOSGi Examples -->
+ <file src="@{deploy.artifacts.dir}/lib/jboss-osgi-testsuite-example.zip" targetdir="$INSTALL_PATH" unpack="true" override="true" />
+
<!-- JBossOSGi Lib -->
<fileset dir="@{deploy.artifacts.dir}/lib" targetdir="$INSTALL_PATH/lib" override="true">
<include name="jboss-osgi-common.jar" />
Modified: projects/jboss-osgi/trunk/runtime/equinox/scripts/assembly-config.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/scripts/assembly-config.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/runtime/equinox/scripts/assembly-config.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,6 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
<id>config</id>
<formats>
<format>jar</format>
Modified: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-bundles.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,5 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>deploy-artifacts</id>
<formats>
Modified: projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-config.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-config.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/runtime/felix/scripts/assembly-config.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,6 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
<id>config</id>
<formats>
<format>jar</format>
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/scripts/assembly-config.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/scripts/assembly-config.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/scripts/assembly-config.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,6 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+
<id>config</id>
<formats>
<format>jar</format>
Modified: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -79,7 +79,7 @@
<version>${version}</version>
<scope>provided</scope>
</dependency>
-
+
<!-- Test Dependencies -->
<dependency>
<groupId>junit</groupId>
@@ -120,6 +120,19 @@
</descriptors>
</configuration>
</execution>
+ <execution>
+ <id>examples</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>scripts/assembly-examples.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
@@ -135,12 +148,33 @@
<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-example-jars.xml" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/${project.artifactId}-${project.version}.zip</file>
+ <type>zip</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
Modified: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,5 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>deploy-artifacts</id>
<formats>
Added: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -0,0 +1,19 @@
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+ <id>examples</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory></directory>
+ <outputDirectory>example</outputDirectory>
+ <includes>
+ <include>scripts/**</include>
+ <include>src/**</include>
+ <include>pom.xml</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</assembly>
\ No newline at end of file
Property changes on: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-examples.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 08:19:53 UTC (rev 87405)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 08:53:22 UTC (rev 87406)
@@ -1,5 +1,5 @@
-<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>deploy-artifacts</id>
<formats>
16 years, 8 months
JBoss-OSGI SVN: r87405 - projects/jboss-osgi/trunk/build/hudson/hudson-home.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 04:19:53 -0400 (Thu, 16 Apr 2009)
New Revision: 87405
Modified:
projects/jboss-osgi/trunk/build/hudson/hudson-home/config.xml
Log:
Fix Hudson link to SPI JavaDoc
Modified: projects/jboss-osgi/trunk/build/hudson/hudson-home/config.xml
===================================================================
--- projects/jboss-osgi/trunk/build/hudson/hudson-home/config.xml 2009-04-16 08:04:26 UTC (rev 87404)
+++ projects/jboss-osgi/trunk/build/hudson/hudson-home/config.xml 2009-04-16 08:19:53 UTC (rev 87405)
@@ -8,7 +8,7 @@
<table>
<tr align="left"><th>Bind Addr</th><td>@jboss.bind.address@</td></tr>
-<tr align="left"><th>JavaDoc</th><td><a href='job/Container-JDK1.6/javadoc/'>SPI</a></td></tr>
+<tr align="left"><th>JavaDoc</th><td><a href='job/jbossosgi-jdk16/javadoc/'>SPI</a></td></tr>
<tr align="left"><th>Userguide</th><td>
<a href='job/jbossosgi-jdk16/ws/jboss-osgi/build/distribution/target/auto-install-dest/docs/userguide/pdf/JBossOSGi - Userguide.pdf'>PDF</a>
<a href='job/jbossosgi-jdk16/ws/jboss-osgi/build/distribution/target/auto-install-dest/docs/userguide/html/index.html'>HTML</a>
16 years, 8 months
JBoss-OSGI SVN: r87404 - in projects/jboss-osgi/trunk: runtime and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 04:04:26 -0400 (Thu, 16 Apr 2009)
New Revision: 87404
Added:
projects/jboss-osgi/trunk/testsuite/.project
Removed:
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/service/
projects/jboss-osgi/trunk/runtime/spi/src/main/java/org/jboss/osgi/spi/junit/
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/runtime/equinox/pom.xml
projects/jboss-osgi/trunk/runtime/felix/pom.xml
projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
projects/jboss-osgi/trunk/runtime/pom.xml
projects/jboss-osgi/trunk/runtime/spi/pom.xml
projects/jboss-osgi/trunk/testsuite/example/
projects/jboss-osgi/trunk/testsuite/example/.classpath
projects/jboss-osgi/trunk/testsuite/functional/
projects/jboss-osgi/trunk/testsuite/functional/.classpath
Log:
Extract OSGi junit test support in separate module
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -293,11 +293,17 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <redirectTestOutputToFile>false</redirectTestOutputToFile>
+ <failIfNoTests>false</failIfNoTests>
<systemProperties>
<property>
<name>test.archive.directory</name>
<value>${project.build.directory}/test-libs</value>
</property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${basedir}/target</value>
+ </property>
</systemProperties>
</configuration>
</plugin>
@@ -312,19 +318,6 @@
<downloadSources>true</downloadSources>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <redirectTestOutputToFile>false</redirectTestOutputToFile>
- <failIfNoTests>false</failIfNoTests>
- <systemProperties>
- <property>
- <name>log4j.output.dir</name>
- <value>${basedir}/target</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
</plugins>
</pluginManagement>
</build>
Modified: projects/jboss-osgi/trunk/runtime/equinox/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/runtime/equinox/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -32,6 +32,11 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/runtime/felix/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/runtime/felix/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -27,6 +27,11 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/runtime/knopflerfish/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -32,6 +32,11 @@
<version>${version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
<groupId>org.knopflerfish</groupId>
<artifactId>org.knopflerfish.framework</artifactId>
</dependency>
Modified: projects/jboss-osgi/trunk/runtime/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/runtime/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -14,6 +14,7 @@
<modules>
<module>spi</module>
<module>deployer</module>
+ <module>testing</module>
<module>equinox</module>
<module>felix</module>
<module>knopflerfish</module>
Modified: projects/jboss-osgi/trunk/runtime/spi/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/runtime/spi/pom.xml 2009-04-16 08:04:26 UTC (rev 87404)
@@ -19,18 +19,6 @@
<!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>provided</scope>
@@ -52,10 +40,6 @@
<groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
</dependencies>
<build>
Added: projects/jboss-osgi/trunk/testsuite/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/.project (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/.project 2009-04-16 08:04:26 UTC (rev 87404)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-testsuite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: projects/jboss-osgi/trunk/testsuite/example
___________________________________________________________________
Name: svn:ignore
- target
+ target
felix-cache
Modified: projects/jboss-osgi/trunk/testsuite/example/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.classpath 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/testsuite/example/.classpath 2009-04-16 08:04:26 UTC (rev 87404)
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Property changes on: projects/jboss-osgi/trunk/testsuite/functional
___________________________________________________________________
Name: svn:ignore
- felix-cache
+ felix-cache
target
Modified: projects/jboss-osgi/trunk/testsuite/functional/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.classpath 2009-04-16 08:04:11 UTC (rev 87403)
+++ projects/jboss-osgi/trunk/testsuite/functional/.classpath 2009-04-16 08:04:26 UTC (rev 87404)
@@ -2,7 +2,6 @@
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
16 years, 8 months
JBoss-OSGI SVN: r87401 - in projects/jboss-osgi/trunk: runtime/testing and 78 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-04-16 03:48:05 -0400 (Thu, 16 Apr 2009)
New Revision: 87401
Added:
projects/jboss-osgi/trunk/runtime/testing/
projects/jboss-osgi/trunk/runtime/testing/.classpath
projects/jboss-osgi/trunk/runtime/testing/.project
projects/jboss-osgi/trunk/runtime/testing/.settings/
projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/runtime/testing/pom.xml
projects/jboss-osgi/trunk/runtime/testing/src/
projects/jboss-osgi/trunk/runtime/testing/src/main/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/service/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/framework/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/internal/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/management/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/service/
projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/service/microcontainer/
projects/jboss-osgi/trunk/runtime/testing/src/test/
projects/jboss-osgi/trunk/runtime/testing/src/test/java/
projects/jboss-osgi/trunk/runtime/testing/src/test/resources/
projects/jboss-osgi/trunk/testsuite/example/
projects/jboss-osgi/trunk/testsuite/example/.classpath
projects/jboss-osgi/trunk/testsuite/example/.project
projects/jboss-osgi/trunk/testsuite/example/.settings/
projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/testsuite/example/pom.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/
projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/example/src/
projects/jboss-osgi/trunk/testsuite/example/src/test/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.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/log/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy
projects/jboss-osgi/trunk/testsuite/functional/
projects/jboss-osgi/trunk/testsuite/functional/.classpath
projects/jboss-osgi/trunk/testsuite/functional/.project
projects/jboss-osgi/trunk/testsuite/functional/.settings/
projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs
projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs
projects/jboss-osgi/trunk/testsuite/functional/pom.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
projects/jboss-osgi/trunk/testsuite/functional/src/
projects/jboss-osgi/trunk/testsuite/functional/src/test/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
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
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/
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/FooMBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy
Removed:
projects/jboss-osgi/trunk/testsuite/.classpath
projects/jboss-osgi/trunk/testsuite/.project
projects/jboss-osgi/trunk/testsuite/.settings/
projects/jboss-osgi/trunk/testsuite/scripts/
projects/jboss-osgi/trunk/testsuite/src/
Modified:
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Split testsuite in 'example' & 'functional'
Property changes on: projects/jboss-osgi/trunk/runtime/testing
___________________________________________________________________
Name: svn:ignore
+ target
Added: projects/jboss-osgi/trunk/runtime/testing/.classpath
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.classpath (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.classpath 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/trunk/runtime/testing/.project
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.project (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.project 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-runtime-spi</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.settings/org.eclipse.jdt.core.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,12 @@
+#Tue Feb 17 14:10:42 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/.settings/org.maven.ide.eclipse.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#Tue Feb 17 14:09:34 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: projects/jboss-osgi/trunk/runtime/testing/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/pom.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - Runtime Testing</name>
+ <description>JBossOSGi - Runtime Testing</description>
+
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime</artifactId>
+ <version>1.0.0.Beta1</version>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-spi</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <excludePackageNames>*.internal</excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Property changes on: projects/jboss-osgi/trunk/runtime/testing/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.junit;
+
+import java.net.URL;
+
+/**
+ * An archive deployer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public interface ArchiveDeployer
+{
+ /** Deploy the given archive
+ */
+ void deploy(URL archive) throws Exception;
+
+ /** Undeploy the given archive
+ */
+ void undeploy(URL archive) throws Exception;
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/ArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,66 @@
+/*
+ * 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.junit;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VFS;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 26-Feb-2009
+ */
+public class EmbeddedArchiveDeployer implements ArchiveDeployer
+{
+ private DeployerClient deployer;
+ private Map<String, VFSDeployment> deployments = new HashMap<String, VFSDeployment>();
+
+ public EmbeddedArchiveDeployer(DeployerClient deployer)
+ {
+ if (deployer == null)
+ throw new IllegalArgumentException("Cannot construct archive deployer with: " + deployer);
+
+ this.deployer = deployer;
+ }
+
+ public void deploy(URL url) throws Exception
+ {
+ VFSDeploymentFactory factory = VFSDeploymentFactory.getInstance();
+ VFSDeployment deployment = factory.createVFSDeployment(VFS.getRoot(url));
+ deployer.deploy(deployment);
+ deployments.put(url.toExternalForm(), deployment);
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ VFSDeployment deployment = deployments.remove(url.toExternalForm());
+ if (deployment != null)
+ deployer.undeploy(deployment);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/EmbeddedArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,117 @@
+/*
+ * 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.junit;
+
+// $Id$
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.framework.RemoteFramework;
+
+/**
+ * An integration test case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class IntegrationTest extends OSGiTest
+{
+ private IntegrationTestHelper delegate;
+
+ private IntegrationTestHelper getDelegate()
+ {
+ if (delegate == null)
+ {
+ delegate = new IntegrationTestHelper(getBootstrapProvider());
+ }
+ return delegate;
+ }
+
+ protected void startRemoteLogging(LogEntryCache entryCache) throws Exception
+ {
+ getDelegate().startRemoteLogging(entryCache);
+ }
+
+ protected void stopRemoteLogging() throws Exception
+ {
+ getDelegate().stopRemoteLogging();
+ }
+
+ protected boolean isRemoteIntegration()
+ {
+ return IntegrationTestHelper.isRemoteIntegration();
+ }
+
+ protected boolean isTargetJBoss50()
+ {
+ return getDelegate().isTargetJBoss50();
+ }
+
+ protected RemoteBundle deployBundle(String archive) throws Exception
+ {
+ return getDelegate().deployBundle(archive);
+ }
+
+ protected void undeployBundle(String archive) throws Exception
+ {
+ getDelegate().undeployBundle(archive);
+ }
+
+ protected void deploy(String archive) throws Exception
+ {
+ getDelegate().deploy(archive);
+ }
+
+ protected void deploy(URL archive) throws Exception
+ {
+ getDelegate().deploy(archive);
+ }
+
+ protected void undeploy(String archive) throws Exception
+ {
+ getDelegate().undeploy(archive);
+ }
+
+ protected void undeploy(URL archive) throws Exception
+ {
+ getDelegate().undeploy(archive);
+ }
+
+ protected RemoteFramework getRemoteFramework() throws Exception
+ {
+ return getDelegate().getRemoteFramework();
+ }
+
+ protected MBeanServerConnection getServer()
+ {
+ return getDelegate().getServer();
+ }
+
+ protected String getServerHost()
+ {
+ return getDelegate().getServerHost();
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,261 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+import java.util.jar.Attributes;
+import java.util.jar.JarInputStream;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.framework.RemoteFramework;
+import org.jboss.osgi.spi.framework.RemoteFrameworkException;
+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.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * An integration test helper that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class IntegrationTestHelper extends OSGiTestHelper
+{
+ private static MBeanServerConnection server;
+ private ManagedFrameworkMBean managedFramework;
+ private String integrationTarget;
+
+ public IntegrationTestHelper(OSGiBootstrapProvider bootProvider)
+ {
+ setBootstrapProvider(bootProvider);
+ }
+
+ protected void startRemoteLogging(final LogEntryCache logEntryCache) throws Exception
+ {
+ // Bootstrap the Framework and get the system bundle
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ // Track the RemoteLogReaderService to add the LogEntryCache as LogListener
+ ServiceTracker tracker = new ServiceTracker(sysContext, RemoteLogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService service = (LogReaderService)super.addingService(sref);
+ service.addLogListener(logEntryCache);
+ return service;
+ }
+ };
+ tracker.open();
+
+ // Install the RemoteLogReaderService in the local OSGiFramework.
+ // The 'org.jboss.osgi.service.remote.log.reader' property must be set to 'true'
+ installBundle(sysContext, "bundles/jboss-osgi-remotelog.jar", true);
+
+ // Deploy the RemoteLogListener to the remote OSGiFramework.
+ // The 'org.jboss.osgi.service.remote.log.sender' property must be set to 'true'
+ deployBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+
+ protected void stopRemoteLogging() throws Exception
+ {
+ // Undeploy the RemoteLogListener from the remote OSGiFramework.
+ undeployBundle("bundles/jboss-osgi-remotelog.jar");
+ }
+
+ public void deploy(String archive) throws Exception
+ {
+ URL url = getTestArchiveFile(archive).toURI().toURL();
+ deploy(url);
+ }
+
+ public void deploy(URL archive) throws Exception
+ {
+ getDeployer().deploy(archive);
+ }
+
+ public void undeploy(String archive) throws Exception
+ {
+ URL url = getTestArchiveFile(archive).toURI().toURL();
+ undeploy(url);
+ }
+
+ public void undeploy(URL archive) throws Exception
+ {
+ getDeployer().undeploy(archive);
+ }
+
+ public boolean isTargetJBoss50()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss50");
+ }
+
+ private String getIntegrationTarget()
+ {
+ if (integrationTarget == null)
+ {
+ String jbossVersion;
+ try
+ {
+ ObjectName oname = new ObjectName("jboss.system:type=ServerConfig");
+ jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot obtain jboss version", ex);
+ }
+
+ if (jbossVersion.startsWith("5.0"))
+ integrationTarget = "jboss50";
+ else
+ throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
+ }
+ return integrationTarget;
+ }
+
+ @SuppressWarnings("unchecked")
+ public MBeanServerConnection getServer()
+ {
+ if (server == null)
+ {
+ Hashtable jndiEnv = null;
+ try
+ {
+ InitialContext iniCtx = new InitialContext();
+ jndiEnv = iniCtx.getEnvironment();
+ server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+ }
+ }
+ return server;
+ }
+
+ private ArchiveDeployer getDeployer()
+ {
+ if (isRemoteIntegration())
+ {
+ return new RemoteArchiveDeployer(getServer());
+ }
+ else
+ {
+ DeployerClient deployer = (DeployerClient)getBootstrapProvider().getInstance("MainDeployer");
+ return new EmbeddedArchiveDeployer(deployer);
+ }
+ }
+
+ public RemoteBundle deployBundle(String archive) throws Exception
+ {
+ File archiveFile = getTestArchiveFile(archive);
+ JarInputStream jarInputStream = new JarInputStream(new FileInputStream(archiveFile));
+ Attributes attribs = jarInputStream.getManifest().getMainAttributes();
+ String symbolicName = attribs.getValue(Constants.BUNDLE_SYMBOLICNAME);
+ jarInputStream.close();
+
+ if (symbolicName == null)
+ throw new IllegalArgumentException("Cannot obtain Bundle-SymbolicName for: " + archive);
+
+ deploy(archive);
+
+ return getRemoteFramework().getBundle(symbolicName);
+ }
+
+ public void undeployBundle(String archive) throws Exception
+ {
+ undeploy(archive);
+ }
+
+ public RemoteFramework getRemoteFramework() throws Exception
+ {
+ if (managedFramework == null)
+ managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.OBJECT_NAME, getServer());
+
+ return new RemoteFramework()
+ {
+ public RemoteBundle getBundle(String symbolicName)
+ {
+ ObjectName bundleOName = managedFramework.getBundle(symbolicName);
+ try
+ {
+ return MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+
+ public Set<RemoteBundle> getBundles()
+ {
+ Set<RemoteBundle> remBundles = new HashSet<RemoteBundle>();
+ for (ObjectName bundleOName : managedFramework.getBundles())
+ {
+ try
+ {
+ RemoteBundle remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getServer());
+ remBundles.add(remBundle);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+ return remBundles;
+ }
+ };
+ }
+
+ public static boolean isRemoteIntegration()
+ {
+ return System.getProperty("jboss.bind.address") != null;
+ }
+
+ public String getServerHost()
+ {
+ return System.getProperty("jboss.bind.address", "localhost");
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,162 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+
+/**
+ * A test setup that deploys/undeploys archives
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class IntegrationTestSetup extends OSGiTestSetup
+{
+ private IntegrationTestHelper delegate;
+ private String[] archives = new String[0];
+ private ClassLoader originalClassLoader;
+
+ public IntegrationTestSetup(Class<?> testClass, String archiveList)
+ {
+ super(testClass);
+ getArchiveArray(archiveList);
+ }
+
+ private IntegrationTestHelper getDelegate()
+ {
+ if (delegate == null)
+ {
+ delegate = new IntegrationTestHelper(getBootstrapProvider());
+ }
+ return delegate;
+ }
+
+ public File getArchiveFile(String archive)
+ {
+ return getDelegate().getTestArchiveFile(archive);
+ }
+
+ public URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return getDelegate().getTestArchiveFile(archive).toURI().toURL();
+ }
+
+ public boolean isRemoteIntegration()
+ {
+ return IntegrationTestHelper.isRemoteIntegration();
+ }
+
+ public boolean isTargetJBoss50()
+ {
+ return getDelegate().isTargetJBoss50();
+ }
+
+ public MBeanServerConnection getServer()
+ {
+ return getDelegate().getServer();
+ }
+
+ public String getServerHost()
+ {
+ return getDelegate().getServerHost();
+ }
+
+ private void getArchiveArray(String archiveList)
+ {
+ if (archiveList != null)
+ {
+ StringTokenizer st = new StringTokenizer(archiveList, ", ");
+ archives = new String[st.countTokens()];
+
+ for (int i = 0; i < archives.length; i++)
+ archives[i] = st.nextToken();
+ }
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ List<URL> clientJars = new ArrayList<URL>();
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[i];
+ try
+ {
+ getDelegate().deploy(archive);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ getDelegate().undeploy(archive);
+ }
+
+ if (archive.endsWith("-client.jar"))
+ {
+ URL archiveURL = getArchiveURL(archive);
+ clientJars.add(archiveURL);
+ }
+ }
+
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ originalClassLoader = parent;
+
+ // add client jars to the class loader
+ if (!clientJars.isEmpty())
+ {
+ URL[] urls = new URL[clientJars.size()];
+ for (int i = 0; i < clientJars.size(); i++)
+ {
+ urls[i] = clientJars.get(i);
+ }
+ URLClassLoader cl = new URLClassLoader(urls, parent);
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ try
+ {
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[archives.length - i - 1];
+ getDelegate().undeploy(archive);
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+ }
+ super.tearDown();
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/IntegrationTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,121 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.virtual.VFS;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Test Case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public abstract class OSGiTest extends TestCase
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(OSGiTest.class);
+
+ private OSGiTestHelper delegate = new OSGiTestHelper();
+
+ public OSGiTest()
+ {
+ // Prevent unknown protocol: vfsfile
+ VFS.init();
+ }
+
+ protected OSGiBootstrapProvider createBootstrapProvider()
+ {
+ return delegate.createBootstrapProvider();
+ }
+
+ protected OSGiBootstrapProvider getBootstrapProvider()
+ {
+ return delegate.getBootstrapProvider();
+ }
+
+ protected void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+ {
+ delegate.setBootstrapProvider(bootProvider);
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.debug("### START " + getLongName());
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ log.debug("### END " + getLongName());
+ }
+
+ protected String getShortName()
+ {
+ String shortName = getClass().getName();
+ shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
+ return shortName;
+ }
+
+ protected String getLongName()
+ {
+ return getClass().getName() + "." + getName();
+ }
+
+ protected URL getResourceURL(String resource)
+ {
+ return delegate.getResourceURL(resource);
+ }
+
+ protected File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ protected File getTestArchiveFile(String archive)
+ {
+ return delegate.getTestArchiveFile(archive);
+ }
+
+ protected URL getTestArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getTestArchiveFile(archive).toURI().toURL();
+ }
+
+ protected Bundle installBundle(BundleContext sysContext, String bundlePath, boolean start) throws BundleException
+ {
+ return delegate.installBundle(sysContext, bundlePath, start);
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,152 @@
+/*
+ * 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.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * An OSGi Test Helper
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiTestHelper
+{
+ private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+
+ private OSGiBootstrapProvider bootProvider;
+
+ private static String testResourcesDir;
+ private static String testArchiveDir;
+
+ public OSGiBootstrapProvider createBootstrapProvider()
+ {
+ return OSGiBootstrap.getBootstrapProvider();
+ }
+
+ public OSGiBootstrapProvider getBootstrapProvider()
+ {
+ if (bootProvider == null)
+ {
+ bootProvider = createBootstrapProvider();
+ }
+ return bootProvider;
+ }
+
+ public void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+ {
+ this.bootProvider = bootProvider;
+ }
+
+ /** Try to discover the URL for the test resource */
+ public URL getResourceURL(String resource)
+ {
+ URL resURL = null;
+ try
+ {
+ File resourceFile = getResourceFile(resource);
+ resURL = resourceFile.toURI().toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ return resURL;
+ }
+
+ /** Try to discover the File for the test resource */
+ public File getResourceFile(String resource)
+ {
+ File file = new File(resource);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestResourcesDir() + "/" + resource);
+ if (file.exists())
+ return file;
+
+ throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
+ }
+
+ public String getTestResourcesDir()
+ {
+ if (testResourcesDir == null)
+ testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
+
+ return testResourcesDir;
+ }
+
+ /** Try to discover the URL for the deployment archive */
+ public URL getTestArchiveURL(String archive)
+ {
+ try
+ {
+ return getTestArchiveFile(archive).toURI().toURL();
+ }
+ catch (MalformedURLException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public File getTestArchiveFile(String archive)
+ {
+ File file = new File(archive);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestArchiveDir() + "/" + archive);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
+ throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
+ }
+
+ public String getTestArchiveDir()
+ {
+ if (testArchiveDir == null)
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
+
+ return testArchiveDir;
+ }
+
+ public Bundle installBundle(BundleContext sysContext, String bundlePath, boolean start) throws BundleException
+ {
+ Bundle bundle = sysContext.installBundle(getTestArchiveURL(bundlePath).toExternalForm());
+
+ if (start == true)
+ bundle.start();
+
+ return bundle;
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.spi.junit;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.logging.Logger;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.virtual.VFS;
+
+import junit.extensions.TestSetup;
+import junit.framework.TestSuite;
+
+/**
+ * An OSGi Test Setup
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class OSGiTestSetup extends TestSetup
+{
+ // Provide logging
+ final Logger log = Logger.getLogger(OSGiTestSetup.class);
+
+ private OSGiTestHelper delegate = new OSGiTestHelper();
+ private OSGiBootstrapProvider bootProvider;
+
+ public OSGiTestSetup(Class<?> testCase)
+ {
+ super(new TestSuite(testCase));
+ // Prevent unknown protocol: vfsfile
+ VFS.init();
+ }
+
+ public OSGiBootstrapProvider createBootstrapProvider()
+ {
+ return OSGiBootstrap.getBootstrapProvider();
+ }
+
+ public OSGiBootstrapProvider getBootstrapProvider()
+ {
+ if (bootProvider == null)
+ {
+ bootProvider = createBootstrapProvider();
+ }
+ return bootProvider;
+ }
+
+ public void setBootstrapProvider(OSGiBootstrapProvider bootProvider)
+ {
+ this.bootProvider = bootProvider;
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.debug("### START SETUP " + getTest());
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ log.debug("### END SETUP " + getTest());
+ }
+
+ protected URL getResourceURL(String resource)
+ {
+ return delegate.getResourceURL(resource);
+ }
+
+ protected File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ public File getTestArchiveFile(String archive)
+ {
+ return delegate.getTestArchiveFile(archive);
+ }
+
+ public URL getTestArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getTestArchiveFile(archive).toURI().toURL();
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/OSGiTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,63 @@
+/*
+ * 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.junit;
+
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+/**
+ * An archive deployer that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class RemoteArchiveDeployer implements ArchiveDeployer
+{
+ private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+ private MBeanServerConnection server;
+
+ public RemoteArchiveDeployer(MBeanServerConnection server)
+ {
+ if (server == null)
+ throw new IllegalArgumentException("Cannot construct archive deployer with: " + server);
+
+ this.server = server;
+ }
+
+ public void deploy(URL url) throws Exception
+ {
+ invokeMainDeployer("deploy", url);
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ invokeMainDeployer("undeploy", url);
+ }
+
+ private void invokeMainDeployer(String methodName, URL url) throws Exception
+ {
+ server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url }, new String[] { "java.net.URL" });
+ }
+}
Property changes on: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/RemoteArchiveDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/junit/package.html 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+<html>
+<body>
+JUnit test integration.
+</body>
+</html>
Added: projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html
===================================================================
--- projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html (rev 0)
+++ projects/jboss-osgi/trunk/runtime/testing/src/main/java/org/jboss/osgi/spi/package.html 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+<html>
+<body>
+Common classes and interfaces.
+</body>
+</html>
Deleted: projects/jboss-osgi/trunk/testsuite/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/.classpath 2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/.classpath 2009-04-16 07:48:05 UTC (rev 87401)
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: projects/jboss-osgi/trunk/testsuite/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/.project 2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/.project 2009-04-16 07:48:05 UTC (rev 87401)
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>jboss-osgi-testsuite</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
Property changes on: projects/jboss-osgi/trunk/testsuite/example
___________________________________________________________________
Name: svn:ignore
+ target
Added: projects/jboss-osgi/trunk/testsuite/example/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.classpath (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.classpath 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/trunk/testsuite/example/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.project (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.project 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-testsuite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.eclipse.jdt.core.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+#Wed Feb 04 11:13:20 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/.settings/org.maven.ide.eclipse.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#Tue Feb 17 14:09:40 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: projects/jboss-osgi/trunk/testsuite/example/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/pom.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - Testsuite Examples</name>
+ <description>JBossOSGi - Testsuite Examples</description>
+
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testsuite-example</artifactId>
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testsuite</artifactId>
+ <version>1.0.0.Beta1</version>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
+ </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-runtime-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.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </dependency>
+
+ <!-- Provided Dependencies -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <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-example-jars.xml"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+
+ <!--
+ Name: framework-default
+ Descr: Setup for default framework integration testing
+ -->
+ <profile>
+ <id>framework-default</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!--
+ Name: framework-felix
+ Descr: Setup for Felix framework integration testing
+ -->
+ <profile>
+ <id>framework-felix</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>felix</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-equinox</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-equinox</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-knopflerfish
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-knopflerfish</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>knopflerfish</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: embedded-tesing
+ Descr: Setup for embedded integration testing
+ -->
+ <profile>
+ <id>embedded-tesing</id>
+ <activation>
+ <property>
+ <name>!jboss.bind.address</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- Exclude tests that require remote access -->
+ <exclude>org/jboss/test/osgi/deployer/**</exclude>
+ <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: remote-tesing
+ Descr: Setup for remote integration testing
+ -->
+ <profile>
+ <id>remote-tesing</id>
+ <activation>
+ <property>
+ <name>jboss.bind.address</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- argLine>${surefire.security.args}</argLine -->
+ <excludes>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/antrun-example-jars.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ============================================================ -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- ============================================================ -->
+
+<!-- $Id: antrun-example-jars.xml 87329 2009-04-15 10:34:21Z thomas.diesler(a)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/log -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-log.jar" files="${tests.resources.dir}/example/log/example-log.bnd" />
+
+ <!-- example/http -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-http.jar" files="${tests.resources.dir}/example/http/example-http.bnd" />
+
+ <!-- example/microcontainer -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/example/example-microcontainer.jar" files="${tests.resources.dir}/example/microcontainer/example-microcontainer.bnd" />
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Added: projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/scripts/assembly-bundles.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+ <id>deploy-artifacts</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <!-- Dependency Sets -->
+ <dependencySets>
+
+ <!-- bundle -->
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-logging:jar</include>
+ <include>*:jboss-osgi-remotelog:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+
+ </dependencySets>
+</assembly>
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/HttpServiceRemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.http;
+
+//$Id: HttpServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+
+/**
+ * A test that deployes a bundle that containes a HttpServlet which
+ * is registered through the OSGi HttpService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class HttpServiceRemoteTestCase extends IntegrationTest
+{
+ public static Test suite()
+ {
+ return new IntegrationTestSetup(HttpServiceRemoteTestCase.class, "example/example-http.jar");
+ }
+
+ public void testServletAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=plain");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Servlet", br.readLine());
+ }
+
+ public void testServletInitProps() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=initProp");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("initProp=SomeValue", br.readLine());
+ }
+
+ public void testServletBundleContext() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=context");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("example-http", br.readLine());
+ }
+
+ public void testServletStartLevel() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/servlet?test=startLevel");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("startLevel=1", br.readLine());
+ }
+
+ public void testResourceAccess() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8090/file/message.txt");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("Hello from Resource", br.readLine());
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointService.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.http.bundle;
+
+//$Id: EndpointService.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.http.HttpService;
+
+/**
+ * A service that creates an Http context through the HttpService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class EndpointService implements ServiceListener
+{
+ private BundleContext context;
+
+ public EndpointService(BundleContext context)
+ {
+ this.context = context;
+ context.addServiceListener(this);
+ }
+
+ private void registerService()
+ {
+ try
+ {
+ HttpService httpService = getHttpService();
+
+ Properties initParams = new Properties();
+ initParams.setProperty("initProp", "SomeValue");
+ httpService.registerServlet("/servlet", new EndpointServlet(context), initParams, null);
+ httpService.registerResources("/file", "/res", null);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Cannot register context", ex);
+ }
+ }
+
+ private void unregisterService()
+ {
+ HttpService httpService = getHttpService();
+ httpService.unregister("/servlet");
+ httpService.unregister("/file");
+ context.removeServiceListener(this);
+ }
+
+ private HttpService getHttpService()
+ {
+ ServiceReference sref = context.getServiceReference(HttpService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("HttpService not registered");
+
+ return (HttpService)context.getService(sref);
+ }
+
+ public void serviceChanged(ServiceEvent event)
+ {
+ Object service = context.getService(event.getServiceReference());
+ if (service == this)
+ {
+ if (event.getType() == ServiceEvent.REGISTERED)
+ {
+ registerService();
+ }
+ else if (event.getType() == ServiceEvent.UNREGISTERING)
+ {
+ unregisterService();
+ }
+ }
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/EndpointServlet.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.http.bundle;
+
+//$Id: EndpointServlet.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.service.startlevel.StartLevel;
+import org.osgi.util.tracker.ServiceTracker;
+
+@SuppressWarnings("serial")
+public class EndpointServlet extends HttpServlet
+{
+ private BundleContext context;
+
+ // This hides the default ctor and verifies that this instance is used
+ public EndpointServlet(BundleContext context)
+ {
+ this.context = context;
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ PrintWriter out = res.getWriter();
+
+ String testParam = req.getParameter("test");
+ if ("plain".equals(testParam))
+ {
+ out.println("Hello from Servlet");
+ }
+ else if ("initProp".equals(testParam))
+ {
+ String value = getInitParameter(testParam);
+ out.println(testParam + "=" + value);
+ }
+ else if ("context".equals(testParam))
+ {
+ out.println(context.getBundle().getSymbolicName());
+ }
+ else if ("startLevel".equals(testParam))
+ {
+ ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
+ tracker.open();
+
+ StartLevel service = (StartLevel)tracker.getService();
+ out.println("startLevel=" + service.getStartLevel());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Invalid 'test' parameter: " + testParam);
+ }
+
+ out.close();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/http/bundle/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.http.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ /*
+ * Implements BundleActivator.start().
+ * Registers an instance of a HttpEndpoint Service using the bundle context.
+ */
+ public void start(BundleContext context)
+ {
+ EndpointService service = new EndpointService(context);
+ registration = context.registerService(EndpointService.class.getName(), service, null);
+ }
+
+ /*
+ * Implements BundleActivator.stop().
+ */
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceRemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,79 @@
+/*
+ * 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.log;
+
+//$Id: LogServiceRemoteTestCase.java 87339 2009-04-15 12:23:20Z thomas.diesler(a)jboss.com $
+
+import java.util.List;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.common.log.LogEntryFilter;
+import org.jboss.osgi.service.remotelog.RemoteLogReaderService;
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogService;
+
+/**
+ * This example demonstrates the usage of the {@link RemoteLogReaderService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogServiceRemoteTestCase extends IntegrationTest
+{
+ private LogEntryCache logEntryCache;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ logEntryCache = new LogEntryCache(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+ startRemoteLogging(logEntryCache);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ stopRemoteLogging();
+ super.tearDown();
+ }
+
+ public void testServiceA() throws Exception
+ {
+ // Deploy the test bundle
+ RemoteBundle bundleA = deployBundle("example/example-log.jar");
+
+ // Verify that the bundle is active
+ assertEquals("Remote bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+
+ // Undeploy the test bundle
+ undeployBundle("example/example-log.jar");
+
+ // Verify the received log entries
+ List<LogEntry> entries = logEntryCache.getLog();
+ assertEquals("Number of entries", 1, entries.size());
+ assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
+ }
+}
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/LogServiceTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,103 @@
+/*
+ * 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.log;
+
+//$Id: LogServiceTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
+
+import java.net.URL;
+import java.util.List;
+
+import org.jboss.osgi.common.log.LogEntryCache;
+import org.jboss.osgi.common.log.LogEntryFilter;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.log.LogEntry;
+import org.osgi.service.log.LogReaderService;
+import org.osgi.service.log.LogService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * This example demonstrates the usage of the {@link LogService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class LogServiceTestCase extends OSGiTest
+{
+ public void testLogEntryFilter() throws Exception
+ {
+ // Bootstrap the Framework and get the system bundle
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ // Setup the LogEntryCache
+ final LogEntryCache logEntryCache = new LogEntryCache();
+ logEntryCache.addFilter(new LogEntryFilter("example-log(.*)", LogService.LOG_INFO, "\\[ServiceA\\](.*)"));
+
+ // Track the LogReaderService to add the LogEntryCache as LogListener
+ ServiceTracker tracker = new ServiceTracker(sysContext, LogReaderService.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ LogReaderService service = (LogReaderService)super.addingService(sref);
+ service.addLogListener(logEntryCache);
+ return service;
+ }
+ };
+ tracker.open();
+
+ // Install and start the 3rd party LogService.
+ // This will register the LogReaderService that we track above.
+ URL testURL = getTestArchiveURL("bundles/org.apache.felix.log.jar");
+ Bundle logServiceBundle = sysContext.installBundle(testURL.toExternalForm());
+ logServiceBundle.start();
+
+ // Install and start JBossOSGi Common
+ testURL = getTestArchiveURL("bundles/jboss-osgi-common.jar");
+ Bundle commonBundle = sysContext.installBundle(testURL.toExternalForm());
+ commonBundle.start();
+
+ // Install and start the test bundle
+ testURL = getTestArchiveURL("example/example-log.jar");
+ Bundle bundleA = sysContext.installBundle(testURL.toExternalForm());
+ bundleA.start();
+
+ // Verify that the bundle is active
+ assertEquals("Test bundle ACTIVE", Bundle.ACTIVE, bundleA.getState());
+
+ // Uninstall the test bundle
+ bundleA.uninstall();
+
+ // Uninstall the 3rd party LogService
+ logServiceBundle.uninstall();
+
+ // Verify the received log entries
+ List<LogEntry> entries = logEntryCache.getLog();
+ assertEquals("Number of entries", 1, entries.size());
+ assertEquals("[ServiceA] new Service", entries.get(0).getMessage());
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceA.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,47 @@
+/*
+ * 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.log.bundle;
+
+//$Id: ServiceA.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import static org.osgi.service.log.LogService.LOG_INFO;
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * A service that logs some messages to the LogService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Apr-2009
+ */
+public class ServiceA
+{
+ private LogService log;
+
+ public ServiceA(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+ log.log(LOG_INFO, "[ServiceA] new Service");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/log/bundle/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,42 @@
+/*
+ * 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.log.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class ServiceActivator implements BundleActivator
+{
+ public void start(final BundleContext context)
+ {
+ ServiceA service = new ServiceA(context);
+ context.registerService(ServiceA.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ // Do Nothing. It is unnecessary to unregister services or Framework listeners
+ // because they must be clean up by the Framework anyway.
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MBeanServiceRemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.example.microcontainer;
+
+//$Id: MBeanServiceRemoteTestCase.java 87330 2009-04-15 10:57:57Z thomas.diesler(a)jboss.com $
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.test.osgi.example.microcontainer.bundle.FooMBean;
+import org.jboss.test.osgi.example.microcontainer.bundle.MBeanTestService;
+
+/**
+ * A test that deployes a bundle that registeres an MBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Feb-2009
+ */
+public class MBeanServiceRemoteTestCase extends IntegrationTest
+{
+ public static Test suite()
+ {
+ return new IntegrationTestSetup(MBeanServiceRemoteTestCase.class, "example/example-microcontainer.jar");
+ }
+
+ public void testMBeanAccess() throws Exception
+ {
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, MBeanTestService.OBJECT_NAME, getServer());
+ assertEquals("hello", foo.echo("hello"));
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/Foo.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,34 @@
+/*
+ * 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.bundle;
+
+
+
+//$Id: Foo.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+public class Foo implements FooMBean
+{
+ public String echo(String msg)
+ {
+ return msg;
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/FooMBean.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+/*
+ * 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.bundle;
+
+//$Id: FooMBean.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+public interface FooMBean
+{
+ String echo(String msg);
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/MBeanTestService.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,107 @@
+/*
+ * 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.bundle;
+
+//$Id: MBeanTestService.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+import org.jboss.osgi.spi.service.microcontainer.MicrocontainerService;
+import org.jboss.test.osgi.example.microcontainer.bundle.Foo;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * A service that registers an MBean
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 23-Jan-2009
+ */
+public class MBeanTestService implements ServiceListener
+{
+ public static ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.osgi:service=mbean-test-service");
+
+ private BundleContext context;
+ private MBeanServer mbeanServer;
+
+ public MBeanTestService(BundleContext context)
+ {
+ this.context = context;
+ context.addServiceListener(this);
+ }
+
+ private void registerService()
+ {
+ try
+ {
+ MicrocontainerService mcService = getMicrocontainerService();
+ mbeanServer = mcService.getMbeanServer();
+ mbeanServer.registerMBean(new Foo(), OBJECT_NAME);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Cannot register mbean", ex);
+ }
+ }
+
+ private void unregisterService()
+ {
+ try
+ {
+ if (mbeanServer != null && mbeanServer.isRegistered(OBJECT_NAME))
+ mbeanServer.unregisterMBean(OBJECT_NAME);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Cannot unregister mbean", ex);
+ }
+ }
+
+ private MicrocontainerService getMicrocontainerService()
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ if (sref == null)
+ throw new IllegalStateException("MicrocontainerService not registered");
+
+ return (MicrocontainerService)context.getService(sref);
+ }
+
+ public void serviceChanged(ServiceEvent event)
+ {
+ Object service = context.getService(event.getServiceReference());
+ if (service == this)
+ {
+ if (event.getType() == ServiceEvent.REGISTERED)
+ {
+ registerService();
+ }
+ else if (event.getType() == ServiceEvent.UNREGISTERING)
+ {
+ unregisterService();
+ }
+ }
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/bundle/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * 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.bundle;
+
+//$Id: ServiceActivator.java 87329 2009-04-15 10:34:21Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ MBeanTestService service = new MBeanTestService(context);
+ registration = context.registerService(MBeanTestService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/example-http.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-http.jar src/test/resources/example/http/example-http.bnd
+
+Bundle-SymbolicName: example-http
+Bundle-Activator: org.jboss.test.osgi.example.http.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.http.bundle
+Include-Resource: res/message.txt=message.txt
+
+# For some reason this does not work
+# Include-Resource: src/test/resources/service/http/message.txt
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/http/message.txt 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1 @@
+Hello from Resource
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/log/example-log.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example-log.jar src/test/resources/example/log/example-log.bnd
+
+Bundle-SymbolicName: example-log
+
+Bundle-Activator: org.jboss.test.osgi.example.log.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.log.bundle
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/example/microcontainer/example-microcontainer.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/example/example-microcontainer.jar src/test/resources/example/microcontainer/example-microcontainer.bnd
+
+Bundle-SymbolicName: example-microcontainer
+Bundle-Activator: org.jboss.test.osgi.example.microcontainer.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.example.microcontainer.bundle
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jboss-osgi-bootstrap-beans.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,111 @@
+<!--
+ The bootstrap of the server. This should only have the minimum
+ needed to bootstrap the mc kernel and profile service.
+
+ $Id: jboss-osgi-bootstrap-beans.xml 86378 2009-03-26 12:02:32Z thomas.diesler(a)jboss.com $
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+ </bean>
+
+ <!-- The ManagedDeploymentCreator implementation -->
+ <bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
+
+ <!-- ModificationType structure processor -->
+ <bean name="ModificationTypeStructureProcessor" class="org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor">
+ <incallback method="addMatcher"/>
+ <uncallback method="removeMatcher"/>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder">
+ <property name="structureProcessor"><inject bean="ModificationTypeStructureProcessor"/></property>
+ </bean>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- A declared structure descriptor deployer -->
+ <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+ <!-- JAR Structure -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+ <property name="candidateStructureVisitorFactory">
+ <!-- Any file that is not an ordinary directory is a candidate -->
+ <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+ <!-- A filter to exclude some obvious non-subdeployments -->
+ <property name="filter">
+ <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+ <constructor><parameter>
+ <list elementClass="java.lang.String">
+ <!-- Exclude class files as subdeployments -->
+ <value>.class</value>
+ </list>
+ </parameter></constructor>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+ <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+ <constructor>
+ <parameter>
+ <set elementClass="java.lang.String">
+ <value>-service.xml</value>
+ <value>-beans.xml</value>
+ </set>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer"/>
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor><parameter class="org.jboss.kernel.Kernel"><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+ </bean>
+
+ <!-- VFS ClassLoader -->
+ <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+ <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+ </bean>
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured"/>
+ <uncallback method="removeModule" state="Configured"/>
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ <property name="system"><inject bean="ClassLoaderSystem"/></property>
+ </bean>
+
+</deployment>
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/jndi.properties 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/log4j.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.hibernate">
+ <priority value="INFO" />
+ </category>
+
+ <!-- hide optimistic locking failures
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="FATAL" />
+ </category>
+ -->
+
+ <!-- hide proxy narrowing warns -->
+ <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+ <priority value="ERROR" />
+ </category>
+
+ <!-- show SQL DML statements as they are executed -->
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- show JDBC parameters
+ <category name="org.hibernate.type">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- hide httpclient wire dumps -->
+ <category name="httpclient.wire.header">
+ <priority value="INFO" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/tst.policy 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,4 @@
+grant {
+ permission java.security.AllPermission;
+};
+
Property changes on: projects/jboss-osgi/trunk/testsuite/functional
___________________________________________________________________
Name: svn:ignore
+ felix-cache
Name: svn:mergeinfo
+
Added: projects/jboss-osgi/trunk/testsuite/functional/.classpath
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.classpath (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.classpath 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-osgi-runtime-spi"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: projects/jboss-osgi/trunk/testsuite/functional/.project
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.project (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.project 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-osgi-testsuite</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.settings/org.eclipse.jdt.core.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+#Wed Feb 04 11:13:20 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/.settings/org.maven.ide.eclipse.prefs 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,9 @@
+#Tue Feb 17 14:09:40 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: projects/jboss-osgi/trunk/testsuite/functional/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/pom.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/pom.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,337 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>JBossOSGi - Testsuite Functional</name>
+ <description>JBossOSGi - Testsuite Functional</description>
+
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testsuite-functional</artifactId>
+ <packaging>jar</packaging>
+
+ <parent>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-testsuite</artifactId>
+ <version>1.0.0.Beta1</version>
+ </parent>
+
+ <!-- Properties -->
+ <properties>
+ <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
+ </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-runtime-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.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-testing</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-aop-mc-int</artifactId>
+ </dependency>
+
+ <!-- Provided Dependencies -->
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.log</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-common</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-logging</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-remotelog</artifactId>
+ <version>${version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <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>
+
+ <!--
+ Name: framework-default
+ Descr: Setup for default framework integration testing
+ -->
+ <profile>
+ <id>framework-default</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!--
+ Name: framework-felix
+ Descr: Setup for Felix framework integration testing
+ -->
+ <profile>
+ <id>framework-felix</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>felix</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+
+ <!--
+ Name: framework-equinox
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-equinox</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>equinox</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-equinox</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-equinox</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: framework-knopflerfish
+ Descr: Setup for Equinox framework integration testing
+ -->
+ <profile>
+ <id>framework-knopflerfish</id>
+ <activation>
+ <property>
+ <name>!framework</name>
+ <value>knopflerfish</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
+ <version>${version}</version>
+ <classifier>config</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: embedded-tesing
+ Descr: Setup for embedded integration testing
+ -->
+ <profile>
+ <id>embedded-tesing</id>
+ <activation>
+ <property>
+ <name>!jboss.bind.address</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- Exclude tests that require remote access -->
+ <exclude>org/jboss/test/osgi/deployer/**</exclude>
+ <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!--
+ Name: remote-tesing
+ Descr: Setup for remote integration testing
+ -->
+ <profile>
+ <id>remote-tesing</id>
+ <activation>
+ <property>
+ <name>jboss.bind.address</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-client</artifactId>
+ <scope>test</scope>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <!-- argLine>${surefire.security.args}</argLine -->
+ <excludes>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,88 @@
+<?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-test-jars.xml 87336 2009-04-15 11:31:26Z thomas.diesler(a)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/example" />
+ <mkdir dir="${tests.output.dir}/test-libs/service" />
+
+ <property name="tests.classes.dir" value="${tests.output.dir}/test-classes" />
+ <property name="tests.resources.dir" value="${tests.output.dir}/test-classes" />
+
+ <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 -->
+
+ <!-- jbosgi36 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi36-bundle.jar" files="${tests.resources.dir}/deployer/jbosgi36/jbosgi36.bnd" />
+ <jar jarfile="${tests.output.dir}/test-libs/jbosgi36-mbean.jar">
+ <fileset dir="${tests.classes.dir}">
+ <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.class" />
+ <include name="org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.class" />
+ </fileset>
+ <fileset dir="${tests.resources.dir}/deployer/jbosgi36">
+ <include name="META-INF/jbosgi36-jboss-beans.xml" />
+ </fileset>
+ </jar>
+
+ <!-- jbosgi37 -->
+ <jar jarfile="${tests.output.dir}/test-libs/jbosgi37-subB.jar">
+ <fileset dir="${tests.classes.dir}">
+ <include name="org/jboss/test/osgi/jbosgi37/subB/PojoB.class" />
+ </fileset>
+ </jar>
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-subA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-subA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleA.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi37-bundleB.jar" files="${tests.resources.dir}/jbosgi37/jbosgi37-bundleB.bnd" />
+
+ <!-- jbosgi38 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleA.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleA.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleB.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleB.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi38-bundleX.jar" files="${tests.resources.dir}/jbosgi38/jbosgi38-bundleX.bnd" />
+
+ <!-- jbosgi39 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleB.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleB.bnd" />
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi39-bundleX.jar" files="${tests.resources.dir}/jbosgi39/jbosgi39-bundleX.bnd" />
+
+ <!-- jbosgi41 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi41-bundleA.jar" files="${tests.resources.dir}/jbosgi41/jbosgi41-bundleA.bnd" />
+
+ <!-- startlevel-service -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/service/service-startlevel.jar" files="${tests.resources.dir}/service/startlevel/service-startlevel.bnd" />
+
+ <!-- Please add alphabetically -->
+
+ </target>
+
+</project>
Added: projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/assembly-bundles.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,29 @@
+<assembly xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.1.0-SNAPSHOT.xsd">
+
+ <id>deploy-artifacts</id>
+ <formats>
+ <format>dir</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <!-- Dependency Sets -->
+ <dependencySets>
+
+ <!-- bundle -->
+ <dependencySet>
+ <outputDirectory>bundles</outputDirectory>
+ <outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+ <includes>
+ <include>*:org.apache.felix.log:jar</include>
+ <include>*:jboss-osgi-common:jar</include>
+ <include>*:jboss-osgi-logging:jar</include>
+ <include>*:jboss-osgi-remotelog:jar</include>
+ </includes>
+ <useStrictFiltering>true</useStrictFiltering>
+ <scope>provided</scope>
+ <unpack>false</unpack>
+ </dependencySet>
+
+ </dependencySets>
+</assembly>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/BootstrapTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,92 @@
+/*
+ * 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: BootstrapTestCase.java 86588 2009-04-01 13:39:25Z thomas.diesler(a)jboss.com $
+
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiBootstrapProvider;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test the embedded bootstrap of the framework
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Feb-2009
+ */
+public class BootstrapTestCase extends OSGiTest
+{
+ public void testFrameworkBootstrap() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ OSGiFramework framework = bootProvider.getFramework();
+ assertNotNull("Framework not null", framework);
+
+ Bundle bundle = framework.getSystemBundle();
+
+ assertEquals("BundleId == 0", 0, bundle.getBundleId());
+ assertNotNull("SymbolicName not null", bundle.getSymbolicName());
+
+ MainDeployer mainDeployer = bootProvider.getInstance("MainDeployer", MainDeployer.class);
+ assertNotNull("MainDeployer not null", mainDeployer);
+ }
+
+ public void testGetBootstrapProvider() throws Exception
+ {
+ OSGiBootstrapProvider bp1 = OSGiBootstrap.getBootstrapProvider();
+ OSGiBootstrapProvider bp2 = OSGiBootstrap.getBootstrapProvider();
+ assertNotSame("Multiple provider instances", bp1, bp2);
+ }
+
+ public void testConfigureFromResource() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ bootProvider.configure("bootstrap/mock-bootstrap-beans.xml");
+
+ SomeBean bean = bootProvider.getInstance("SomeBean", SomeBean.class);
+ assertNotNull("Bean not null", bean);
+
+ OSGiFramework framework = bootProvider.getFramework();
+ assertNull("Framework null", framework);
+
+ bootProvider.configure("bootstrap/mock-osgi-beans.xml");
+ assertNotNull("Framework not null", bootProvider.getFramework());
+ }
+
+ public void testConfigureFromURL() throws Exception
+ {
+ OSGiBootstrapProvider bootProvider = OSGiBootstrap.getBootstrapProvider();
+ bootProvider.configure(getResourceURL("bootstrap/mock-bootstrap-beans.xml"));
+
+ SomeBean bean = bootProvider.getInstance("SomeBean", SomeBean.class);
+ assertNotNull("Bean not null", bean);
+
+ OSGiFramework framework = bootProvider.getFramework();
+ assertNull("Framework null", framework);
+
+ bootProvider.configure(getResourceURL("bootstrap/mock-osgi-beans.xml"));
+ assertNotNull("Framework not null", bootProvider.getFramework());
+ }
+}
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/MockFramework.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,47 @@
+/*
+ * 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(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A mock framework
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Feb-2009
+ */
+public class MockFramework implements OSGiFramework
+{
+ public Bundle getSystemBundle()
+ {
+ return null;
+ }
+
+ public BundleContext getSystemBundleContext()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/bootstrap/SomeBean.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,35 @@
+/*
+ * 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(a)jboss.com $
+
+
+/**
+ * Some pojo
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Feb-2009
+ */
+public class SomeBean
+{
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/OSGI36TestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,88 @@
+/*
+ * 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.deployer.jbosgi36;
+
+//$Id: OSGI36TestCase.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+import junit.framework.Test;
+
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.jboss.osgi.spi.junit.IntegrationTestSetup;
+import org.jboss.osgi.spi.management.MBeanProxy;
+import org.jboss.osgi.spi.management.MBeanProxyException;
+import org.jboss.test.osgi.deployer.jbosgi36.mbean.FooMBean;
+
+/**
+ * [JBOSGI-36] Bundle classes leak into system classloader
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-36
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Feb-2009
+ */
+public class OSGI36TestCase extends IntegrationTest
+{
+ static IntegrationTestSetup setup;
+
+ public static Test suite()
+ {
+ setup = new IntegrationTestSetup(OSGI36TestCase.class, "jbosgi36-bundle.jar, jbosgi36-mbean.jar");
+ return setup;
+ }
+
+ public void testAccessMBean() throws Exception
+ {
+ assertEquals("hello", getFooMBean().echo("hello"));
+ }
+
+ public void testAccessSomeService() throws Exception
+ {
+ try
+ {
+ String loaderName = getFooMBean().accessSomeService();
+ fail("Unexpected classloader: " + loaderName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ // expected
+ }
+ }
+
+ public void testAccessSomeInternal() throws Exception
+ {
+ try
+ {
+ String loaderName = getFooMBean().accessSomeInternal();
+ fail("Unexpected classloader: " + loaderName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ // expected
+ }
+ }
+
+ private FooMBean getFooMBean() throws MBeanProxyException
+ {
+ FooMBean foo = (FooMBean)MBeanProxy.get(FooMBean.class, FooMBean.OBJECT_NAME, getServer());
+ return foo;
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeService.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,34 @@
+/*
+ * 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.deployer.jbosgi36.bundle;
+
+import org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal;
+
+//$Id: SomeService.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+public class SomeService
+{
+ public String doStuff()
+ {
+ return SomeInternal.class.getName();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/SomeServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * 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.deployer.jbosgi36.bundle;
+
+//$Id: SomeServiceActivator.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Feb-2009
+ */
+public class SomeServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ SomeService service = new SomeService();
+ registration = context.registerService(SomeService.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/bundle/internal/SomeInternal.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,28 @@
+/*
+ * 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.deployer.jbosgi36.bundle.internal;
+
+//$Id: SomeInternal.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+public class SomeInternal
+{
+}
Added: 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 (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/Foo.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,49 @@
+/*
+ * 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.deployer.jbosgi36.mbean;
+
+//$Id: Foo.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+import org.jboss.aop.microcontainer.aspects.jmx.JMX;
+
+@JMX (exposedInterface = FooMBean.class, name = "jboss.osgi:test=jbosgi36", registerDirectly = true)
+public class Foo implements FooMBean
+{
+ public String echo(String msg)
+ {
+ return msg;
+ }
+
+ public String accessSomeService() throws ClassNotFoundException
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeService");
+ return loader.toString();
+ }
+
+ public String accessSomeInternal() throws ClassNotFoundException
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ loader.loadClass("org.jboss.test.osgi.deployer.jbosgi36.bundle.internal.SomeInternal");
+ return loader.toString();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/deployer/jbosgi36/mbean/FooMBean.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,39 @@
+/*
+ * 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.deployer.jbosgi36.mbean;
+
+// $Id: FooMBean.java 86968 2009-04-08 15:51:12Z thomas.diesler(a)jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jboss.osgi.spi.management.ObjectNameFactory;
+
+public interface FooMBean
+{
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.osgi:test=jbosgi36");
+
+ String echo(String msg);
+
+ String accessSomeService() throws ClassNotFoundException;
+
+ String accessSomeInternal() throws ClassNotFoundException;
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/OSGI37TestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,72 @@
+/*
+ * 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.jbosgi37;
+
+//$Id: OSGI37TestCase.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * [JBOSGI-37] Prevent creation of deployment unit for nested jars
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-37
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 09-Apr-2009
+ */
+public class OSGI37TestCase extends OSGiTest
+{
+ private BundleContext sysContext;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ sysContext = framework.getSystemBundleContext();
+ }
+
+ public void testNestedBundle() throws Exception
+ {
+ Bundle bundleA = installBundle(sysContext, "jbosgi37-bundleA.jar", true);
+
+ assertEquals("Bundle started", Bundle.ACTIVE, bundleA.getState());
+
+ List<String> relevant = new ArrayList<String>();
+ for (Bundle bundle : sysContext.getBundles())
+ {
+ String symbolicName = bundle.getSymbolicName();
+ if (symbolicName.startsWith("jbosgi37"))
+ relevant.add(symbolicName);
+ }
+
+ assertEquals("No Sub Bundle", 1, relevant.size());
+ assertEquals("jbosgi37-bundleA", relevant.get(0));
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceA.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,45 @@
+/*
+ * 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.jbosgi37.bundleA;
+
+//$Id: ServiceA.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.jbosgi37.subA.PojoA;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * ServiceA has a dependecy on PojoA
+ */
+public class ServiceA
+{
+ private LogService log;
+
+ ServiceA(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+
+ PojoA pojo = new PojoA(context.getBundle().getSymbolicName());
+ log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleA/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbosgi37.bundleA;
+
+//$Id: ServiceActivator.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ ServiceA service = new ServiceA(context);
+ registration = context.registerService(ServiceA.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbosgi37.bundleB;
+
+//$Id: ServiceActivator.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ ServiceB service = new ServiceB(context);
+ registration = context.registerService(ServiceB.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/bundleB/ServiceB.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,45 @@
+/*
+ * 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.jbosgi37.bundleB;
+
+//$Id: ServiceB.java 87351 2009-04-15 14:25:32Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.jboss.test.osgi.jbosgi37.subB.PojoB;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+
+/**
+ * ServiceB has a dependecy on PojoB
+ */
+public class ServiceB
+{
+ private LogService log;
+
+ ServiceB(BundleContext context)
+ {
+ log = new LogServiceTracker(context);
+
+ PojoB pojo = new PojoB(context.getBundle().getSymbolicName());
+ log.log(LogService.LOG_INFO, "Bundle-SymbolicName: " + pojo);
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subA/PojoA.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi37.subA;
+
+
+//$Id: PojoA.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+public class PojoA
+{
+ private String message;
+
+ public PojoA(String message)
+ {
+ this.message = message;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + message + "]";
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi37/subB/PojoB.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi37.subB;
+
+
+//$Id: PojoB.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+public class PojoB
+{
+ private String message;
+
+ public PojoB(String message)
+ {
+ this.message = message;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + message + "]";
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38RemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,131 @@
+/*
+ * 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.jbosgi38;
+
+//$Id: OSGI38RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-38
+ *
+ * Bundle A depends on bundle B, both share bundle X.
+ *
+ * A ---> B
+ * A ---> X <--- B
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 02-Mar-2009
+ */
+public class OSGI38RemoteTestCase extends IntegrationTest
+{
+ /*
+ * Install/Start the common bundle
+ */
+ public void testInstallStartX() throws Exception
+ {
+ RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+
+ undeployBundle("jbosgi38-bundleX.jar");
+ }
+
+ /*
+ * Install X, B
+ */
+ public void testInstallXBeforeB() throws Exception
+ {
+ RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+ RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ undeployBundle("jbosgi38-bundleB.jar");
+ undeployBundle("jbosgi38-bundleX.jar");
+ }
+
+ /*
+ * Install X, B, A
+ */
+ public void testInstallBBeforeA() throws Exception
+ {
+ RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+ RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+ RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ undeployBundle("jbosgi38-bundleA.jar");
+ undeployBundle("jbosgi38-bundleB.jar");
+ undeployBundle("jbosgi38-bundleX.jar");
+ }
+
+ /*
+ * Install B, X
+ */
+ public void testInstallBBeforeX() throws Exception
+ {
+ RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ undeployBundle("jbosgi38-bundleB.jar");
+ undeployBundle("jbosgi38-bundleX.jar");
+ }
+
+ /*
+ * Install A, B, X
+ */
+ public void testInstallABeforeB() throws Exception
+ {
+ RemoteBundle bundleA = deployBundle("jbosgi38-bundleA.jar");
+
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+
+ RemoteBundle bundleB = deployBundle("jbosgi38-bundleB.jar");
+
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ RemoteBundle bundleX = deployBundle("jbosgi38-bundleX.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ undeployBundle("jbosgi38-bundleA.jar");
+ undeployBundle("jbosgi38-bundleB.jar");
+ undeployBundle("jbosgi38-bundleX.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,228 @@
+/*
+ * 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.jbosgi38;
+
+//$Id: OSGI38TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiBootstrap;
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+
+/**
+ * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-38
+ *
+ * Bundle A depends on bundle B, both share bundle X.
+ *
+ * A ---> B
+ * A ---> X <--- B
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 02-Mar-2009
+ */
+public class OSGI38TestCase extends OSGiTest
+{
+ /*
+ * Install/Start the common bundle
+ */
+ public void testInstallStartX() throws Exception
+ {
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleX = null;
+ try
+ {
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+ bundleX.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ }
+ finally
+ {
+ uninstall(bundleX);
+ }
+ }
+
+ /*
+ * Install X, B
+ */
+ public void testInstallXBeforeB() throws Exception
+ {
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleB = null;
+ Bundle bundleX = null;
+ try
+ {
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ bundleB.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+ }
+ finally
+ {
+ uninstall(bundleB);
+ uninstall(bundleX);
+ }
+ }
+
+ /*
+ * Install X, B, A
+ */
+ public void testInstallBBeforeA() throws Exception
+ {
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleA = null;
+ Bundle bundleB = null;
+ Bundle bundleX = null;
+ try
+ {
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ bundleA = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleA.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+
+ bundleA.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+ }
+ finally
+ {
+ uninstall(bundleA);
+ uninstall(bundleB);
+ uninstall(bundleX);
+ }
+ }
+
+ /*
+ * Install B, X
+ */
+ public void testInstallBBeforeX() throws Exception
+ {
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleB = null;
+ Bundle bundleX = null;
+ try
+ {
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ try
+ {
+ bundleB.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+ bundleB.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+ }
+ finally
+ {
+ uninstall(bundleX);
+ uninstall(bundleB);
+ }
+ }
+
+ /*
+ * Install A, B, X
+ */
+ public void testInstallABeforeB() throws Exception
+ {
+ OSGiFramework framework = OSGiBootstrap.getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleA = null;
+ Bundle bundleB = null;
+ Bundle bundleX = null;
+ try
+ {
+ bundleA = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleA.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleA.getState());
+
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleB.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ try
+ {
+ bundleB.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi38-bundleX.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleX.getState());
+
+ bundleB.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleA.start();
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+ }
+ finally
+ {
+ uninstall(bundleA);
+ uninstall(bundleB);
+ uninstall(bundleX);
+ }
+ }
+
+ private void uninstall(Bundle bnd)
+ {
+ try
+ {
+ if (bnd != null)
+ bnd.uninstall();
+ }
+ catch (BundleException ex)
+ {
+ System.err.println(ex.toString());
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceA.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,54 @@
+/*
+ * 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.jbosgi38.bundleA;
+
+//$Id: ServiceA.java 85293 2009-03-05 13:45:47Z thomas.diesler(a)jboss.com $
+
+import org.jboss.test.osgi.jbosgi38.bundleB.ServiceB;
+import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 02-Mar-2009
+ */
+public class ServiceA
+{
+ ServiceA(BundleContext context)
+ {
+ ServiceTracker tracker = new ServiceTracker(context, ServiceB.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ ServiceB serviceB = (ServiceB)super.addingService(sref);
+ serviceB.doStuffInB(new SomePojo("hello"));
+ return serviceB;
+ }
+ };
+ tracker.open();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleA/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbosgi38.bundleA;
+
+//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ ServiceA service = new ServiceA(context);
+ registration = context.registerService(ServiceA.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbosgi38.bundleB;
+
+//$Id: ServiceActivator.java 85100 2009-03-02 13:58:48Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ ServiceB service = new ServiceB();
+ registration = context.registerService(ServiceB.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleB/ServiceB.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,40 @@
+/*
+ * 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.jbosgi38.bundleB;
+
+//$Id: ServiceB.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
+
+import org.jboss.test.osgi.jbosgi38.bundleX.SomePojo;
+
+/**
+ * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 02-Mar-2009
+ */
+public class ServiceB
+{
+ public String doStuffInB(SomePojo obj)
+ {
+ return obj.toString();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi38/bundleX/SomePojo.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi38.bundleX;
+
+
+//$Id: SomePojo.java 85016 2009-03-02 12:12:31Z thomas.diesler(a)jboss.com $
+
+public class SomePojo
+{
+ private String message;
+
+ public SomePojo(String message)
+ {
+ this.message = message;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + message + "]";
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39RemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,104 @@
+/*
+ * 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.jbosgi39;
+
+//$Id: OSGI39RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+/**
+ * [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-39
+ *
+ * Bundle B depends on bundle X.
+ *
+ * B ---> X
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class OSGI39RemoteTestCase extends IntegrationTest
+{
+ public void testVerifyUnresolved() throws Exception
+ {
+ RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
+
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ try
+ {
+ bundleB.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+
+ RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ undeployBundle("jbosgi39-bundleB.jar");
+ undeployBundle("jbosgi39-bundleX.jar");
+ }
+
+ /*
+ * 4.3.11 Uninstalling Bundles
+ *
+ * Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
+ *
+ * - The uninstalled bundle has exported any packages (via its Export-Package manifest header)
+ * - The uninstalled bundle was selected by the Framework as the exporter of these packages.
+ *
+ * If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
+ * for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted.
+ */
+ public void testWiringToUninstalled() throws Exception
+ {
+ RemoteBundle bundleX = deployBundle("jbosgi39-bundleX.jar");
+ RemoteBundle bundleB = deployBundle("jbosgi39-bundleB.jar");
+
+ bundleB.start();
+
+ assertEquals("Bundle resolved", Bundle.ACTIVE, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ // Undeploy X before B
+ undeployBundle("jbosgi39-bundleX.jar");
+ undeployBundle("jbosgi39-bundleB.jar");
+
+ // Install B without X
+ bundleB = deployBundle("jbosgi39-bundleB.jar");
+
+ bundleB.start();
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ undeployBundle("jbosgi39-bundleB.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/OSGI39TestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,160 @@
+/*
+ * 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.jbosgi39;
+
+//$Id: OSGI39TestCase.java 87103 2009-04-09 22:18:31Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.OSGiFramework;
+import org.jboss.osgi.spi.junit.OSGiTest;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/**
+ * [JBOSGI-39] Bundle gets wired to an already uninstalled bundle
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-39
+ *
+ * Bundle B depends on bundle X.
+ *
+ * B ---> X
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class OSGI39TestCase extends OSGiTest
+{
+ public void testVerifyUnresolved() throws Exception
+ {
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+ assertEquals("Bundle installed", Bundle.INSTALLED, bundleB.getState());
+
+ try
+ {
+ bundleB.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+
+ Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+
+ bundleB.start();
+
+ assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ bundleX.uninstall();
+ }
+
+ /*
+ * 4.3.11 Uninstalling Bundles
+ *
+ * Once this method returns, the state of the OSGi Service Platform must be the same as if the bundle had never been installed, unless:
+ *
+ * - The uninstalled bundle has exported any packages (via its Export-Package manifest header)
+ * - The uninstalled bundle was selected by the Framework as the exporter of these packages.
+ *
+ * If none of the old exports are used, then the old exports must be removed. Otherwise, all old exports must remain available
+ * for existing bundles and future resolves until the refreshPackages method is called or the Framework is restarted.
+ */
+ public void testWiringToUninstalled() throws Exception
+ {
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+ Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+
+ bundleB.start();
+
+ assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ // Uninstall X before B
+ bundleX.uninstall();
+ bundleB.uninstall();
+
+ // Install B without X
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+
+ bundleB.start();
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ }
+
+ public void testWiringToUninstalledPackageAdmin() throws Exception
+ {
+ OSGiFramework framework = getBootstrapProvider().getFramework();
+ BundleContext sysContext = framework.getSystemBundleContext();
+
+ Bundle bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+ Bundle bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+
+ bundleB.start();
+
+ assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ // Uninstall X before B
+ bundleX.uninstall();
+ bundleB.uninstall();
+
+ // Forces the update (replacement) or removal of packages exported by the specified bundles.
+ ServiceReference sref = sysContext.getServiceReference(PackageAdmin.class.getName());
+ PackageAdmin packAdmin = (PackageAdmin)sysContext.getService(sref);
+ packAdmin.refreshPackages(null);
+
+ // Install B without X
+ bundleB = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleB.jar").toExternalForm());
+
+ try
+ {
+ bundleB.start();
+ fail("Unresolved constraint expected");
+ }
+ catch (BundleException ex)
+ {
+ // expected
+ }
+
+ bundleX = sysContext.installBundle(getTestArchiveURL("jbosgi39-bundleX.jar").toExternalForm());
+
+ bundleB.start();
+
+ assertEquals("Bundle resolved", Bundle.RESOLVED, bundleX.getState());
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleB.getState());
+
+ bundleB.uninstall();
+ bundleX.uninstall();
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,48 @@
+/*
+ * 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.jbosgi39.bundleB;
+
+//$Id: ServiceActivator.java 87064 2009-04-09 11:08:56Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration registration;
+
+ public void start(BundleContext context)
+ {
+ ServiceB service = new ServiceB();
+ registration = context.registerService(ServiceB.class.getName(), service, null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (registration != null)
+ {
+ registration.unregister();
+ registration = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleB/ServiceB.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,40 @@
+/*
+ * 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.jbosgi39.bundleB;
+
+//$Id: ServiceB.java 87064 2009-04-09 11:08:56Z thomas.diesler(a)jboss.com $
+
+import org.jboss.test.osgi.jbosgi39.bundleX.SomePojo;
+
+/**
+ * ServiceA has a dependency on ServiceB, both have a dependency on SomePojo
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 02-Mar-2009
+ */
+public class ServiceB
+{
+ public String doStuffInB(SomePojo obj)
+ {
+ return obj.toString();
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi39/bundleX/SomePojo.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,41 @@
+/*
+ * 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.jbosgi39.bundleX;
+
+
+//$Id: SomePojo.java 87064 2009-04-09 11:08:56Z thomas.diesler(a)jboss.com $
+
+public class SomePojo
+{
+ private String message;
+
+ public SomePojo(String message)
+ {
+ this.message = message;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "[" + message + "]";
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/OSGI41RemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,67 @@
+/*
+ * 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.jbosgi41;
+
+//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler(a)jboss.com $
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-41] Verify persistent file storage
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-41
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-Mar-2009
+ */
+public class OSGI41RemoteTestCase extends IntegrationTest
+{
+ public void testFirstRun() throws Exception
+ {
+ RemoteBundle bundleA = deployBundle("jbosgi41-bundleA.jar");
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ File dataFile = getBundleDataFile(bundleA, "config/jbosgi41.txt");
+ assertTrue("File exists: " + dataFile, dataFile.exists());
+
+ BufferedReader br = new BufferedReader(new FileReader(dataFile));
+ String symbolicName = br.readLine();
+ assertEquals("jbosgi41-bundleA", symbolicName);
+
+ undeployBundle("jbosgi41-bundleA.jar");
+ }
+
+ private File getBundleDataFile(RemoteBundle bundleA, String filename)
+ {
+ String storageRoot = bundleA.getProperty("org.osgi.framework.storage");
+ assertNotNull("Storage dir not null", storageRoot);
+
+ File dataFile = new File(storageRoot + "/bundle" + bundleA.getBundleId() + "/data/" + filename);
+ return dataFile;
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceA.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,58 @@
+/*
+ * 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.jbosgi41.bundleA;
+
+//$Id: ServiceA.java 85288 2009-03-05 10:31:17Z thomas.diesler(a)jboss.com $
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * ServiceA writes a file
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-Mar-2009
+ */
+public class ServiceA
+{
+ ServiceA(BundleContext context)
+ {
+ context.getDataFile("config").mkdirs();
+
+ File dataFile = context.getDataFile("config/jbosgi41.txt");
+ try
+ {
+ System.out.println("dataFile: " + dataFile);
+ OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(dataFile));
+ out.write(context.getBundle().getSymbolicName());
+ out.close();
+ }
+ catch (IOException ex)
+ {
+ ex.printStackTrace(System.err);
+ }
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,65 @@
+/*
+ * 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.jbosgi41.bundleA;
+
+//$Id: ServiceActivator.java 85293 2009-03-05 13:45:47Z thomas.diesler(a)jboss.com $
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class ServiceActivator implements BundleActivator
+{
+ private ServiceRegistration regA, regB;
+
+ public void start(BundleContext context)
+ {
+ ServiceA serviceA = new ServiceA(context);
+ regA = context.registerService(ServiceA.class.getName(), serviceA, null);
+
+ Dictionary<String, String> props = new Hashtable<String, String>();
+ props.put("service.pid", ServiceB.class.getName());
+
+ ServiceB serviceB = new ServiceB(context);
+ regB = context.registerService(ServiceB.class.getName(), serviceB, props);
+
+ serviceB.updateConfig("xxx", "yyy");
+ serviceB.updateConfig("xxx", "zzz");
+ }
+
+ public void stop(BundleContext context)
+ {
+ if (regA != null)
+ {
+ regA.unregister();
+ regA = null;
+ }
+ if (regB != null)
+ {
+ regB.unregister();
+ regB = null;
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,98 @@
+/*
+ * 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.jbosgi41.bundleA;
+
+//$Id: ServiceB.java 85293 2009-03-05 13:45:47Z thomas.diesler(a)jboss.com $
+
+import java.util.Arrays;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * ServiceB is a ManagedService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 05-Mar-2009
+ */
+public class ServiceB implements ManagedService
+{
+ private ConfigurationAdmin configAdmin;
+
+ ServiceB(BundleContext context)
+ {
+ System.out.println("ServiceB");
+
+ ServiceTracker tracker = new ServiceTracker(context, ConfigurationAdmin.class.getName(), null)
+ {
+ @Override
+ public Object addingService(ServiceReference sref)
+ {
+ System.out.println("addingService");
+ configAdmin = (ConfigurationAdmin)super.addingService(sref);
+ return configAdmin;
+ }
+ };
+ tracker.open();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void updateConfig(String key, String value)
+ {
+ System.out.println("updateConfig");
+ if (configAdmin != null)
+ {
+ try
+ {
+ Configuration config = configAdmin.getConfiguration(ServiceB.class.getName());
+ Dictionary props = config.getProperties();
+
+ if (props == null)
+ props = new Hashtable<String, String>();
+
+ props.put(key, value);
+
+ config.update(props);
+
+ Configuration[] configs = configAdmin.listConfigurations(null);
+ System.out.println(Arrays.asList(configs));
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Cannot access ConfigurationAdmin", ex);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void updated(Dictionary props) throws ConfigurationException
+ {
+ System.out.println("updated: " + props);
+ }
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/StartLevelRemoteTestCase.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -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.test.osgi.service.startlevel;
+
+//$Id: StartLevelRemoteTestCase.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.framework.RemoteBundle;
+import org.jboss.osgi.spi.junit.IntegrationTest;
+import org.osgi.framework.Bundle;
+
+/**
+ * Deploy a bundle that accesses the StartLevel service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Mar-2009
+ */
+public class StartLevelRemoteTestCase extends IntegrationTest
+{
+ public void testStartLevel() throws Exception
+ {
+ RemoteBundle bundle = deployBundle("service/service-startlevel.jar");
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundle.getState());
+
+ undeployBundle("service/service-startlevel.jar");
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/service/startlevel/bundle/ServiceActivator.java 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.osgi.service.startlevel.bundle;
+
+//$Id: ServiceActivator.java 87336 2009-04-15 11:31:26Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.common.log.LogServiceTracker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.log.LogService;
+import org.osgi.service.startlevel.StartLevel;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ * Try to access the StartLevel service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 04-Feb-2009
+ */
+public class ServiceActivator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ LogService log = new LogServiceTracker(context);
+
+ ServiceTracker tracker = new ServiceTracker(context, StartLevel.class.getName(), null);
+ tracker.open();
+
+ StartLevel service = (StartLevel)tracker.getService();
+ if (service == null)
+ log.log(LogService.LOG_ERROR, "Cannot get StartLevel. Loaded with: " + StartLevel.class.getClassLoader());
+
+ int level = service.getStartLevel();
+ log.log(LogService.LOG_INFO, "StartLevel: " + level);
+ }
+
+ /*
+ * Implements BundleActivator.stop().
+ */
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-bootstrap-beans.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,8 @@
+<!--
+ $Id: mock-bootstrap-beans.xml 84917 2009-03-02 08:18:40Z thomas.diesler(a)jboss.com $
+-->
+<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.bootstrap.SomeBean"/>
+
+</deployment>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/bootstrap/mock-osgi-beans.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+<!--
+ $Id: mock-osgi-beans.xml 84917 2009-03-02 08:18:40Z thomas.diesler(a)jboss.com $
+-->
+<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="jboss.osgi:service=Framework" class="org.jboss.test.osgi.bootstrap.MockFramework"/>
+
+ <bean name="jboss.osgi:service=SomeOtherFramework" class="org.jboss.test.osgi.bootstrap.MockFramework"/>
+
+</deployment>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/META-INF/jbosgi36-jboss-beans.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +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="Foo" class="org.jboss.test.osgi.deployer.jbosgi36.mbean.Foo"/>
+
+</deployment>
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/deployer/jbosgi36/jbosgi36.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,7 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi36-bundle.jar src/test/resources/jbosgi36/jbosgi36.bnd
+
+Bundle-SymbolicName: jbosgi36
+Bundle-Activator: org.jboss.test.osgi.deployer.jbosgi36.bundle.SomeServiceActivator
+Export-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle
+Private-Package: org.jboss.test.osgi.deployer.jbosgi36.bundle.internal
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleA.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-bundleA.jar src/test/resources/jbosgi37/jbosgi37-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi37-bundleA
+Bundle-Activator: org.jboss.test.osgi.jbosgi37.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi37.bundleA
+
+Include-Resource: ../../../target/test-libs/jbosgi37-subA.jar
+Bundle-ClassPath: .,jbosgi37-subA.jar
+
+-removeheaders: Include-Resource
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-bundleB.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,10 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-bundleB.jar src/test/resources/jbosgi37/jbosgi37-bundleB.bnd
+
+Bundle-SymbolicName: jbosgi37-bundleB
+Bundle-Activator: org.jboss.test.osgi.jbosgi37.bundleB.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi37.bundleB
+
+Include-Resource: ../../../target/test-libs/jbosgi37-subB.jar
+Bundle-ClassPath: .,jbosgi37-subB.jar
+
+-removeheaders: Include-Resource
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi37/jbosgi37-subA.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi37-subA.jar src/test/resources/jbosgi37/jbosgi37-subA.bnd
+
+Bundle-SymbolicName: jbosgi37-subA
+Export-Package: org.jboss.test.osgi.jbosgi37.subA
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleA.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleA.jar src/test/resources/jbosgi38/bundleA.bnd
+
+Bundle-SymbolicName: jbosgi38-bundleA
+Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi38.bundleA
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleB.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleB.jar src/test/resources/jbosgi38/bundleB.bnd
+
+Bundle-SymbolicName: jbosgi38-bundleB
+Bundle-Activator: org.jboss.test.osgi.jbosgi38.bundleB.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi38.bundleB
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi38/jbosgi38-bundleX.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi38-bundleX.jar src/test/resources/jbosgi38/bundleX.bnd
+
+Bundle-SymbolicName: jbosgi38-bundleX
+Export-Package: org.jboss.test.osgi.jbosgi38.bundleX
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleB.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi39-bundleB.jar src/test/resources/jbosgi39/bundleB.bnd
+
+Bundle-SymbolicName: jbosgi39-bundleB
+Bundle-Activator: org.jboss.test.osgi.jbosgi39.bundleB.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi39.bundleB
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi39/jbosgi39-bundleX.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi39-bundleX.jar src/test/resources/jbosgi39/bundleX.bnd
+
+Bundle-SymbolicName: jbosgi39-bundleX
+Export-Package: org.jboss.test.osgi.jbosgi39.bundleX
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi41/jbosgi41-bundleA.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi41-bundleA.jar src/test/resources/jbosgi41/jbosgi41-bundleA.bnd
+
+Bundle-SymbolicName: jbosgi41-bundleA
+Bundle-Activator: org.jboss.test.osgi.jbosgi41.bundleA.ServiceActivator
+Export-Package: org.jboss.test.osgi.jbosgi41.bundleA
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jboss-osgi-bootstrap-beans.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,111 @@
+<!--
+ The bootstrap of the server. This should only have the minimum
+ needed to bootstrap the mc kernel and profile service.
+
+ $Id: jboss-osgi-bootstrap-beans.xml 86378 2009-03-26 12:02:32Z thomas.diesler(a)jboss.com $
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The MainDeployer -->
+ <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+ <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+ <property name="deployers"><inject bean="Deployers"/></property>
+ <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
+ </bean>
+
+ <!-- The ManagedDeploymentCreator implementation -->
+ <bean name="ManagedDeploymentCreator" class="org.jboss.deployers.plugins.managed.DefaultManagedDeploymentCreator" />
+
+ <!-- ModificationType structure processor -->
+ <bean name="ModificationTypeStructureProcessor" class="org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor">
+ <incallback method="addMatcher"/>
+ <uncallback method="removeMatcher"/>
+ </bean>
+
+ <!-- The holder for deployers that determine structure -->
+ <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+ <property name="structureBuilder">
+ <!-- The consolidator of the structure information -->
+ <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder">
+ <property name="structureProcessor"><inject bean="ModificationTypeStructureProcessor"/></property>
+ </bean>
+ </property>
+ <!-- Accept any implementor of structure deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- The holder for deployers that do real deployment -->
+ <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+ <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+ <!-- Accept any implementor of deployer -->
+ <incallback method="addDeployer"/>
+ <uncallback method="removeDeployer"/>
+ </bean>
+
+ <!-- A declared structure descriptor deployer -->
+ <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+ <!-- JAR Structure -->
+ <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+ <property name="candidateStructureVisitorFactory">
+ <!-- Any file that is not an ordinary directory is a candidate -->
+ <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+ <!-- A filter to exclude some obvious non-subdeployments -->
+ <property name="filter">
+ <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+ <constructor><parameter>
+ <list elementClass="java.lang.String">
+ <!-- Exclude class files as subdeployments -->
+ <value>.class</value>
+ </list>
+ </parameter></constructor>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- File Structure -->
+ <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+ <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+ <constructor>
+ <parameter>
+ <set elementClass="java.lang.String">
+ <value>-service.xml</value>
+ <value>-beans.xml</value>
+ </set>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <!-- POJO Deployment -->
+ <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer"/>
+ <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer"/>
+ <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+ <constructor><parameter class="org.jboss.kernel.Kernel"><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+ </bean>
+
+ <!-- VFS ClassLoader -->
+ <bean name="ClassLoaderSystem" class="org.jboss.classloader.spi.ClassLoaderSystem">
+ <constructor factoryClass="org.jboss.classloader.spi.ClassLoaderSystem" factoryMethod="getInstance"/>
+ </bean>
+ <bean name="ClassLoading" class="org.jboss.classloading.spi.dependency.ClassLoading">
+ <incallback method="addModule" state="Configured"/>
+ <uncallback method="removeModule" state="Configured"/>
+ </bean>
+ <bean name="ClassLoadingDefaultDeployer" class="org.jboss.deployers.plugins.classloading.ClassLoadingDefaultDeployer">
+ <property name="defaultMetaData">
+ <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
+ </property>
+ </bean>
+ <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+ <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ </bean>
+ <bean name="ClassLoaderDeployer" class="org.jboss.deployers.plugins.classloading.AbstractLevelClassLoaderSystemDeployer">
+ <property name="classLoading"><inject bean="ClassLoading"/></property>
+ <property name="system"><inject bean="ClassLoaderSystem"/></property>
+ </bean>
+
+</deployment>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jndi.properties 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=jnp://@jboss.bind.address@:1099
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/log4j.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.hibernate">
+ <priority value="INFO" />
+ </category>
+
+ <!-- hide optimistic locking failures
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="FATAL" />
+ </category>
+ -->
+
+ <!-- hide proxy narrowing warns -->
+ <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+ <priority value="ERROR" />
+ </category>
+
+ <!-- show SQL DML statements as they are executed -->
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- show JDBC parameters
+ <category name="org.hibernate.type">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- hide httpclient wire dumps -->
+ <category name="httpclient.wire.header">
+ <priority value="INFO" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/service/startlevel/service-startlevel.bnd 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,5 @@
+# bnd build -classpath target/test-classes -output target/test-libs/service/service-startlevel.jar src/test/resources/service/startlevel/service-startlevel.bnd
+
+Bundle-SymbolicName: service-startlevel
+Bundle-Activator: org.jboss.test.osgi.service.startlevel.bundle.ServiceActivator
+Export-Package: org.jboss.test.osgi.service.startlevel.bundle
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/tst.policy 2009-04-16 07:48:05 UTC (rev 87401)
@@ -0,0 +1,4 @@
+grant {
+ permission java.security.AllPermission;
+};
+
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-16 06:09:17 UTC (rev 87400)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-04-16 07:48:05 UTC (rev 87401)
@@ -7,7 +7,7 @@
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-testsuite</artifactId>
- <packaging>jar</packaging>
+ <packaging>pom</packaging>
<parent>
<groupId>org.jboss.osgi</groupId>
@@ -15,315 +15,9 @@
<version>1.0.0.Beta1</version>
</parent>
- <!-- Properties -->
- <properties>
- <surefire.security.args>-Djava.security.manager -Djava.security.policy=src/test/resources/tst.policy</surefire.security.args>
- </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-runtime-deployer</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-aop-mc-int</artifactId>
- </dependency>
-
- <!-- Provided Dependencies -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.log</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-logging</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-remotelog</artifactId>
- <version>${version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <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-example-jars.xml"/>
- <ant antfile="scripts/antrun-test-jars.xml"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- <profiles>
-
- <!--
- Name: framework-default
- Descr: Setup for default framework integration testing
- -->
- <profile>
- <id>framework-default</id>
- <activation>
- <property>
- <name>!framework</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version}</version>
- <classifier>config</classifier>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: framework-felix
- Descr: Setup for Felix framework integration testing
- -->
- <profile>
- <id>framework-felix</id>
- <activation>
- <property>
- <name>!framework</name>
- <value>felix</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version}</version>
- <classifier>config</classifier>
- </dependency>
- </dependencies>
- </profile>
-
- <!--
- Name: framework-equinox
- Descr: Setup for Equinox framework integration testing
- -->
- <profile>
- <id>framework-equinox</id>
- <activation>
- <property>
- <name>!framework</name>
- <value>equinox</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-equinox</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-equinox</artifactId>
- <version>${version}</version>
- <classifier>config</classifier>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
- Name: framework-knopflerfish
- Descr: Setup for Equinox framework integration testing
- -->
- <profile>
- <id>framework-knopflerfish</id>
- <activation>
- <property>
- <name>!framework</name>
- <value>knopflerfish</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-runtime-knopflerfish</artifactId>
- <version>${version}</version>
- <classifier>config</classifier>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skipTests>true</skipTests>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
- Name: embedded-tesing
- Descr: Setup for embedded integration testing
- -->
- <profile>
- <id>embedded-tesing</id>
- <activation>
- <property>
- <name>!jboss.bind.address</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludes>
- <!-- Exclude tests that require remote access -->
- <exclude>org/jboss/test/osgi/deployer/**</exclude>
- <exclude>org/jboss/test/osgi/**/*RemoteTestCase.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!--
- Name: remote-tesing
- Descr: Setup for remote integration testing
- -->
- <profile>
- <id>remote-tesing</id>
- <activation>
- <property>
- <name>jboss.bind.address</name>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
- <scope>test</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <!-- argLine>${surefire.security.args}</argLine -->
- <excludes>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
+ <modules>
+ <module>example</module>
+ <module>functional</module>
+ </modules>
+
</project>
16 years, 8 months