JBoss-OSGI SVN: r97023 - in projects/jboss-osgi/projects/bundles/apache-xerces/trunk: src/main/java/org/jboss/osgi/xml and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 09:13:37 -0500 (Thu, 26 Nov 2009)
New Revision: 97023
Modified:
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java
projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java
Log:
Remove dependency on osgi.common
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-11-26 13:13:31 UTC (rev 97022)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/pom.xml 2009-11-26 14:13:37 UTC (rev 97023)
@@ -21,18 +21,18 @@
<artifactId>jboss-osgi-apache-xerces</artifactId>
<packaging>bundle</packaging>
- <version>2.9.2-SNAPSHOT</version>
+ <version>2.9.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.4-SNAPSHOT</version>
+ <version>1.0.4</version>
</parent>
<properties>
<version.apache.xerces>2.9.1</version.apache.xerces>
- <version.jboss.osgi.common>1.0.3-SNAPSHOT</version.jboss.osgi.common>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.wutka.dtdparser>1.2.1</version.wutka.dtdparser>
<version.xml.resolver>1.2</version.xml.resolver>
<version.osgi>4.2.0</version.osgi>
@@ -40,11 +40,10 @@
<dependencies>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-common</artifactId>
- <version>${version.jboss.osgi.common}</version>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
</dependency>
-
<dependency>
<groupId>apache-xerces</groupId>
<artifactId>xml-apis</artifactId>
@@ -95,7 +94,7 @@
org.jboss.osgi.xml.internal
</Privat-Package>
<Export-Package>
- org.jboss.osgi.xml;version=${version}
+ org.jboss.osgi.xml;version=2.9.1
</Export-Package>
<Import-Package>
javax.xml.datatype,
@@ -103,11 +102,11 @@
javax.xml.parsers,
javax.xml.transform*,
javax.xml.validation,
+ org.slf4j,
org.w3c.dom*,
org.xml.sax*,
<!-- import -->
- org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.spi.capability;version=1.0,
org.osgi.framework,
org.osgi.service.log,
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java 2009-11-26 13:13:31 UTC (rev 97022)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserActivatorExt.java 2009-11-26 14:13:37 UTC (rev 97023)
@@ -29,13 +29,13 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
-import org.jboss.osgi.xml.internal.XMLParserActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
+import org.osgi.util.xml.XMLParserActivator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Activate the XML parser using {@link XMLParserActivatorExt}
@@ -45,12 +45,11 @@
*/
public class XMLParserActivatorExt extends XMLParserActivator
{
- private LogService log;
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(XMLParserActivatorExt.class);
public void start(BundleContext context) throws Exception
{
- log = new LogServiceTracker(context);
-
super.start(context);
logSAXParserFactory(context);
@@ -58,7 +57,7 @@
}
@Override
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public void setDOMProperties(DocumentBuilderFactory factory, Hashtable props)
{
super.setDOMProperties(factory, props);
@@ -89,7 +88,7 @@
}
@Override
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public void setSAXProperties(SAXParserFactory factory, Hashtable props)
{
super.setSAXProperties(factory, props);
@@ -127,20 +126,20 @@
for (ServiceReference sref : saxRefs)
{
Object factory = context.getService(sref);
- log.log(LogService.LOG_DEBUG, "SAXParserFactory: " + factory.getClass().getName());
+ log.debug("SAXParserFactory: " + factory.getClass().getName());
for (String key : sref.getPropertyKeys())
{
Object value = sref.getProperty(key);
if (key.equals(Constants.OBJECTCLASS))
value = Arrays.asList((String[])value);
- log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ log.debug(" " + key + "=" + value);
}
}
}
else
{
- log.log(LogService.LOG_WARNING, "No SAXParserFactory registered");
+ log.warn("No SAXParserFactory registered");
}
}
@@ -152,20 +151,20 @@
for (ServiceReference sref : domRefs)
{
Object factory = context.getService(sref);
- log.log(LogService.LOG_DEBUG, "DocumentBuilderFactory: " + factory.getClass().getName());
+ log.debug("DocumentBuilderFactory: " + factory.getClass().getName());
for (String key : sref.getPropertyKeys())
{
Object value = sref.getProperty(key);
if (key.equals(Constants.OBJECTCLASS))
value = Arrays.asList((String[])value);
- log.log(LogService.LOG_DEBUG, " " + key + "=" + value);
+ log.debug(" " + key + "=" + value);
}
}
}
else
{
- log.log(LogService.LOG_WARNING, "No DocumentBuilderFactory registered");
+ log.warn("No DocumentBuilderFactory registered");
}
}
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java 2009-11-26 13:13:31 UTC (rev 97022)
+++ projects/jboss-osgi/projects/bundles/apache-xerces/trunk/src/main/java/org/jboss/osgi/xml/XMLParserCapability.java 2009-11-26 14:13:37 UTC (rev 97023)
@@ -26,10 +26,9 @@
import javax.xml.parsers.SAXParserFactory;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.capability.LogServiceCapability;
/**
- * Adds the XML parser capability to the {@link OSGiRuntime} under test.
+ * Adds the XML parser capability.
*
* It is ignored if the {@link SAXParserFactory} is already registered.
*
@@ -60,8 +59,6 @@
super(SAXParserFactory.class.getName());
setFilter("(" + PARSER_PROVIDER + "=" + PROVIDER_JBOSS_OSGI + ")");
- addDependency(new LogServiceCapability());
-
addBundle("bundles/jboss-osgi-apache-xerces.jar");
}
}
\ No newline at end of file
14 years, 6 months
JBoss-OSGI SVN: r97021 - in projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk: scripts and 9 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 07:40:11 -0500 (Thu, 26 Nov 2009)
New Revision: 97021
Added:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd
Removed:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingService.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/husky/
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/context/
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/.classpath
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/jboss-osgi-framework.properties
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/log4j.xml
Log:
Add integration tests
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/.classpath 2009-11-26 11:45:54 UTC (rev 97020)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/.classpath 2009-11-26 12:40:11 UTC (rev 97021)
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" path="src/main/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"/>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 11:45:54 UTC (rev 97020)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 12:40:11 UTC (rev 97021)
@@ -10,18 +10,18 @@
<!-- ====================================================================== -->
<!-- $Id$ -->
-
+
<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 Bundles - JBossXB</name>
<description>A JBossOSGi provided JBossXB bundle</description>
-
+
<groupId>org.jboss.osgi.bundles</groupId>
<artifactId>jboss-osgi-xml-binding</artifactId>
<packaging>bundle</packaging>
- <version>2.0.1-SNAPSHOT</version>
+ <version>2.0.2-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -30,39 +30,80 @@
<version>1.0.4</version>
</parent>
+ <!-- Subversion -->
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
+ <url>http://fisheye.jboss.com/qsearch/JBossOSGi</url>
+ </scm>
+
<!-- Properties -->
<properties>
- <version.jboss.xb>2.0.1.GA</version.jboss.xb>
+ <version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
+ <version.jboss.xb>2.0.2.Beta3</version.jboss.xb>
<version.javassist>3.9.0.GA</version.javassist>
- <version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
+ <version.jboss.osgi.common.core>2.2.13.GA</version.jboss.osgi.common.core>
+ <version.jboss.osgi.husky>1.0.2-SNAPSHOT</version.jboss.osgi.husky>
+ <version.jboss.osgi.jaxb>2.1.10-SNAPSHOT</version.jboss.osgi.jaxb>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
<version.osgi>4.2.0</version.osgi>
</properties>
+ <!-- Dependencies -->
<dependencies>
<dependency>
- <groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-jaxb</artifactId>
- <version>${version.jboss.osgi.jaxb}</version>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
</dependency>
-
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>${version.javassist}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<version>${version.jboss.xb}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
- <groupId>javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>${version.javassist}</version>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
</dependency>
-
+
<!-- Provided Dependencies -->
<dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-common-core</artifactId>
+ <version>${version.jboss.osgi.common.core}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-husky</artifactId>
+ <version>${version.jboss.osgi.husky}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.bundles</groupId>
+ <artifactId>jboss-osgi-jaxb</artifactId>
+ <version>${version.jboss.osgi.jaxb}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- OSGi Dependencies -->
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${version.osgi}</version>
@@ -74,6 +115,19 @@
<version>${version.osgi}</version>
<scope>provided</scope>
</dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version.jboss.osgi.runtime.felix}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
@@ -88,28 +142,27 @@
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.jboss.osgi.jbossxb;version=2.0.1
+ org.jboss.osgi.jbossxb;version=2.0.2
</Export-Package>
<Import-Package>
<!-- system -->
- javax.activation,
- javax.xml.bind.*,
- javax.xml.namespace,
+ javax.activation,
+ javax.xml.bind.*,
+ javax.xml.namespace,
javax.xml.parsers,
org.slf4j,
- org.w3c.dom*,
+ org.w3c.dom*,
org.xml.sax*,
<!-- import -->
- com.wutka.dtd,
- org.apache.xerces.*,
+ com.wutka.dtd,
+ org.apache.xerces.*,
org.jboss.logging,
- org.jboss.osgi.common.log;version=1.0,
org.jboss.osgi.jaxb;version=2.0,
org.jboss.osgi.spi.capability;version=1.0,
- org.jboss.osgi.spi.service;version=1.0,
- org.jboss.util*,
- org.osgi.framework,
+ org.jboss.osgi.spi.util;version=1.0,
+ org.jboss.util*,
+ org.osgi.framework,
org.osgi.service.log,
org.osgi.util.tracker,
@@ -122,25 +175,112 @@
jboss-reflect;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.beans.info.*;version=2.0.2,
- org.jboss.config.*;version=2.0.2,
- org.jboss.classadapter.*;version=2.0.2,
- org.jboss.joinpoint.*;version=2.0.2,
- org.jboss.reflect*;version=2.0.2,
- org.jboss.xb.*;version=2.0.1,
- javassist*;version=3.9.0,
+ org.jboss.xb.annotations;version=2.0.2,
</_exportcontents>
</instructions>
</configuration>
</plugin>
+ <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>integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="artifactId" value="${artifactId}" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="build.artifact" value="${project.build.finalName}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <argLine>${surefire.jpda.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
- <!-- Subversion -->
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-osgi/projec...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-osgi/projects/...</developerConnection>
- <url>http://fisheye.jboss.com/qsearch/JBossOSGi/projects/bundles/xml-binding/t...</url>
- </scm>
-
+
+ <!-- Profiles -->
+ <profiles>
+
+ <!--
+ Name: jpda
+ Descr: Enable JPDA remote debuging
+ -->
+ <profile>
+ <id>jpda</id>
+ <activation>
+ <property>
+ <name>jpda</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
+ </profile>
+
+ </profiles>
+
</project>
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts (from rev 97013, projects/jboss-osgi/projects/bundles/husky/trunk/scripts)
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/scripts/antrun-test-jars.xml 2009-11-26 07:32:06 UTC (rev 97013)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/antrun-test-jars.xml 2009-11-26 12:40:11 UTC (rev 97021)
@@ -45,9 +45,9 @@
<!-- Please add alphabetically -->
- <!-- context -->
- <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/context-basic.jar" files="${tests.resources.dir}/context/context-basic.bnd" />
-
+ <!-- simple-unmarshaller -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/simple-unmarshaller.jar" files="${tests.resources.dir}/simple/simple-unmarshaller.bnd" />
+
<!-- Please add alphabetically -->
</target>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml 2009-11-26 07:32:06 UTC (rev 97013)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/scripts/assembly-bundles.xml 2009-11-26 12:40:11 UTC (rev 97021)
@@ -15,6 +15,10 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
+ <include>*:jboss-osgi-apache-xerces:jar</include>
+ <include>*:jboss-osgi-common-core:jar</include>
+ <include>*:jboss-osgi-husky:jar</include>
+ <include>*:jboss-osgi-jaxb:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -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.osgi.jbossxb;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+
+/**
+ * An unmarshaller service
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public interface UnmarshallerService
+{
+ void setValidation(boolean validation);
+
+ void setNamespaceAware(boolean namespaces);
+
+ void setSchemaValidation(boolean validation);
+
+ void setErrorHandler(ErrorHandler errorHandler);
+
+ /**
+ * Register the mapping from the public id/system id to the dtd/xsd file
+ * name. This overwrites any existing mapping.
+ *
+ * @param id the DOCTYPE public id or system id such as "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
+ * @param dtdOrSchema the simple dtd/xsd file name, "ejb-jar.dtd"
+ */
+ void registerSchemaLocation(String id, String dtdOrSchema);
+
+ void addClassBinding(String nsUri, Class<?> clazz);
+
+ Object unmarshal(Reader xmlReader) throws IOException;
+
+ Object unmarshal(InputStream xmlStream) throws IOException;
+
+ Object unmarshal(InputSource source) throws IOException;
+
+ Object unmarshal(String xml) throws IOException;
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/UnmarshallerService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-26 11:45:54 UTC (rev 97020)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingCapability.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -25,13 +25,11 @@
import org.jboss.osgi.jaxb.JAXBCapability;
import org.jboss.osgi.spi.capability.Capability;
-import org.jboss.osgi.spi.testing.OSGiRuntime;
/**
- * Adds the JBossXB capability to the {@link OSGiRuntime}
- * under test.
+ * Adds the JBossXB capability.
*
- * It is ignored if the {@link XMLBindingService} is already registered.
+ * It is ignored if the {@link UnmarshallerService} is already registered.
*
* Dependent capabilities: {@link JAXBCapability}.
*
@@ -44,7 +42,7 @@
{
public XMLBindingCapability()
{
- super (XMLBindingService.class.getName());
+ super (UnmarshallerService.class.getName());
addDependency(new JAXBCapability());
Deleted: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingService.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingService.java 2009-11-26 11:45:54 UTC (rev 97020)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/XMLBindingService.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -1,34 +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.jbossxb;
-
-//$Id$
-
-/**
- * A marker service that is registered by jboss-osgi-xml-binding
- *
- * @author thomas.diesler(a)jboss.com
- * @since 29-May-2009
- */
-public interface XMLBindingService
-{
-}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,192 @@
+/*
+ * 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.jbossxb.internal;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.jboss.osgi.spi.util.BundleClassLoader;
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.xb.binding.JBossXBException;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+
+/**
+ * A {@link BundleActivator} that initializes the JBossXB bundle
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 13-May-2009
+ */
+public class UnmarshallerServiceImpl implements UnmarshallerService
+{
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(UnmarshallerServiceImpl.class);
+
+ private BundleContext context;
+ private Unmarshaller unmarshaller;
+ private JBossEntityResolver entityResolver;
+ private DefaultSchemaResolver schemaBindingResolver;
+
+ public UnmarshallerServiceImpl(BundleContext context)
+ {
+ this.context = context;
+ unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ schemaBindingResolver = new DefaultSchemaResolver();
+ }
+
+ public void setNamespaceAware(boolean namespaces)
+ {
+ try
+ {
+ unmarshaller.setNamespaceAware(namespaces);
+ }
+ catch (JBossXBException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ public void setSchemaValidation(boolean validation)
+ {
+ try
+ {
+ unmarshaller.setSchemaValidation(validation);
+ }
+ catch (JBossXBException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ public void setValidation(boolean validation)
+ {
+ try
+ {
+ unmarshaller.setValidation(validation);
+ }
+ catch (JBossXBException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+
+ public void setErrorHandler(ErrorHandler errorHandler)
+ {
+ unmarshaller.setErrorHandler(errorHandler);
+ }
+
+ public void registerSchemaLocation(String id, String dtdOrSchema)
+ {
+ if (entityResolver == null)
+ {
+ try
+ {
+ entityResolver = new JBossEntityResolver();
+ unmarshaller.setEntityResolver(entityResolver);
+ }
+ catch (JBossXBException ex)
+ {
+ throw new IllegalStateException(ex);
+ }
+ }
+ entityResolver.registerLocalEntity(id, dtdOrSchema);
+ }
+
+ public void addClassBinding(String nsUri, Class<?> clazz)
+ {
+ schemaBindingResolver.addClassBinding(nsUri, clazz);
+ }
+
+ public Object unmarshal(Reader xmlReader) throws IOException
+ {
+ try
+ {
+ return unmarshaller.unmarshal(xmlReader, schemaBindingResolver);
+ }
+ catch (JBossXBException ex)
+ {
+ IOException ioex = new IOException("Cannot unmarshall xmlReader");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Object unmarshal(InputStream xmlStream) throws IOException
+ {
+ try
+ {
+ return unmarshaller.unmarshal(xmlStream, schemaBindingResolver);
+ }
+ catch (JBossXBException ex)
+ {
+ IOException ioex = new IOException("Cannot unmarshall xmlStream");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Object unmarshal(InputSource source) throws IOException
+ {
+ try
+ {
+ return unmarshaller.unmarshal(source, schemaBindingResolver);
+ }
+ catch (JBossXBException ex)
+ {
+ IOException ioex = new IOException("Cannot unmarshall input source");
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ public Object unmarshal(String xml) throws IOException
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ BundleClassLoader bundleLoader = BundleClassLoader.createClassLoader(context.getBundle());
+ Thread.currentThread().setContextClassLoader(bundleLoader);
+ return unmarshaller.unmarshal(xml, schemaBindingResolver);
+ }
+ catch (JBossXBException ex)
+ {
+ IOException ioex = new IOException("Cannot unmarshall: " + xml);
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(ctxLoader);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/UnmarshallerServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-11-26 11:45:54 UTC (rev 97020)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -23,16 +23,12 @@
//$Id$
-import javax.xml.parsers.SAXParserFactory;
-
-import org.jboss.osgi.jbossxb.XMLBindingService;
-import org.jboss.osgi.xml.XMLParserCapability;
-import org.jboss.xb.binding.JBossXBException;
-import org.jboss.xb.binding.parser.sax.SaxJBossXBParser;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.framework.ServiceFactory;
+import org.osgi.framework.ServiceRegistration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,48 +45,18 @@
public void start(BundleContext context) throws Exception
{
- ServiceTracker saxTracker = new ServiceTracker(context, SAXParserFactory.class.getName(), null)
+ ServiceFactory unmarshallerFactory = new ServiceFactory()
{
- @Override
- public Object addingService(ServiceReference reference)
+ public Object getService(Bundle bundle, ServiceRegistration registration)
{
- String provider = (String)reference.getProperty(XMLParserCapability.PARSER_PROVIDER);
- boolean hasJBossSAXParser = XMLParserCapability.PROVIDER_JBOSS_OSGI.equals(provider);
- boolean hasXMLBindingService = context.getServiceReference(XMLBindingService.class.getName()) != null;
-
- SAXParserFactory saxFactory = (SAXParserFactory)super.addingService(reference);
- if (hasXMLBindingService == false && hasJBossSAXParser == true)
- {
- log.debug("JBossXB SAXParserFactory: " + saxFactory);
+ return new UnmarshallerServiceImpl(bundle.getBundleContext());
+ }
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- try
- {
- Thread.currentThread().setContextClassLoader(saxFactory.getClass().getClassLoader());
- try
- {
- // SaxJBossXBParser initializes the SAXParserFactory in a static block
- // using SAXParserFactory.newInstance(), which internally uses the TCCL
- new SaxJBossXBParser();
- }
- catch (JBossXBException ex)
- {
- throw new IllegalStateException("Cannot initialize SaxJBossXBParser", ex);
- }
-
- // Register the XMLBindingService
- XMLBindingService service = new XMLBindingService(){};
- context.registerService(XMLBindingService.class.getName(), service, null);
- }
- finally
- {
- Thread.currentThread().setContextClassLoader(ctxLoader);
- }
- }
- return saxFactory;
+ public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
+ {
}
};
- saxTracker.open();
+ context.registerService(UnmarshallerService.class.getName(), unmarshallerFactory, null);
}
public void stop(BundleContext context) throws Exception
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test (from rev 97013, projects/jboss-osgi/projects/bundles/husky/trunk/src/test)
Copied: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java (from rev 97013, projects/jboss-osgi/projects/bundles/husky/trunk/src/test/java/org/jboss/test/osgi/husky/context/ContextTestCase.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/BasicXMLBindingTestCase.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,111 @@
+/*
+ * 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.jbossxb;
+
+//$Id$
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assume.assumeNotNull;
+
+import java.net.URL;
+
+import org.jboss.osgi.husky.BridgeFactory;
+import org.jboss.osgi.husky.HuskyCapability;
+import org.jboss.osgi.husky.RuntimeContext;
+import org.jboss.osgi.jbossxb.UnmarshallerService;
+import org.jboss.osgi.jbossxb.XMLBindingCapability;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.test.osgi.jbossxb.simple.CourseBooking;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Test XMLBindingService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class BasicXMLBindingTestCase extends OSGiTest
+{
+ @RuntimeContext
+ public BundleContext context;
+
+ private OSGiRuntime runtime;
+
+ @Before
+ public void setUp() throws Exception
+ {
+ if (context == null)
+ {
+ runtime = getDefaultRuntime();
+ runtime.addCapability(new HuskyCapability());
+ runtime.addCapability(new XMLBindingCapability());
+
+ OSGiBundle bundle = runtime.installBundle("simple-unmarshaller.jar");
+ bundle.start();
+ }
+ }
+
+ @After
+ public void tearDown() throws BundleException
+ {
+ if (context == null)
+ runtime.shutdown();
+ }
+
+ @Test
+ public void testUnmarshaller() throws Exception
+ {
+ if (context == null)
+ BridgeFactory.getBridge().run();
+
+ assumeNotNull(context);
+
+ ServiceReference sref = context.getServiceReference(UnmarshallerService.class.getName());
+ assertNotNull("UnmarshallerService available", sref);
+
+ UnmarshallerService unmarshaller = (UnmarshallerService)context.getService(sref);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
+ Bundle bundle = context.getBundle();
+ URL xsdurl = bundle.getEntry("booking.xsd");
+ assertNotNull("booking.xsd available", xsdurl);
+
+ URL xmlurl = bundle.getEntry("booking.xml");
+ assertNotNull("booking.xml available", xmlurl);
+
+ unmarshaller.registerSchemaLocation(CourseBooking.NAMESPACE_XML_SIMPLE, xsdurl.toExternalForm());
+ unmarshaller.addClassBinding(CourseBooking.NAMESPACE_XML_SIMPLE, CourseBooking.class);
+
+ CourseBooking booking = (CourseBooking)unmarshaller.unmarshal(xmlurl.toExternalForm());
+ assertNotNull("booking not null", booking);
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,70 @@
+/*
+ * 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.jbossxb.apitest;
+
+//$Id$
+
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URL;
+
+import org.jboss.osgi.testing.OSGiTest;
+import org.jboss.test.osgi.jbossxb.simple.CourseBooking;
+import org.jboss.util.xml.JBossEntityResolver;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.junit.Test;
+
+/**
+ * Test JBossXB unmarshaller API
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 26-Nov-2009
+ */
+public class UnmarshallerTestCase extends OSGiTest
+{
+ @Test
+ public void testUnmarshaller() throws Exception
+ {
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setNamespaceAware(true);
+ unmarshaller.setValidation(true);
+
+ URL xsdurl = getResourceURL("simple/booking.xsd");
+ assertNotNull("booking.xsd available", xsdurl);
+
+ URL xmlurl = getResourceURL("simple/booking.xml");
+ assertNotNull("booking.xml available", xmlurl);
+
+ JBossEntityResolver entityResolver = new JBossEntityResolver();
+ entityResolver.registerLocalEntity(CourseBooking.NAMESPACE_XML_SIMPLE, xsdurl.toExternalForm());
+ unmarshaller.setEntityResolver(entityResolver);
+
+ DefaultSchemaResolver schemaBindingResolver = new DefaultSchemaResolver();
+ schemaBindingResolver.addClassBinding(CourseBooking.NAMESPACE_XML_SIMPLE, CourseBooking.class);
+
+ CourseBooking booking = (CourseBooking)unmarshaller.unmarshal(xmlurl.toExternalForm(), schemaBindingResolver);
+ assertNotNull("booking not null", booking);
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/apitest/UnmarshallerTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,126 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+
+/**
+ * <p>Java class for companyType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="companyType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="address" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
+ * <element ref="{}contact"/>
+ * </sequence>
+ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "companyType", propOrder = {
+ "address",
+ "contact"
+})
+public class CompanyType {
+
+ @XmlElement(required = true)
+ protected Object address;
+ @XmlElement(required = true)
+ protected ContactType contact;
+ @XmlAttribute
+ protected String name;
+
+ /**
+ * Gets the value of the address property.
+ *
+ * @return
+ * possible object is
+ * {@link Object }
+ *
+ */
+ public Object getAddress() {
+ return address;
+ }
+
+ /**
+ * Sets the value of the address property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Object }
+ *
+ */
+ public void setAddress(Object value) {
+ this.address = value;
+ }
+
+ /**
+ * Gets the value of the contact property.
+ *
+ * @return
+ * possible object is
+ * {@link ContactType }
+ *
+ */
+ public ContactType getContact() {
+ return contact;
+ }
+
+ /**
+ * Sets the value of the contact property.
+ *
+ * @param value
+ * allowed object is
+ * {@link ContactType }
+ *
+ */
+ public void setContact(ContactType value) {
+ this.contact = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CompanyType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,119 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for contactType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="contactType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="telephone" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="email" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "contactType", propOrder = {})
+public class ContactType {
+
+ @XmlAttribute(required = true)
+ protected String name;
+ @XmlAttribute(required = true)
+ protected String telephone;
+ @XmlAttribute(required = true)
+ protected String email;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the telephone property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTelephone() {
+ return telephone;
+ }
+
+ /**
+ * Sets the value of the telephone property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTelephone(String value) {
+ this.telephone = value;
+ }
+
+ /**
+ * Gets the value of the email property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * Sets the value of the email property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setEmail(String value) {
+ this.email = value;
+ }
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/ContactType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,231 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+package org.jboss.test.osgi.jbossxb.simple;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * <p>Java class for courseBooking complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="courseBooking">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element ref="{}company"/>
+ * <element ref="{}student" maxOccurs="unbounded"/>
+ * </sequence>
+ * <attribute name="courseReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="courseDate" use="required" type="{http://www.w3.org/2001/XMLSchema}date" />
+ * <attribute name="invoiceReference" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="totalPrice" use="required" type="{http://www.w3.org/2001/XMLSchema}decimal" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@JBossXmlSchema(namespace = CourseBooking.NAMESPACE_XML_SIMPLE, elementFormDefault = XmlNsForm.QUALIFIED)
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "courseBooking", propOrder = { "company", "student" })
+public class CourseBooking
+{
+ public static final String NAMESPACE_XML_SIMPLE = "http://org.jboss.test.osgi.jbossxb.simple";
+
+ @XmlElement(required = true)
+ protected CompanyType company;
+ @XmlElement(required = true)
+ protected List<StudentType> student;
+ @XmlAttribute(required = true)
+ protected String courseReference;
+ @XmlAttribute(required = true)
+ @XmlSchemaType(name = "date")
+ protected XMLGregorianCalendar courseDate;
+ @XmlAttribute(required = true)
+ protected String invoiceReference;
+ @XmlAttribute(required = true)
+ protected BigDecimal totalPrice;
+
+ /**
+ * Gets the value of the company property.
+ *
+ * @return
+ * possible object is
+ * {@link CompanyType }
+ *
+ */
+ public CompanyType getCompany()
+ {
+ return company;
+ }
+
+ /**
+ * Sets the value of the company property.
+ *
+ * @param value
+ * allowed object is
+ * {@link CompanyType }
+ *
+ */
+ public void setCompany(CompanyType value)
+ {
+ this.company = value;
+ }
+
+ /**
+ * Gets the value of the student property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the student property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getStudent().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link StudentType }
+ *
+ *
+ */
+ public List<StudentType> getStudent()
+ {
+ if (student == null)
+ {
+ student = new ArrayList<StudentType>();
+ }
+ return this.student;
+ }
+
+ /**
+ * Gets the value of the courseReference property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCourseReference()
+ {
+ return courseReference;
+ }
+
+ /**
+ * Sets the value of the courseReference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCourseReference(String value)
+ {
+ this.courseReference = value;
+ }
+
+ /**
+ * Gets the value of the courseDate property.
+ *
+ * @return
+ * possible object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public XMLGregorianCalendar getCourseDate()
+ {
+ return courseDate;
+ }
+
+ /**
+ * Sets the value of the courseDate property.
+ *
+ * @param value
+ * allowed object is
+ * {@link XMLGregorianCalendar }
+ *
+ */
+ public void setCourseDate(XMLGregorianCalendar value)
+ {
+ this.courseDate = value;
+ }
+
+ /**
+ * Gets the value of the invoiceReference property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getInvoiceReference()
+ {
+ return invoiceReference;
+ }
+
+ /**
+ * Sets the value of the invoiceReference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setInvoiceReference(String value)
+ {
+ this.invoiceReference = value;
+ }
+
+ /**
+ * Gets the value of the totalPrice property.
+ *
+ * @return
+ * possible object is
+ * {@link BigDecimal }
+ *
+ */
+ public BigDecimal getTotalPrice()
+ {
+ return totalPrice;
+ }
+
+ /**
+ * Sets the value of the totalPrice property.
+ *
+ * @param value
+ * allowed object is
+ * {@link BigDecimal }
+ *
+ */
+ public void setTotalPrice(BigDecimal value)
+ {
+ this.totalPrice = value;
+ }
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/CourseBooking.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,92 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.21 at 10:48:55 AM CEST
+//
+
+
+package org.jboss.test.osgi.jbossxb.simple;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for studentType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="studentType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="firstName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="surname" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "studentType", propOrder = {})
+public class StudentType {
+
+ @XmlAttribute(required = true)
+ protected String firstName;
+ @XmlAttribute(required = true)
+ protected String surname;
+
+ /**
+ * Gets the value of the firstName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * Sets the value of the firstName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFirstName(String value) {
+ this.firstName = value;
+ }
+
+ /**
+ * Gets the value of the surname property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSurname() {
+ return surname;
+ }
+
+ /**
+ * Sets the value of the surname property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSurname(String value) {
+ this.surname = value;
+ }
+
+}
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/java/org/jboss/test/osgi/jbossxb/simple/StudentType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/jboss-osgi-framework.properties
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/jboss-osgi-framework.properties 2009-11-26 07:32:06 UTC (rev 97013)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/jboss-osgi-framework.properties 2009-11-26 12:40:11 UTC (rev 97021)
@@ -8,22 +8,21 @@
org.osgi.framework.storage=${test.archive.directory}/../osgi-store
org.osgi.framework.storage.clean=onFirstInit
-# Husky socket connector properties
-org.jboss.osgi.husky.runtime.connector.host=localhost
-org.jboss.osgi.husky.runtime.connector.port=5401
-
# Framework bootdelegation
-# org.osgi.framework.bootdelegation=org.osgi.service.log
+# org.osgi.framework.bootdelegation=
# Extra System Packages
org.osgi.framework.system.packages.extra=\
+ org.apache.log4j;version=1.2, \
+ org.jboss.logging, \
org.jboss.osgi.deployment.interceptor;version=1.0, \
org.jboss.osgi.spi;version=1.0, \
org.jboss.osgi.spi.capability;version=1.0, \
org.jboss.osgi.spi.management;version=1.0, \
org.jboss.osgi.spi.service;version=1.0, \
org.jboss.osgi.spi.util;version=1.0, \
- org.osgi.framework;version=1.5, \
+ org.jboss.virtual;version=2.1, \
+ org.osgi.framework;version=1.5, \
org.slf4j;version=1.5
# Bundles that need to be installed with the Framework automatically
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/test/resources/log4j.xml 2009-11-26 07:32:06 UTC (rev 97013)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/log4j.xml 2009-11-26 12:40:11 UTC (rev 97021)
@@ -38,11 +38,10 @@
</category>
-->
- <!-- Show jboss deployer traces
+ <!-- Show jboss deployer traces -->
<category name="org.jboss.xb">
<priority value="TRACE" />
</category>
- -->
<!-- ======================= -->
<!-- Setup the Root category -->
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<course-booking xmlns="http://org.jboss.test.osgi.jbossxb.simple" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <company name="ACME Consulting">
+ <address>10 Coyote Avenue, Arizona, USA</address>
+ <contact name="Duke" email="duke(a)acme.com" telephone="1234567890" />
+ </company>
+ <student firstName="Jane" surname="Dow" />
+ <student firstName="John" surname="Doe" />
+</course-booking>
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This is taken from
+
+ "Java-XML mapping made easy with JAXB 2.0"
+ http://www.javaworld.com/javaworld/jw-06-2006/jw-0626-jaxb.html
+
+ $ xjc src/test/resources/xml/jaxb/booking.xsd -p org.jboss.test.osgi.example.xml.jaxb -d src/test/java
+
+-->
+<xsd:schema xmlns="http://org.jboss.test.osgi.jbossxb.simple"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://org.jboss.test.osgi.jbossxb.simple"
+ elementFormDefault="qualified" attributeFormDefault="unqualified"
+ version="1.0.0">
+
+ <xsd:element name="course-booking" type="courseBooking" />
+ <xsd:complexType name="courseBooking">
+ <xsd:sequence>
+ <xsd:element ref="company" />
+ <xsd:element ref="student" minOccurs="1" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="courseReference" type="xsd:string" use="required" />
+ <xsd:attribute name="courseDate" type="xsd:date" use="required" />
+ <xsd:attribute name="invoiceReference" type="xsd:string" use="required" />
+ <xsd:attribute name="totalPrice" type="xsd:decimal" use="required" />
+ </xsd:complexType>
+ <xsd:element name="student" type="studentType" />
+ <xsd:complexType name="studentType">
+ <xsd:attribute name="firstName" type="xsd:string" use="required" />
+ <xsd:attribute name="surname" type="xsd:string" use="required" />
+ </xsd:complexType>
+ <xsd:element name="company" type="companyType" />
+ <xsd:complexType name="companyType">
+ <xsd:sequence>
+ <xsd:element name="address" />
+ <xsd:element ref="contact" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ <xsd:element name="contact" type="contactType" />
+ <xsd:complexType name="contactType">
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="telephone" type="xsd:string" use="required" />
+ <xsd:attribute name="email" type="xsd:string" use="required" />
+ </xsd:complexType>
+</xsd:schema>
\ No newline at end of file
Property changes on: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/booking.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd (rev 0)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/test/resources/simple/simple-unmarshaller.bnd 2009-11-26 12:40:11 UTC (rev 97021)
@@ -0,0 +1,21 @@
+# bnd build -classpath target/test-classes -output target/test-libs/simple-unmarshaller.jar src/test/resources/simple/simple-unmarshaller.bnd
+
+Bundle-SymbolicName: simple-unmarshaller
+Export-Package: org.jboss.test.osgi.jbossxb
+Private-Package: org.jboss.test.osgi.jbossxb.simple
+
+Import-Package: \
+ javax.xml.bind.annotation, \
+ javax.xml.datatype, \
+ org.jboss.osgi.jbossxb, \
+ org.jboss.osgi.spi.capability, \
+ org.jboss.osgi.husky, \
+ org.jboss.osgi.testing, \
+ org.jboss.xb.annotations, \
+ org.junit, \
+ org.osgi.framework
+
+Include-Resource: booking.xml, booking.xsd
+
+# Tell Husky that there are test cases in this package
+Test-Package: org.jboss.test.osgi.jbossxb
14 years, 6 months
JBoss-OSGI SVN: r97013 - in projects/jboss-osgi/projects/bundles/husky/trunk: scripts and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-26 02:32:06 -0500 (Thu, 26 Nov 2009)
New Revision: 97013
Added:
projects/jboss-osgi/projects/bundles/husky/trunk/scripts/
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/test/
Removed:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/
projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
projects/jboss-osgi/projects/bundles/husky/trunk/src/site/
projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/.classpath
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/husky/trunk/scripts/antrun-test-jars.xml
projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml
Log:
Move integration tests and harness impl to one module
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/.classpath 2009-11-26 07:28:45 UTC (rev 97012)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/.classpath 2009-11-26 07:32:06 UTC (rev 97013)
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/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"/>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-11-26 07:28:45 UTC (rev 97012)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-11-26 07:32:06 UTC (rev 97013)
@@ -19,11 +19,11 @@
<description>JBoss OSGi Test Support</description>
<groupId>org.jboss.osgi.bundles</groupId>
- <artifactId>jboss-osgi-husky-parent</artifactId>
- <packaging>pom</packaging>
+ <artifactId>jboss-osgi-husky</artifactId>
+ <packaging>bundle</packaging>
<version>1.0.2-SNAPSHOT</version>
-
+
<!-- Parent -->
<parent>
<groupId>org.jboss.osgi</groupId>
@@ -45,44 +45,216 @@
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
<version.osgi>4.2.0</version.osgi>
</properties>
-
- <!-- Modules -->
- <modules>
- <module>harness</module>
- <module>testsuite</module>
- </modules>
-
- <!-- DependencyManagement -->
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.osgi</groupId>
- <artifactId>jboss-osgi-spi</artifactId>
- <version>${version.jboss.osgi.spi}</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-deployment</artifactId>
- <version>${version.jboss.osgi.deployment}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.osgi.runtime</groupId>
- <artifactId>jboss-osgi-runtime-felix</artifactId>
- <version>${version.jboss.osgi.runtime.felix}</version>
- </dependency>
-
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>${version.osgi}</version>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>${version.osgi}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>biz.aQute</groupId>
+ <artifactId>bnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi</groupId>
+ <artifactId>jboss-osgi-spi</artifactId>
+ <version>${version.jboss.osgi.spi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-deployment</artifactId>
+ <version>${version.jboss.osgi.deployment}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <!-- Provided Dependencies -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>${version.osgi}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ <version>${version.osgi}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test Dependencies -->
+ <dependency>
+ <groupId>org.jboss.osgi.runtime</groupId>
+ <artifactId>jboss-osgi-runtime-felix</artifactId>
+ <version>${version.jboss.osgi.runtime.felix}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${artifactId}</Bundle-SymbolicName>
+ <Bundle-Activator>org.jboss.osgi.husky.runtime.osgi.HuskyActivator</Bundle-Activator>
+ <Export-Package>
+ org.jboss.osgi.husky;version=${version},
+ org.jboss.osgi.testing;version=${version},
+ </Export-Package>
+ <Import-Package>
+ javax.management,
+ javax.naming,
+ org.jboss.osgi.deployment.interceptor;version="[1.0,1.1)",
+ org.jboss.osgi.spi;version="[1.0,1.1)",
+ org.jboss.osgi.spi.capability;version="[1.0,1.1)",
+ org.jboss.osgi.spi.management;version="[1.0,1.1)",
+ org.jboss.osgi.spi.util;version="[1.0,1.1)",
+ org.junit;version="[4.6,5.0)",
+ org.osgi.framework,
+ org.osgi.util.tracker,
+ org.slf4j;version="[1.5,1.6)",
+
+ <!-- ignore client side -->
+ !org.jboss.osgi.deployment.deployer,
+ !org.jboss.osgi.spi.framework,
+ !org.jboss.virtual,
+ !org.osgi.framework.launch,
+ !org.osgi.service.packageadmin,
+ </Import-Package>
+ <Private-Package>
+ org.jboss.osgi.husky.internal,
+ org.jboss.osgi.husky.runtime*,
+ org.jboss.osgi.testing.internal,
+ </Private-Package>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Embed-Dependency>
+ junit;inline=false,
+ </Embed-Dependency>
+ <_exportcontents>org.junit;version=${version.junit}</_exportcontents>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <quiet>true</quiet>
+ <excludePackageNames>*.internal</excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <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>integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="maven.runtime.classpath" refid="maven.runtime.classpath" />
+ <property name="artifactId" value="${artifactId}" />
+ <property name="tests.output.dir" value="${project.build.directory}" />
+ <property name="build.artifact" value="${project.build.finalName}" />
+ <ant antfile="scripts/antrun-test-jars.xml" />
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <argLine>${surefire.jpda.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>java.protocol.handler.pkgs</name>
+ <value>org.jboss.net.protocol|org.jboss.virtual.protocol</value>
+ </property>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ <property>
+ <name>org.jboss.osgi.husky.Invoker</name>
+ <value>org.jboss.osgi.husky.internal.OSGiInvoker</value>
+ </property>
+ <property>
+ <name>test.archive.directory</name>
+ <value>${project.build.directory}/test-libs</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- Profiles -->
+ <profiles>
+
+ <!--
+ Name: jpda
+ Descr: Enable JPDA remote debuging
+ -->
+ <profile>
+ <id>jpda</id>
+ <activation>
+ <property>
+ <name>jpda</name>
+ </property>
+ </activation>
+ <properties>
+ <surefire.jpda.args>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</surefire.jpda.args>
+ </properties>
+ </profile>
+
+ </profiles>
+
</project>
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/scripts (from rev 96948, projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts)
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/antrun-test-jars.xml 2009-11-25 13:38:06 UTC (rev 96948)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/scripts/antrun-test-jars.xml 2009-11-26 07:32:06 UTC (rev 97013)
@@ -31,6 +31,9 @@
<pathelement path="${maven.runtime.classpath}" />
</classpath>
</taskdef>
+
+ <!-- Copy build artifact to test-libs/bundles -->
+ <copy file="${tests.output.dir}/${build.artifact}.jar" tofile="${tests.output.dir}/test-libs/bundles/${artifactId}.jar" overwrite="true"/>
</target>
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/scripts/assembly-bundles.xml 2009-11-25 13:38:06 UTC (rev 96948)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/scripts/assembly-bundles.xml 2009-11-26 07:32:06 UTC (rev 97013)
@@ -15,7 +15,6 @@
<outputDirectory>bundles</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
<includes>
- <include>*:jboss-osgi-husky:jar</include>
<include>*:org.osgi.compendium:jar</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/src/main (from rev 96948, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main)
Deleted: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-25 13:38:06 UTC (rev 96948)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-26 07:32:06 UTC (rev 97013)
@@ -1,309 +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.testing.internal;
-
-// $Id$
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.jboss.osgi.deployment.deployer.DeployerService;
-import org.jboss.osgi.deployment.deployer.Deployment;
-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.management.ManagedServiceReference;
-import org.jboss.osgi.spi.util.BundleInfo;
-import org.jboss.osgi.testing.OSGiBundle;
-import org.jboss.osgi.testing.OSGiPackageAdmin;
-import org.jboss.osgi.testing.OSGiRuntime;
-import org.jboss.osgi.testing.OSGiServiceReference;
-import org.jboss.osgi.testing.OSGiTestHelper;
-import org.osgi.framework.BundleException;
-
-/**
- * A remote implementation of the {@link OSGiRuntime}
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 25-Sep-2008
- */
-public class RemoteRuntime extends OSGiRuntimeImpl
-{
- private MBeanServerConnection mbeanServer;
- private ManagedFrameworkMBean managedFramework;
-
- public RemoteRuntime(OSGiTestHelper helper)
- {
- super(helper);
- }
-
- public OSGiBundle installBundle(String location) throws BundleException
- {
- try
- {
- // Get the bundle info from the location
- URL bundleURL = getTestHelper().getTestArchiveURL(location);
- BundleInfo info = BundleInfo.createBundleInfo(bundleURL);
-
- // Create the deployment from the info
- DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
- Deployment dep = deployer.createDeployment(info);
- dep.setAutoStart(false);
-
- // Deploy the deployemnt through the DeployerService
- deployer.deploy(new Deployment[] { dep });
-
- String symbolicName = info.getSymbolicName();
- String version = info.getVersion().toString();
-
- // The remote framework uses a BundleTracker that works of an asynchronous
- // event to register the installed bundle. It is not available immediately.
- int timeout = 50;
- ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
- while (bundleMBean == null && 0 < timeout--)
- {
- Thread.sleep(200);
- bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
- }
- if (bundleMBean == null)
- throw new IllegalStateException("Cannot find installed bundle: " + symbolicName + "-" + version);
-
- RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
- return registerBundle(location, bundle);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (BundleException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- throw new BundleException("Cannot install: " + location, ex);
- }
- }
-
- public void deploy(String location) throws Exception
- {
- URL archiveURL = getTestHelper().getTestArchiveURL(location);
- ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(oname);
- deployer.deploy(archiveURL);
- }
-
- public void undeploy(String location) throws Exception
- {
- URL archiveURL = getTestHelper().getTestArchiveURL(location);
- ObjectName oname = getDeployerServiceName(archiveURL);
- DeployerServiceClient deployer = new DeployerServiceClient(oname);
- deployer.undeploy(archiveURL);
- }
-
- public OSGiBundle[] getBundles()
- {
- try
- {
- Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
- Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
- for (ManagedBundleMBean remoteBundle : remoteBundles)
- bundles.add(new RemoteBundle(this, remoteBundle, null));
-
- OSGiBundle[] bundleArr = new OSGiBundle[bundles.size()];
- bundles.toArray(bundleArr);
- return bundleArr;
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot obtain remote bundles", ex);
- }
- }
-
- public OSGiBundle getBundle(long bundleId)
- {
- ManagedBundleMBean bundle = getRemoteFramework().getBundle(bundleId);
- return bundle != null ? new RemoteBundle(this, bundle, null) : null;
- }
-
- public OSGiServiceReference getServiceReference(String clazz)
- {
- ManagedServiceReference manref = getRemoteFramework().getServiceReference(clazz);
- return manref != null ? new RemoteServiceReference(manref) : null;
- }
-
- public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
- {
- OSGiServiceReference[] srefs = null;
-
- ManagedServiceReference[] manrefs = getRemoteFramework().getServiceReferences(clazz, filter);
- if (manrefs != null)
- {
- srefs = new OSGiServiceReference[manrefs.length];
- for (int i = 0; i < manrefs.length; i++)
- srefs[i] = new RemoteServiceReference(manrefs[i]);
- }
-
- return srefs;
- }
-
- public MBeanServerConnection getMBeanServer()
- {
- if (mbeanServer == null)
- {
- try
- {
- InitialContext iniCtx = getInitialContext();
- mbeanServer = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- }
- catch (NamingException ex)
- {
- throw new IllegalStateException("Cannot obtain MBeanServerConnection", ex);
- }
- }
- return mbeanServer;
- }
-
- public OSGiPackageAdmin getPackageAdmin()
- {
- return new RemotePackageAdmin(this);
- }
-
- @Override
- public void shutdown()
- {
- super.shutdown();
- getPackageAdmin().refreshPackages(null);
- }
-
- private RemoteFramework getRemoteFramework()
- {
- try
- {
- if (managedFramework == null)
- managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
-
- return new RemoteFramework()
- {
- public ManagedBundleMBean getBundle(String name, String version)
- {
- ManagedBundleMBean bundleMBean = null;
- ObjectName oname = managedFramework.getBundle(name, version);
- if (oname != null)
- {
- try
- {
- bundleMBean = MBeanProxy.get(ManagedBundleMBean.class, oname, getMBeanServer());
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return bundleMBean;
- }
-
- public ManagedBundleMBean getBundle(long bundleId)
- {
- ManagedBundleMBean bundleMBean = null;
- ObjectName oname = managedFramework.getBundle(bundleId);
- if (oname != null)
- {
- try
- {
- bundleMBean = MBeanProxy.get(ManagedBundleMBean.class, oname, getMBeanServer());
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return bundleMBean;
- }
-
- public Set<ManagedBundleMBean> getBundles()
- {
- Set<ManagedBundleMBean> remBundles = new HashSet<ManagedBundleMBean>();
- for (ObjectName bundleOName : managedFramework.getBundles())
- {
- try
- {
- ManagedBundleMBean remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
- remBundles.add(remBundle);
- }
- catch (MBeanProxyException ex)
- {
- throw new RemoteFrameworkException(ex);
- }
- }
- return remBundles;
- }
-
- public ManagedServiceReference getServiceReference(String clazz)
- {
- return managedFramework.getServiceReference(clazz);
- }
-
- public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
- {
- return managedFramework.getServiceReferences(clazz, filter);
- }
- };
- }
-
- public boolean isRemoteRuntime()
- {
- return true;
- }
-
- /**
- * Return ObjectName of the DeployerService MBean if hte archive is a bundle
- * otherwise if returns the ObjectName of the MainDeployer
- */
- private ObjectName getDeployerServiceName(URL archiveURL) throws MalformedObjectNameException
- {
- ObjectName oname;
- try
- {
- BundleInfo.createBundleInfo(archiveURL);
- oname = DeployerService.MBEAN_DEPLOYER_SERVICE;
- }
- catch (Exception e)
- {
- oname = new ObjectName("jboss.system:service=MainDeployer");
- }
- return oname;
- }
-}
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java (from rev 96949, projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java)
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java (rev 0)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/src/main/java/org/jboss/osgi/testing/internal/RemoteRuntime.java 2009-11-26 07:32:06 UTC (rev 97013)
@@ -0,0 +1,302 @@
+/*
+ * 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.testing.internal;
+
+// $Id$
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.osgi.deployment.deployer.DeployerService;
+import org.jboss.osgi.deployment.deployer.Deployment;
+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.management.ManagedServiceReference;
+import org.jboss.osgi.spi.util.BundleInfo;
+import org.jboss.osgi.testing.OSGiBundle;
+import org.jboss.osgi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiServiceReference;
+import org.jboss.osgi.testing.OSGiTestHelper;
+import org.osgi.framework.BundleException;
+
+/**
+ * A remote implementation of the {@link OSGiRuntime}
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class RemoteRuntime extends OSGiRuntimeImpl
+{
+ private MBeanServerConnection mbeanServer;
+ private ManagedFrameworkMBean managedFramework;
+
+ public RemoteRuntime(OSGiTestHelper helper)
+ {
+ super(helper);
+ }
+
+ public OSGiBundle installBundle(String location) throws BundleException
+ {
+ try
+ {
+ // Get the bundle info from the location
+ URL bundleURL = getTestHelper().getTestArchiveURL(location);
+ BundleInfo info = BundleInfo.createBundleInfo(bundleURL);
+
+ // Create the deployment from the info
+ DeployerServiceClient deployer = new DeployerServiceClient(DeployerService.MBEAN_DEPLOYER_SERVICE);
+ Deployment dep = deployer.createDeployment(info);
+ dep.setAutoStart(false);
+
+ // Deploy the deployemnt through the DeployerService
+ deployer.deploy(new Deployment[] { dep });
+
+ String symbolicName = info.getSymbolicName();
+ String version = info.getVersion().toString();
+
+ // The remote framework uses a BundleTracker that works of an asynchronous
+ // event to register the installed bundle. It is not available immediately.
+ int timeout = 50;
+ ManagedBundleMBean bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
+ while (bundleMBean == null && 0 < timeout--)
+ {
+ Thread.sleep(200);
+ bundleMBean = getRemoteFramework().getBundle(symbolicName, version);
+ }
+ if (bundleMBean == null)
+ throw new IllegalStateException("Cannot find installed bundle: " + symbolicName + "-" + version);
+
+ RemoteBundle bundle = new RemoteBundle(this, bundleMBean, location);
+ return registerBundle(location, bundle);
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (BundleException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new BundleException("Cannot install: " + location, ex);
+ }
+ }
+
+ public void deploy(String location) throws Exception
+ {
+ URL archiveURL = getTestHelper().getTestArchiveURL(location);
+ ObjectName oname = getDeployerServiceName(archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ deployer.deploy(archiveURL);
+ }
+
+ public void undeploy(String location) throws Exception
+ {
+ URL archiveURL = getTestHelper().getTestArchiveURL(location);
+ ObjectName oname = getDeployerServiceName(archiveURL);
+ DeployerServiceClient deployer = new DeployerServiceClient(oname);
+ deployer.undeploy(archiveURL);
+ }
+
+ public OSGiBundle[] getBundles()
+ {
+ try
+ {
+ Set<ManagedBundleMBean> remoteBundles = getRemoteFramework().getBundles();
+ Set<OSGiBundle> bundles = new HashSet<OSGiBundle>();
+ for (ManagedBundleMBean remoteBundle : remoteBundles)
+ bundles.add(new RemoteBundle(this, remoteBundle, null));
+
+ OSGiBundle[] bundleArr = new OSGiBundle[bundles.size()];
+ bundles.toArray(bundleArr);
+ return bundleArr;
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot obtain remote bundles", ex);
+ }
+ }
+
+ public OSGiBundle getBundle(long bundleId)
+ {
+ ManagedBundleMBean bundle = getRemoteFramework().getBundle(bundleId);
+ return bundle != null ? new RemoteBundle(this, bundle, null) : null;
+ }
+
+ public OSGiServiceReference getServiceReference(String clazz)
+ {
+ ManagedServiceReference manref = getRemoteFramework().getServiceReference(clazz);
+ return manref != null ? new RemoteServiceReference(manref) : null;
+ }
+
+ public OSGiServiceReference[] getServiceReferences(String clazz, String filter)
+ {
+ OSGiServiceReference[] srefs = null;
+
+ ManagedServiceReference[] manrefs = getRemoteFramework().getServiceReferences(clazz, filter);
+ if (manrefs != null)
+ {
+ srefs = new OSGiServiceReference[manrefs.length];
+ for (int i = 0; i < manrefs.length; i++)
+ srefs[i] = new RemoteServiceReference(manrefs[i]);
+ }
+
+ return srefs;
+ }
+
+ public MBeanServerConnection getMBeanServer()
+ {
+ if (mbeanServer == null)
+ {
+ try
+ {
+ InitialContext iniCtx = getInitialContext();
+ mbeanServer = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new IllegalStateException("Cannot obtain MBeanServerConnection", ex);
+ }
+ }
+ return mbeanServer;
+ }
+
+ public OSGiPackageAdmin getPackageAdmin()
+ {
+ return new RemotePackageAdmin(this);
+ }
+
+ private RemoteFramework getRemoteFramework()
+ {
+ try
+ {
+ if (managedFramework == null)
+ managedFramework = MBeanProxy.get(ManagedFrameworkMBean.class, ManagedFrameworkMBean.MBEAN_MANAGED_FRAMEWORK, getMBeanServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+
+ return new RemoteFramework()
+ {
+ public ManagedBundleMBean getBundle(String name, String version)
+ {
+ ManagedBundleMBean bundleMBean = null;
+ ObjectName oname = managedFramework.getBundle(name, version);
+ if (oname != null)
+ {
+ try
+ {
+ bundleMBean = MBeanProxy.get(ManagedBundleMBean.class, oname, getMBeanServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+ return bundleMBean;
+ }
+
+ public ManagedBundleMBean getBundle(long bundleId)
+ {
+ ManagedBundleMBean bundleMBean = null;
+ ObjectName oname = managedFramework.getBundle(bundleId);
+ if (oname != null)
+ {
+ try
+ {
+ bundleMBean = MBeanProxy.get(ManagedBundleMBean.class, oname, getMBeanServer());
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+ return bundleMBean;
+ }
+
+ public Set<ManagedBundleMBean> getBundles()
+ {
+ Set<ManagedBundleMBean> remBundles = new HashSet<ManagedBundleMBean>();
+ for (ObjectName bundleOName : managedFramework.getBundles())
+ {
+ try
+ {
+ ManagedBundleMBean remBundle = MBeanProxy.get(ManagedBundleMBean.class, bundleOName, getMBeanServer());
+ remBundles.add(remBundle);
+ }
+ catch (MBeanProxyException ex)
+ {
+ throw new RemoteFrameworkException(ex);
+ }
+ }
+ return remBundles;
+ }
+
+ public ManagedServiceReference getServiceReference(String clazz)
+ {
+ return managedFramework.getServiceReference(clazz);
+ }
+
+ public ManagedServiceReference[] getServiceReferences(String clazz, String filter)
+ {
+ return managedFramework.getServiceReferences(clazz, filter);
+ }
+ };
+ }
+
+ public boolean isRemoteRuntime()
+ {
+ return true;
+ }
+
+ /**
+ * Return ObjectName of the DeployerService MBean if hte archive is a bundle
+ * otherwise if returns the ObjectName of the MainDeployer
+ */
+ private ObjectName getDeployerServiceName(URL archiveURL) throws MalformedObjectNameException
+ {
+ ObjectName oname;
+ try
+ {
+ BundleInfo.createBundleInfo(archiveURL);
+ oname = DeployerService.MBEAN_DEPLOYER_SERVICE;
+ }
+ catch (Exception e)
+ {
+ oname = new ObjectName("jboss.system:service=MainDeployer");
+ }
+ return oname;
+ }
+}
Copied: projects/jboss-osgi/projects/bundles/husky/trunk/src/test (from rev 96948, projects/jboss-osgi/projects/bundles/husky/trunk/testsuite/src/test)
14 years, 6 months
JBoss-OSGI SVN: r97001 - in projects/jboss-osgi/projects/bundles: jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal and 2 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 19:57:15 -0500 (Wed, 25 Nov 2009)
New Revision: 97001
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java
Log:
[JBOSGI-212] Cannot refresh Microcontainer service
Does not resolve in equinox
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 00:55:40 UTC (rev 97000)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-26 00:57:15 UTC (rev 97001)
@@ -21,7 +21,7 @@
<artifactId>jboss-osgi-xml-binding</artifactId>
<packaging>bundle</packaging>
- <version>2.0-SNAPSHOT</version>
+ <version>2.0.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -35,7 +35,7 @@
<version.jboss.xb>2.0.1.GA</version.jboss.xb>
<version.javassist>3.9.0.GA</version.javassist>
<version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
- <version.jboss.reflect>2.0.0.GA</version.jboss.reflect>
+ <version.jboss.reflect>2.0.2.GA</version.jboss.reflect>
<version.osgi>4.2.0</version.osgi>
</properties>
@@ -47,6 +47,10 @@
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jbossxb</artifactId>
<version>${version.jboss.xb}</version>
@@ -84,7 +88,7 @@
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Embed-Transitive>true</Embed-Transitive>
<Export-Package>
- org.jboss.osgi.jbossxb;version=${version}
+ org.jboss.osgi.jbossxb;version=2.0.1
</Export-Package>
<Import-Package>
<!-- system -->
@@ -92,6 +96,7 @@
javax.xml.bind.*,
javax.xml.namespace,
javax.xml.parsers,
+ org.slf4j,
org.w3c.dom*,
org.xml.sax*,
@@ -100,7 +105,7 @@
org.apache.xerces.*,
org.jboss.logging,
org.jboss.osgi.common.log;version=1.0,
- org.jboss.osgi.jaxb;version=1.0,
+ org.jboss.osgi.jaxb;version=2.0,
org.jboss.osgi.spi.capability;version=1.0,
org.jboss.osgi.spi.service;version=1.0,
org.jboss.util*,
@@ -117,13 +122,13 @@
jboss-reflect;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.beans.info.*;version=${version.jboss.reflect},
- org.jboss.config.*;version=${version.jboss.reflect},
- org.jboss.classadapter.*;version=${version.jboss.reflect},
- org.jboss.joinpoint.*;version=${version.jboss.reflect},
- org.jboss.reflect*;version=${version.jboss.reflect},
- org.jboss.xb.*;version=${version.jboss.xb},
- javassist*;version=${version.javassist},
+ org.jboss.beans.info.*;version=2.0.2,
+ org.jboss.config.*;version=2.0.2,
+ org.jboss.classadapter.*;version=2.0.2,
+ org.jboss.joinpoint.*;version=2.0.2,
+ org.jboss.reflect*;version=2.0.2,
+ org.jboss.xb.*;version=2.0.1,
+ javassist*;version=3.9.0,
</_exportcontents>
</instructions>
</configuration>
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-11-26 00:55:40 UTC (rev 97000)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/src/main/java/org/jboss/osgi/jbossxb/internal/XMLBindingActivator.java 2009-11-26 00:57:15 UTC (rev 97001)
@@ -25,7 +25,6 @@
import javax.xml.parsers.SAXParserFactory;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.jboss.osgi.jbossxb.XMLBindingService;
import org.jboss.osgi.xml.XMLParserCapability;
import org.jboss.xb.binding.JBossXBException;
@@ -33,8 +32,9 @@
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A {@link BundleActivator} that initializes the JBossXB bundle
@@ -44,12 +44,11 @@
*/
public class XMLBindingActivator implements BundleActivator
{
- private LogService log;
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(XMLBindingActivator.class);
public void start(BundleContext context) throws Exception
{
- log = new LogServiceTracker(context);
-
ServiceTracker saxTracker = new ServiceTracker(context, SAXParserFactory.class.getName(), null)
{
@Override
@@ -62,7 +61,7 @@
SAXParserFactory saxFactory = (SAXParserFactory)super.addingService(reference);
if (hasXMLBindingService == false && hasJBossSAXParser == true)
{
- log.log(LogService.LOG_DEBUG, "JBossXB SAXParserFactory: " + saxFactory);
+ log.debug("JBossXB SAXParserFactory: " + saxFactory);
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
@@ -82,7 +81,6 @@
// Register the XMLBindingService
XMLBindingService service = new XMLBindingService(){};
context.registerService(XMLBindingService.class.getName(), service, null);
- log.log(LogService.LOG_INFO, "XMLBindingService registered");
}
finally
{
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-26 00:55:40 UTC (rev 97000)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-26 00:57:15 UTC (rev 97001)
@@ -115,7 +115,7 @@
<Bundle-Activator>org.jboss.osgi.microcontainer.internal.MicrocontainerServiceActivator</Bundle-Activator>
<Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
<Export-Package>
- org.jboss.osgi.microcontainer;version=${version}
+ org.jboss.osgi.microcontainer;version=2.0.9
</Export-Package>
<Private-Package>
org.jboss.osgi.microcontainer.internal
@@ -135,7 +135,7 @@
<!-- import -->
javassist*,
- org.jboss.beans.*,
+ org.jboss.beans.info.*,
org.jboss.classadapter.spi,
org.jboss.config.*,
org.jboss.deployers.*,
@@ -182,10 +182,9 @@
jboss-kernel;inline=false,
</Embed-Dependency>
<_exportcontents>
- org.jboss.beans*;version=${version.jboss.microcontainer},
- org.jboss.kernel.spi*;version=${version.jboss.microcontainer},
- org.jboss.dependency*;version=${version.jboss.microcontainer},
- org.jboss.deployers*;version=${version.jboss.deployers},
+ org.jboss.kernel.spi*;version=2.0.9,
+ org.jboss.dependency*;version=2.0.9,
+ org.jboss.deployers*;version=2.0.5,
</_exportcontents>
</instructions>
</configuration>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java 2009-11-26 00:55:40 UTC (rev 97000)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/src/main/java/org/jboss/osgi/microcontainer/internal/EmbeddedKernelBootstrap.java 2009-11-26 00:57:15 UTC (rev 97001)
@@ -26,9 +26,9 @@
import java.net.URL;
import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
-import org.jboss.osgi.common.log.LogServiceTracker;
import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Boostrap the Microcontainer
@@ -38,12 +38,13 @@
*/
public class EmbeddedKernelBootstrap extends BasicBootstrap
{
- private LogService log;
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(EmbeddedKernelBootstrap.class);
+
private EmbeddedXMLDeployer deployer;
public EmbeddedKernelBootstrap(BundleContext context)
{
- this.log = new LogServiceTracker(context);
// Get or bootstrap the kernel
if (kernel == null)
@@ -51,7 +52,7 @@
try
{
super.bootstrap();
- log.log(LogService.LOG_DEBUG, "bootstrap kernel: " + kernel);
+ log.debug("bootstrap kernel: " + kernel);
}
catch (Throwable e)
{
@@ -66,7 +67,7 @@
*/
public void deploy(URL url)
{
- log.log(LogService.LOG_DEBUG, "deploy: " + url);
+ log.debug("deploy: " + url);
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
try
{
@@ -89,7 +90,7 @@
*/
public void undeploy(URL url)
{
- log.log(LogService.LOG_DEBUG, "undeploy: " + url);
+ log.debug("undeploy: " + url);
try
{
deployer.undeploy(url);
14 years, 6 months
JBoss-OSGI SVN: r97000 - projects/jboss-osgi/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 19:55:40 -0500 (Wed, 25 Nov 2009)
New Revision: 97000
Modified:
projects/jboss-osgi/trunk/pom.xml
Log:
Use jbossxb snapshot
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-11-26 00:53:44 UTC (rev 96999)
+++ projects/jboss-osgi/trunk/pom.xml 2009-11-26 00:55:40 UTC (rev 97000)
@@ -69,7 +69,7 @@
<version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.webapp>0.7.2-SNAPSHOT</version.jboss.osgi.webapp>
<version.jboss.osgi.webconsole>1.0.2</version.jboss.osgi.webconsole>
- <version.jboss.osgi.xml.binding>2.0.1.SP1</version.jboss.osgi.xml.binding>
+ <version.jboss.osgi.xml.binding>2.0.1-SNAPSHOT</version.jboss.osgi.xml.binding>
<version.ops4j.pax.web>0.7.2-SNAPSHOT</version.ops4j.pax.web>
<version.osgi>4.2.0</version.osgi>
14 years, 6 months
JBoss-OSGI SVN: r96998 - projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 18:45:24 -0500 (Wed, 25 Nov 2009)
New Revision: 96998
Modified:
projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
Log:
Fix parent
Modified: projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-25 23:26:11 UTC (rev 96997)
+++ projects/jboss-osgi/projects/bundles/jboss-xml-binding/trunk/pom.xml 2009-11-25 23:45:24 UTC (rev 96998)
@@ -27,7 +27,7 @@
<parent>
<groupId>org.jboss.osgi</groupId>
<artifactId>jboss-osgi-parent</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.0.4</version>
</parent>
<!-- Properties -->
@@ -36,7 +36,7 @@
<version.javassist>3.9.0.GA</version.javassist>
<version.jboss.osgi.jaxb>2.1.10.SP2</version.jboss.osgi.jaxb>
<version.jboss.reflect>2.0.0.GA</version.jboss.reflect>
- <version.osgi>r4v42</version.osgi>
+ <version.osgi>4.2.0</version.osgi>
</properties>
<dependencies>
14 years, 6 months
JBoss-OSGI SVN: r96997 - in projects/jboss-osgi/projects: bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing and 3 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 18:26:11 -0500 (Wed, 25 Nov 2009)
New Revision: 96997
Modified:
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/OSGiBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
Log:
Add bundle.update() to runtime
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/OSGiBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/OSGiBundle.java 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/OSGiBundle.java 2009-11-25 23:26:11 UTC (rev 96997)
@@ -76,6 +76,11 @@
public abstract void stop() throws BundleException;
/**
+ * Update this bundle.
+ */
+ public abstract void update() throws BundleException;
+
+ /**
* Uninstalls this bundle.
*/
public abstract void uninstall() throws BundleException;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/EmbeddedBundle.java 2009-11-25 23:26:11 UTC (rev 96997)
@@ -104,6 +104,12 @@
}
@Override
+ public void update() throws BundleException
+ {
+ bundle.update();
+ }
+
+ @Override
public void uninstall() throws BundleException
{
bundle.uninstall();
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/harness/src/main/java/org/jboss/osgi/testing/internal/RemoteBundle.java 2009-11-25 23:26:11 UTC (rev 96997)
@@ -120,11 +120,19 @@
}
@Override
+ public void update() throws BundleException
+ {
+ assertNotUninstalled();
+ bundle.update();
+ }
+
+ @Override
public void uninstall() throws BundleException
{
assertNotUninstalled();
try
{
+ // Make sure we go through the DeployerService
runtime.undeploy(location);
runtime.unregisterBundle(this);
uninstalled = true;
Modified: projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/bundles/husky/trunk/pom.xml 2009-11-25 23:26:11 UTC (rev 96997)
@@ -41,7 +41,7 @@
<!-- Properties -->
<properties>
<version.jboss.osgi.runtime.felix>2.0.0</version.jboss.osgi.runtime.felix>
- <version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
+ <version.jboss.osgi.spi>1.0.3-SNAPSHOT</version.jboss.osgi.spi>
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
<version.osgi>4.2.0</version.osgi>
</properties>
Modified: projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/bundles/microcontainer/trunk/pom.xml 2009-11-25 23:26:11 UTC (rev 96997)
@@ -41,7 +41,7 @@
<properties>
<version.jboss.deployers>2.0.5.SP1</version.jboss.deployers>
<version.jboss.microcontainer>2.0.9.GA</version.jboss.microcontainer>
- <version.jboss.osgi.runtime.deployers>1.0.2</version.jboss.osgi.runtime.deployers>
+ <version.jboss.osgi.runtime.deployers>1.0.3</version.jboss.osgi.runtime.deployers>
<version.jboss.osgi.deployment>1.0.0</version.jboss.osgi.deployment>
<version.jboss.osgi.jmx>1.0.2</version.jboss.osgi.jmx>
<version.jboss.osgi.spi>1.0.3</version.jboss.osgi.spi>
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundle.java 2009-11-25 23:26:11 UTC (rev 96997)
@@ -119,4 +119,9 @@
{
bundle.stop();
}
+
+ public void update() throws BundleException
+ {
+ bundle.update();
+ }
}
\ No newline at end of file
Modified: projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java
===================================================================
--- projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-11-25 23:25:11 UTC (rev 96996)
+++ projects/jboss-osgi/projects/spi/trunk/src/main/java/org/jboss/osgi/spi/management/ManagedBundleMBean.java 2009-11-25 23:26:11 UTC (rev 96997)
@@ -82,4 +82,9 @@
* Stops this bundle with no options.
*/
void stop() throws BundleException;
+
+ /**
+ * Update this bundle.
+ */
+ void update() throws BundleException;
}
\ No newline at end of file
14 years, 6 months
JBoss-OSGI SVN: r96996 - in projects/jboss-osgi/trunk/testsuite/functional: src/test/java/org/jboss/test/osgi/jbosgi212 and 6 other directories.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 18:25:11 -0500 (Wed, 25 Nov 2009)
New Revision: 96996
Added:
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/OSGI212Activator.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeBean.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeService.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/META-INF/
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/META-INF/jbosgi212-jboss-beans.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/jbosgi212-bundle.bnd
Modified:
projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/OSGI212TestCase.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/jbosgi99/OSGI99TestCase.java
Log:
[JBOSGI-212] Cannot refresh Microcontainer service
Modified: projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-11-25 20:20:02 UTC (rev 96995)
+++ projects/jboss-osgi/trunk/testsuite/functional/scripts/antrun-test-jars.xml 2009-11-25 23:25:11 UTC (rev 96996)
@@ -130,6 +130,9 @@
<!-- jbosgi161 -->
<bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi161-bundle.jar" files="${tests.resources.dir}/jbosgi161/jbosgi161-bundle.bnd" />
+ <!-- jbosgi212 -->
+ <bnd classpath="${tests.classes.dir}" output="${tests.output.dir}/test-libs/jbosgi212-bundle.jar" files="${tests.resources.dir}/jbosgi212/jbosgi212-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" />
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/OSGI212TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/OSGI212TestCase.java 2009-11-25 20:20:02 UTC (rev 96995)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/OSGI212TestCase.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -23,15 +23,17 @@
//$Id:$
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.jboss.osgi.microcontainer.MicrocontainerCapability;
import org.jboss.osgi.spi.service.MicrocontainerService;
-import org.jboss.osgi.testing.OSGiPackageAdmin;
+import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
import org.jboss.osgi.testing.OSGiServiceReference;
import org.jboss.osgi.testing.OSGiTest;
import org.junit.Test;
+import org.osgi.framework.Bundle;
/**
* [JBOSGI-212] Cannot refresh Microcontainer service
@@ -46,18 +48,19 @@
@Test
public void testLogging() throws Exception
{
- OSGiRuntime runtime = getDefaultRuntime();
+ OSGiRuntime runtime = getEmbeddedRuntime();
try
{
runtime.addCapability(new MicrocontainerCapability());
+ OSGiBundle bundle = runtime.getBundle("jboss-osgi-microcontainer", null);
+ assertNotNull("MicrocontainerService available", bundle);
+ assertEquals("Bundle ACTIVE", Bundle.ACTIVE, bundle.getState());
+
+ // Update the MC bundle
+ // bundle.update();
+
OSGiServiceReference sref = runtime.getServiceReference(MicrocontainerService.class.getName());
- assertNotNull("MicrocontainerService available", sref);
-
- OSGiPackageAdmin packageAdmin = runtime.getPackageAdmin();
- packageAdmin.refreshPackages(null);
-
- sref = runtime.getServiceReference(MicrocontainerService.class.getName());
assertNotNull("MicrocontainerService still available", sref);
}
finally
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/OSGI212Activator.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/OSGI212Activator.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/OSGI212Activator.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -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.jbosgi212.bundle;
+
+//$Id: SomeServiceActivator.java 89664 2009-06-02 12:55:10Z thomas.diesler(a)jboss.com $
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * A Service Activator
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class OSGI212Activator implements BundleActivator
+{
+ public void start(BundleContext context)
+ {
+ context.registerService(SomeService.class.getName(), new SomeService(context), null);
+ }
+
+ public void stop(BundleContext context)
+ {
+ }
+}
\ No newline at end of file
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeBean.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeBean.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeBean.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -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.jbosgi212.bundle;
+
+//$Id: SomeBean.java 93025 2009-08-31 13:10:16Z thomas.diesler(a)jboss.com $
+
+public class SomeBean
+{
+}
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeService.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeService.java (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi212/bundle/SomeService.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -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.jbosgi212.bundle;
+
+//$Id: SomeService.java 93025 2009-08-31 13:10:16Z thomas.diesler(a)jboss.com $
+
+import org.jboss.osgi.spi.service.MicrocontainerService;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A service that accesses the MicrocontainerService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Apr-2009
+ */
+public class SomeService
+{
+ // Provide logging
+ private static Logger log = LoggerFactory.getLogger(SomeService.class);
+
+ public SomeService(BundleContext context)
+ {
+ ServiceReference sref = context.getServiceReference(MicrocontainerService.class.getName());
+ MicrocontainerService service = (MicrocontainerService)context.getService(sref);
+
+ SomeBean bean = (SomeBean)service.getRegisteredBean("SomeBean");
+ if (bean == null)
+ throw new IllegalStateException("No MC bean");
+
+ log.info("MC bean available");
+ }
+}
Modified: 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 2009-11-25 20:20:02 UTC (rev 96995)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi41/bundleA/ServiceB.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -58,7 +58,7 @@
tracker.open();
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "rawtypes" })
public void updateConfig(String key, String value)
{
if (configAdmin != null)
@@ -84,7 +84,7 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
public void updated(Dictionary props) throws ConfigurationException
{
}
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-11-25 20:20:02 UTC (rev 96995)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbosgi99/OSGI99TestCase.java 2009-11-25 23:25:11 UTC (rev 96996)
@@ -29,6 +29,7 @@
import org.jboss.osgi.spi.util.ConstantsHelper;
import org.jboss.osgi.testing.OSGiBundle;
import org.jboss.osgi.testing.OSGiRuntime;
+import org.jboss.osgi.testing.OSGiTest;
import org.jboss.osgi.testing.OSGiTestHelper;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -46,7 +47,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2009
*/
-public class OSGI99TestCase
+public class OSGI99TestCase extends OSGiTest
{
// Provide logging
private static Logger log = LoggerFactory.getLogger(OSGI99TestCase.class);
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/META-INF/jbosgi212-jboss-beans.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/META-INF/jbosgi212-jboss-beans.xml (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/META-INF/jbosgi212-jboss-beans.xml 2009-11-25 23:25:11 UTC (rev 96996)
@@ -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="SomeBean" class="org.jboss.test.osgi.jbosgi212.bundle.SomeBean"/>
+
+</deployment>
+
Added: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/jbosgi212-bundle.bnd
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/jbosgi212-bundle.bnd (rev 0)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/jbosgi212/jbosgi212-bundle.bnd 2009-11-25 23:25:11 UTC (rev 96996)
@@ -0,0 +1,8 @@
+# bnd build -classpath target/test-classes -output target/test-libs/jbosgi212-bundle.jar src/test/resources/jbosgi212/jbosgi212-bundle.bnd
+
+Bundle-SymbolicName: jbosgi212-bundle
+Bundle-Activator: org.jboss.test.osgi.jbosgi212.bundle.OSGI212Activator
+Export-Package: org.jboss.test.osgi.jbosgi212.bundle
+Import-Package: org.jboss.osgi.spi.service, org.osgi.framework, org.slf4j
+Include-Resource: META-INF/jbosgi212-jboss-beans.xml=META-INF/jbosgi212-jboss-beans.xml
+-removeheaders: Include-Resource
14 years, 6 months
JBoss-OSGI SVN: r96995 - in projects/jboss-osgi/trunk/testsuite: functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36 and 1 other directory.
by jboss-osgi-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2009-11-25 15:20:02 -0500 (Wed, 25 Nov 2009)
New Revision: 96995
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
Log:
Used fixed MicrocontainerCapability
Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-11-25 20:14:14 UTC (rev 96994)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/java/org/jboss/test/osgi/example/microcontainer/MicrocontainerTestCase.java 2009-11-25 20:20:02 UTC (rev 96995)
@@ -26,9 +26,6 @@
import static org.jboss.test.osgi.example.microcontainer.bundleA.SomeBeanMBean.MBEAN_NAME;
import static org.junit.Assert.assertEquals;
-import org.jboss.osgi.jbossxb.XMLBindingCapability;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.microcontainer.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.testing.OSGiBundle;
@@ -53,9 +50,6 @@
public static void setUpClass() throws Exception
{
runtime = new OSGiTestHelper().getDefaultRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
- runtime.addCapability(new XMLBindingCapability());
runtime.addCapability(new MicrocontainerCapability());
OSGiBundle bundleA = runtime.installBundle("example-mcservice-bundleA.jar");
Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-11-25 20:14:14 UTC (rev 96994)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/java/org/jboss/test/osgi/jbossas/jbosgi36/OSGI36TestCase.java 2009-11-25 20:20:02 UTC (rev 96995)
@@ -26,8 +26,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
-import org.jboss.osgi.jmx.JMXCapability;
-import org.jboss.osgi.jndi.JNDICapability;
import org.jboss.osgi.microcontainer.MicrocontainerCapability;
import org.jboss.osgi.spi.management.MBeanProxy;
import org.jboss.osgi.spi.management.MBeanProxyException;
@@ -55,8 +53,6 @@
public static void setUpClass() throws Exception
{
runtime = (RemoteRuntime)new OSGiTestHelper().getRemoteRuntime();
- runtime.addCapability(new JNDICapability());
- runtime.addCapability(new JMXCapability());
runtime.addCapability(new MicrocontainerCapability());
runtime.installBundle("jbosgi36-bundle.jar");
14 years, 6 months