Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 96230 invoked from network); 1 May 2010 10:22:52 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 May 2010 10:22:52 -0000 Received: (qmail 67238 invoked by uid 500); 1 May 2010 10:22:52 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 67182 invoked by uid 500); 1 May 2010 10:22:52 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 67071 invoked by uid 99); 1 May 2010 10:22:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 May 2010 10:22:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 May 2010 10:22:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E14E723889FA; Sat, 1 May 2010 10:21:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r939968 [3/3] - in /felix/trunk/ipojo/tests: ./ api/ bundleAsiPOJO/tests/ composite/composite-runtime/ composite/import-export/ composite/service-instance/ composite/service-providing/ core/annotations/ core/bad-configurations/ core/configa... Date: Sat, 01 May 2010 10:21:52 -0000 To: commits@felix.apache.org From: clement@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100501102153.E14E723889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: felix/trunk/ipojo/tests/manipulator/primitives/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/manipulator/primitives/pom.xml?rev=939968&r1=939967&r2=939968&view=diff ============================================================================== --- felix/trunk/ipojo/tests/manipulator/primitives/pom.xml (original) +++ felix/trunk/ipojo/tests/manipulator/primitives/pom.xml Sat May 1 10:21:51 2010 @@ -16,7 +16,13 @@ specific language governing permissions and limitations under the License. --> - + + + ipojo.tests + ipojo.tests + 1.5.0-SNAPSHOT + 4.0.0 bundle iPOJO Primitive Manipulation Test Suite @@ -32,12 +38,10 @@ org.apache.felix org.apache.felix.ipojo.metadata - 1.4.0 - org.apache.felix + org.osgi org.osgi.core - 1.0.1 junit @@ -49,13 +53,17 @@ org.apache.felix.ipojo.junit4osgi 1.1.0-SNAPSHOT + + org.osgi + org.osgi.compendium + 4.0.0 + org.apache.felix maven-bundle-plugin - 1.4.3 true @@ -77,7 +85,6 @@ org.apache.felix maven-ipojo-plugin - 1.6.0 Modified: felix/trunk/ipojo/tests/online-manipulator/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/pom.xml?rev=939968&r1=939967&r2=939968&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/pom.xml (original) +++ felix/trunk/ipojo/tests/online-manipulator/pom.xml Sat May 1 10:21:51 2010 @@ -1,6 +1,13 @@ 4.0.0 + + + ipojo.tests + ipojo.tests + 1.5.0-SNAPSHOT + + org.apache.felix org.apache.felix.ipojo.online.manipulator.test 1.5.0-SNAPSHOT @@ -19,6 +26,7 @@ org.apache.servicemix.tooling depends-maven-plugin + 1.2 generate-depends-file @@ -28,33 +36,13 @@ - - - - org.apache.felix + + org.osgi org.osgi.core - 1.2.0 - - org.ops4j.pax.exam - pax-exam-junit - 1.1.0 - - - junit - junit - 4.5 - jar - test - - - - - - org.ops4j.pax.swissbox - pax-swissbox-tinybundles - 1.0.0 - - - org.apache.felix - org.apache.felix.ipojo.tinybundles.bundleAsiPOJO - 1.5.0-SNAPSHOT - - - xerces - xercesImpl - 2.4.0 - - - org.apache.felix - org.apache.felix.ipojo.annotations - 1.6.0 - - - org.apache.felix - org.apache.felix.ipojo - 1.7.0-SNAPSHOT - - - org.apache.felix - org.apache.felix.ipojo.online.manipulator - 1.7.0-SNAPSHOT - + + org.ops4j.pax.exam + pax-exam-junit + 1.2.0 + + + junit + junit + 4.5 + jar + test + + + + org.ops4j.pax.swissbox + pax-swissbox-tinybundles + 1.2.0 + + + xerces + xercesImpl + 2.4.0 + + + org.apache.felix + org.apache.felix.ipojo.annotations + + + org.apache.felix + org.apache.felix.ipojo + 1.7.0-SNAPSHOT + + + org.apache.felix + org.apache.felix.ipojo.online.manipulator + 1.7.0-SNAPSHOT + Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java?rev=939968&r1=939967&r2=939968&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java Sat May 1 10:21:51 2010 @@ -3,20 +3,18 @@ package org.apache.felix.org.apache.feli import static org.ops4j.pax.exam.CoreOptions.equinox; import static org.ops4j.pax.exam.CoreOptions.felix; -import static org.ops4j.pax.exam.CoreOptions.knopflerfish; import static org.ops4j.pax.exam.CoreOptions.frameworks; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; -import static org.ops4j.pax.exam.MavenUtils.asInProject; import static org.ops4j.pax.exam.CoreOptions.options; import static org.ops4j.pax.exam.CoreOptions.provision; import static org.ops4j.pax.exam.CoreOptions.systemProperty; -import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.asFile; -import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.asURL; +import static org.ops4j.pax.exam.MavenUtils.asInProject; import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle; -import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.with; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; import org.apache.felix.ipojo.ComponentInstance; import org.apache.felix.ipojo.architecture.Architecture; @@ -29,10 +27,13 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.ops4j.io.StreamUtils; +import org.ops4j.pax.exam.Customizer; import org.ops4j.pax.exam.Inject; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.Configuration; import org.ops4j.pax.exam.junit.JUnit4TestRunner; +import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; @@ -79,11 +80,6 @@ public class OnlineManipulatorTest { // knopflerfish() KF does not export an XML parser. ), provision( - mavenBundle() - .groupId( "org.ops4j.pax.swissbox" ) - .artifactId( "pax-swissbox-tinybundles" ) - .version(asInProject())), - provision( mavenBundle() .groupId("org.apache.felix") .artifactId("org.apache.felix.ipojo") @@ -98,17 +94,27 @@ public class OnlineManipulatorTest { ), provision( newBundle() - .addClass( Hello.class ) - .prepare() + .add( Hello.class ) .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface") .set(Constants.EXPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - .build( asURL() ).toExternalForm() + .build() ), systemProperty( "providerWithMetadata" ).value( providerWithMetadata ), systemProperty( "providerWithMetadataInMetaInf" ).value( providerWithMetadataInMetaInf ), systemProperty( "providerWithoutMetadata" ).value( providerWithoutMetadata ), systemProperty( "consumerWithMetadata").value(consumerWithMetadata), - systemProperty( "consumerWithoutMetadata").value(consumerWithoutMetadata) + systemProperty( "consumerWithoutMetadata").value(consumerWithoutMetadata), + + new Customizer() { + @Override + public InputStream customizeTestProbe( InputStream testProbe ) + { + return TinyBundles.modifyBundle(testProbe).set(Constants.IMPORT_PACKAGE, + "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + } + + } ); @@ -141,12 +147,16 @@ public class OnlineManipulatorTest { } @Test - public void installProviderWithMetadata1() throws BundleException, InvalidSyntaxException, IOException { + public void installProviderWithMetadata1() throws BundleException, InvalidSyntaxException, Exception { String url = context.getProperty("providerWithMetadata"); Assert.assertNotNull(url); - context.installBundle("ipojo:"+url).start(); + Bundle bundle = context.installBundle("ipojo:"+url); + bundle.start(); assertBundle("Provider"); + + Assert.assertNotNull(context.getAllServiceReferences(Hello.class.getName(), null)); + helper.waitForService(Hello.class.getName(), null, 5000); assertValidity(); Assert.assertNotNull(context.getServiceReference(Hello.class.getName())); @@ -226,15 +236,16 @@ public class OnlineManipulatorTest { * @throws IOException */ public static String providerWithMetadata() throws IOException { - return newBundle() - .addResource("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml")) - .addClass(MyProvider.class) - .prepare( - with() - .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - ) - .build( asFile(getTemporaryFile("providerWithMetadata")) ).toURL().toExternalForm(); + InputStream is = newBundle() + .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml")) + .add(MyProvider.class) + .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + + File out = getTemporaryFile("providerWithMetadata"); + StreamUtils.copyStream(is, new FileOutputStream(out), true); + return out.toURI().toURL().toExternalForm(); } /** @@ -243,15 +254,16 @@ public class OnlineManipulatorTest { * @throws IOException */ public static String providerWithMetadataInMetaInf() throws IOException { - return newBundle() - .addResource("META-INF/metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml")) - .addClass(MyProvider.class) - .prepare( - with() - .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - ) - .build( asFile(getTemporaryFile("providerWithMetadataInMetaInf")) ).toURL().toExternalForm(); + InputStream is = newBundle() + .add("META-INF/metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml")) + .add(MyProvider.class) + .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + + File out = getTemporaryFile("providerWithMetadataInMetaInf"); + StreamUtils.copyStream(is, new FileOutputStream(out), true); + return out.toURI().toURL().toExternalForm(); } /** @@ -260,15 +272,16 @@ public class OnlineManipulatorTest { * @throws IOException */ public static String providerWithoutMetadata() throws IOException { - String url = newBundle() + InputStream is = newBundle() //.addResource("metadata.xml", this.getClass().getClassLoader().getResource("provider.xml")) - .addClass(MyProvider.class) - .prepare( - with() - .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - ) - .build( asFile(getTemporaryFile("providerWithoutMetadata")) ).toURL().toExternalForm(); + .add(MyProvider.class) + .set(Constants.BUNDLE_SYMBOLICNAME,"Provider") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + + File out = getTemporaryFile("providerWithoutMetadata"); + StreamUtils.copyStream(is, new FileOutputStream(out), true); + String url = out.toURI().toURL().toExternalForm(); return url + "!" +OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml"); } @@ -280,17 +293,16 @@ public class OnlineManipulatorTest { * @throws IOException */ public static String consumerWithMetadata() throws IOException { - return newBundle() - .addResource("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml")) - .addClass(Consumer.class) - - .prepare( - with() - .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - ) - .build( asFile(getTemporaryFile("consumerWithMetadata")) ).toURL().toExternalForm(); - + InputStream is = newBundle() + .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml")) + .add(Consumer.class) + .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + + File out = getTemporaryFile("consumerWithMetadata"); + StreamUtils.copyStream(is, new FileOutputStream(out), true); + return out.toURI().toURL().toExternalForm(); } /** @@ -300,14 +312,15 @@ public class OnlineManipulatorTest { * @throws IOException */ public static String consumerWithoutMetadata() throws IOException { - String url = newBundle() - .addClass(Consumer.class) - .prepare( - with() - .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") - ) - .build( asFile(getTemporaryFile("consumerWithoutMetadata")) ).toURL().toExternalForm(); + InputStream is = newBundle() + .add(Consumer.class) + .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.org.apache.felix.ipojo.online.manipulator.test.service") + .build(); + + File out = getTemporaryFile("consumerWithoutMetadata"); + StreamUtils.copyStream(is, new FileOutputStream(out), true); + String url = out.toURI().toURL().toExternalForm(); return url + "!" + OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml"); } Modified: felix/trunk/ipojo/tests/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/pom.xml?rev=939968&r1=939967&r2=939968&view=diff ============================================================================== --- felix/trunk/ipojo/tests/pom.xml (original) +++ felix/trunk/ipojo/tests/pom.xml Sat May 1 10:21:51 2010 @@ -16,14 +16,89 @@ specific language governing permissions and limitations under the License. --> - + 4.0.0 ipojo.tests ipojo.tests 1.5.0-SNAPSHOT Apache Felix iPOJO Tests pom - + + + + + false + + ow2.snapshots + OW2 Snapshot Repository + http://maven.ow2.org/maven2-snapshot/ + + + + + + + org.osgi + org.osgi.core + 4.2.0 + + + org.osgi + org.osgi.compendium + 4.2.0 + + + org.apache.felix + org.apache.felix.ipojo + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.annotations + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.api + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.composite + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.manipulator + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.handler.whiteboard + 1.4.0 + + + org.apache.felix + org.apache.felix.ipojo.metadata + 1.4.0 + + + + org.ow2.chameleon.testing + tinybundles-ipojo + 0.0.1-SNAPSHOT + test + + + org.ow2.chameleon.testing + osgi-helpers + 0.2.0 + test + + + + manipulator/manipulation manipulator/metadata @@ -58,6 +133,22 @@ online-manipulator + + + + + org.apache.felix + maven-ipojo-plugin + 1.6.0 + + + org.apache.felix + maven-bundle-plugin + 2.0.1 + + + + java5 @@ -92,7 +183,6 @@ integration-tests - - +