FELIX-3093 Upgrade to TinyBundles 1.1.0 and adapt to modified TinyBundle API
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1162677 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/pom.xml b/scr/pom.xml
index f31ecd6..31d3bf5 100644
--- a/scr/pom.xml
+++ b/scr/pom.xml
@@ -139,7 +139,7 @@
<dependency>
<groupId>org.ops4j.pax.swissbox</groupId>
<artifactId>pax-swissbox-tinybundles</artifactId>
- <version>1.0.0</version>
+ <version>1.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
index 6878775..edcd72e 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/ComponentTestBase.java
@@ -44,8 +44,6 @@
import org.ops4j.pax.exam.OptionUtils;
import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.options.MavenArtifactUrlReference;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -108,7 +106,7 @@
final Option[] base = options(
provision(
CoreOptions.bundle( bundleFile.toURI().toString() ),
- mavenBundle( "org.ops4j.pax.swissbox", "pax-swissbox-tinybundles", "1.0.0" ),
+ mavenBundle( "org.ops4j.pax.swissbox", "pax-swissbox-tinybundles", "1.1.0" ),
mavenBundle( "org.apache.felix", "org.apache.felix.configadmin", "1.0.10" )
),
systemProperty( "ds.factory.enabled" ).value( "true" )
@@ -322,7 +320,7 @@
protected Bundle installBundle( final String descriptorFile ) throws BundleException
{
final InputStream bundleStream = new MyTinyBundle()
- .addResource( "OSGI-INF/components.xml", getClass().getResource( descriptorFile ) )
+ .add( "OSGI-INF/components.xml", getClass().getResource( descriptorFile ) )
.prepare(
withBnd()
.set( Constants.BUNDLE_SYMBOLICNAME, "simplecomponent" )
@@ -331,7 +329,7 @@
"org.apache.felix.scr.integration.components,org.apache.felix.scr.integration.components.activatesignature" )
.set( "Service-Component", "OSGI-INF/components.xml" )
)
- .build( TinyBundles.asStream() );
+ .build();
try
{
diff --git a/scr/src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java b/scr/src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java
index caf5e3f..8ee6e57 100644
--- a/scr/src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java
+++ b/scr/src/test/java/org/apache/felix/scr/integration/components/MyTinyBundle.java
@@ -18,6 +18,7 @@
*/
package org.apache.felix.scr.integration.components;
+import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -31,19 +32,27 @@
private Map<String, URL> m_resources = new HashMap<String, URL>();
@SuppressWarnings("unchecked")
- public TinyBundle addClass( Class clazz )
+ public TinyBundle add( Class clazz )
{
String name = clazz.getName().replaceAll( "\\.", "/" ) + ".class";
- addResource( name, clazz.getResource( "/" + name ) );
+ add( name, clazz.getResource( "/" + name ) );
return this;
}
- public TinyBundle addResource( String name, URL url )
+ public TinyBundle add( String name, URL url )
{
m_resources.put( name, url );
return this;
}
+
+ public TinyBundle add( String name, InputStream input )
+ {
+ // we don't currently support adding InputStream resources...
+ throw new UnsupportedOperationException();
+ }
+
+
public BuildableBundle prepare( BuildableBundle builder )
{
return builder.setResources( m_resources );
@@ -54,4 +63,5 @@
return new RawBuilder().setResources( m_resources );
}
+
}
\ No newline at end of file