[jboss-cvs] JBossAS SVN: r94462 - in projects/jboss-osgi/trunk: testsuite/example/src/test/resources/META-INF and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 7 10:50:28 EDT 2009
Author: thomas.diesler at jboss.com
Date: 2009-10-07 10:50:27 -0400 (Wed, 07 Oct 2009)
New Revision: 94462
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGI161TestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi161/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi161/jbosgi161-bundle.bnd
Modified:
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
[JBOSGI-161] Cannot use commons-logging
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-10-07 14:14:48 UTC (rev 94461)
+++ projects/jboss-osgi/trunk/pom.xml 2009-10-07 14:50:27 UTC (rev 94462)
@@ -37,6 +37,7 @@
<!-- Properties -->
<properties>
<version.aqute.bnd>0.0.356</version.aqute.bnd>
+ <version.apache.commons.logging>1.1.1</version.apache.commons.logging>
<version.apache.felix.configadmin>1.0.10</version.apache.felix.configadmin>
<version.apache.felix.core>1.4.0</version.apache.felix.core>
<version.apache.felix.log>1.0.0</version.apache.felix.log>
@@ -44,7 +45,7 @@
<version.izpack>4.3.1</version.izpack>
<version.jboss.osgi.apache.xerces>2.9.1.SP2</version.jboss.osgi.apache.xerces>
<version.jboss.osgi.blueprint>1.0.0.Beta1</version.jboss.osgi.blueprint>
- <version.jboss.osgi.common>1.0.1</version.jboss.osgi.common>
+ <version.jboss.osgi.common>1.0.2-SNAPSHOT</version.jboss.osgi.common>
<version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
<version.jboss.osgi.framework>1.0.0-SNAPSHOT</version.jboss.osgi.framework>
<version.jboss.osgi.hotdeploy>1.0.1</version.jboss.osgi.hotdeploy>
@@ -223,6 +224,11 @@
<artifactId>pax-web-jetty-bundle</artifactId>
<version>${version.ops4j.pax.web}</version>
</dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.apache.commons.logging}</version>
+ </dependency>
<!-- org.osgi -->
<dependency>
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 14:14:48 UTC (rev 94461)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 14:50:27 UTC (rev 94462)
@@ -20,6 +20,8 @@
<entry><key>org.osgi.framework.system.packages.extra</key><value>
org.apache.log4j,
+ org.apache.log4j.spi,
+ org.apache.log4j.xml,
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-10-07 14:14:48 UTC (rev 94461)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-10-07 14:50:27 UTC (rev 94462)
@@ -22,6 +22,7 @@
[JBOSGI-142] Investigate classloading space
[JBOSGI-143] Investigate DynamicImport-Package
[JBOSGI-151] Cannot resolve circular dependencies
+ [JBOSGI-161] Cannot use commons logging
-->
@@ -124,6 +125,9 @@
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleC.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleC.bnd" />
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi151-bundleD.jar" files="${tests.resources.dir}/jbosgi151/jbosgi151-bundleD.bnd" />
+ <!-- jbosgi161 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi161-bundle.jar" files="${tests.resources.dir}/jbosgi161/jbosgi161-bundle.bnd" />
+
<!-- performance -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/performance-blueprint.jar" files="${tests.resources.dir}/performance/blueprint/performance-blueprint.bnd" />
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGI161TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGI161TestCase.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/OSGI161TestCase.java 2009-10-07 14:50:27 UTC (rev 94462)
@@ -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.jbosgi161;
+
+//$Id: OSGI41RemoteTestCase.java 87182 2009-04-13 13:47:53Z thomas.diesler at jboss.com $
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.osgi.spi.capability.LogServiceCapability;
+import org.jboss.osgi.spi.testing.OSGiBundle;
+import org.jboss.osgi.spi.testing.OSGiRuntime;
+import org.jboss.osgi.spi.testing.OSGiTest;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ * [JBOSGI-161] Cannot use commons logging
+ *
+ * https://jira.jboss.org/jira/browse/JBOSGI-161
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2009
+ */
+public class OSGI161TestCase extends OSGiTest
+{
+ @Test
+ public void testLogging() throws Exception
+ {
+ OSGiRuntime runtime = getDefaultRuntime();
+ try
+ {
+ runtime.addCapability(new LogServiceCapability());
+
+ OSGiBundle bundleA = runtime.installBundle("jbosgi161-bundle.jar");
+ bundleA.start();
+
+ assertEquals("Bundle active", Bundle.ACTIVE, bundleA.getState());
+
+ bundleA.uninstall();
+ }
+ finally
+ {
+ runtime.shutdown();
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi161/bundle/OSGI161Activator.java 2009-10-07 14:50:27 UTC (rev 94462)
@@ -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.jbosgi161.bundle;
+
+//$Id: $
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class OSGI161Activator implements BundleActivator
+{
+ public void start(BundleContext context) throws Exception
+ {
+ Log log = LogFactory.getLog(OSGI161Activator.class);
+
+ String loggerClass = log.getClass().getName();
+ if (loggerClass.toLowerCase().contains("log4j") == false)
+ throw new IllegalStateException("Unexpected logger: " + loggerClass);
+
+ log.info("*******************************************");
+ log.info("* start: " + context.getBundle());
+ log.info("*******************************************");
+ }
+
+ public void stop(BundleContext context) throws Exception
+ {
+ }
+}
\ No newline at end of file
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 14:14:48 UTC (rev 94461)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-10-07 14:50:27 UTC (rev 94462)
@@ -18,9 +18,12 @@
<entry><key>org.osgi.framework.storage</key><value>${log4j.output.dir}/osgi-store</value></entry>
<entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
<entry><key>org.osgi.framework.system.packages.extra</key><value>
+
<!-- [JBOSGI-145] JAXB classes are loaded from the system classpath -->
com.sun.xml.internal.bind.v2,
+ org.apache.log4j;version=1.2,
+
org.jboss.beans.metadata.plugins;version=2.0,
org.jboss.beans.metadata.plugins.builder;version=2.0,
org.jboss.beans.metadata.spi;version=2.0,
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi161/jbosgi161-bundle.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi161/jbosgi161-bundle.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi161/jbosgi161-bundle.bnd 2009-10-07 14:50:27 UTC (rev 94462)
@@ -0,0 +1,6 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi161-bundle.jar src/test/resources/jbosgi161/bundle.bnd
+
+Bundle-SymbolicName: jbosgi161-bundle
+Bundle-Activator: org.jboss.test.osgi.jbosgi161.bundle.OSGI161Activator
+Private-Package: org.jboss.test.osgi.jbosgi161.bundle
+Import-Package: org.apache.commons.logging, org.osgi.framework
More information about the jboss-cvs-commits
mailing list