Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC8E2F3C1 for ; Wed, 20 Mar 2013 07:36:08 +0000 (UTC) Received: (qmail 81398 invoked by uid 500); 20 Mar 2013 07:36:08 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 81244 invoked by uid 500); 20 Mar 2013 07:36:06 -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 81186 invoked by uid 99); 20 Mar 2013 07:36:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 07:36:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Wed, 20 Mar 2013 07:36:00 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 84CA123888FE; Wed, 20 Mar 2013 07:35:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1458665 - in /felix/trunk/ipojo: manipulator/ manipulator/manipulator-it/ manipulator/manipulator-it/src/it/online-manipulator-it/ manipulator/manipulator-it/src/it/online-manipulator-it/src/ manipulator/manipulator-it/src/it/online-manipu... Date: Wed, 20 Mar 2013 07:35:39 -0000 To: commits@felix.apache.org From: clement@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130320073540.84CA123888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: clement Date: Wed Mar 20 07:35:37 2013 New Revision: 1458665 URL: http://svn.apache.org/r1458665 Log: FELIX-3976 - Move the online manipulator out of the core bundle FELIX-3903 - Migrate tests to pax exam 3 : migrate the online-manipulator tests to pax exam 3 Added: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/ (with props) felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/pom.xml - copied, changed from r1458279, felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-creation-test/pom.xml felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/Consumer.java - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/MyProvider.java - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/Hello.java - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/consumer.xml - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/provider.xml - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/OnlineManipulatorTest.java - copied, changed from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/resources/ felix/trunk/ipojo/manipulator/online-manipulator/ (with props) felix/trunk/ipojo/manipulator/online-manipulator/changelog.txt felix/trunk/ipojo/manipulator/online-manipulator/pom.xml felix/trunk/ipojo/manipulator/online-manipulator/src/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/DEPENDENCIES felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/LICENSE felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/NOTICE felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/IPOJOURLHandler.java felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/constants.properties felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/org.apache.felix.ipojo.manipulator.spi.Module felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/metadata.xml felix/trunk/ipojo/manipulator/online-manipulator/src/test/ Removed: felix/trunk/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPOJOURLHandler.java Modified: felix/trunk/ipojo/manipulator/manipulator-it/pom.xml felix/trunk/ipojo/manipulator/pom.xml felix/trunk/ipojo/runtime/core/pom.xml felix/trunk/ipojo/runtime/core/src/main/resources/metadata.xml felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml Modified: felix/trunk/ipojo/manipulator/manipulator-it/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/pom.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/manipulator/manipulator-it/pom.xml (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/pom.xml Wed Mar 20 07:35:37 2013 @@ -180,6 +180,12 @@ 1.9.0-SNAPSHOT + + org.apache.felix + org.apache.felix.ipojo.manipulator.online + 1.9.0-SNAPSHOT + + Propchange: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Mar 20 07:35:37 2013 @@ -0,0 +1,8 @@ +*.iml +target +*.old +*.back +.project +.classpath +.settings +.idea Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/pom.xml (from r1458279, felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-creation-test/pom.xml) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/pom.xml?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/pom.xml&p1=felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-creation-test/pom.xml&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/manipulator/manipulator-it/src/it/ipojo-manipulator-creation-test/pom.xml (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/pom.xml Wed Mar 20 07:35:37 2013 @@ -8,7 +8,7 @@ ~ "License"); you may not use this file except in compliance ~ with the License. You may obtain a copy of the License at ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, ~ software distributed under the License is distributed on an @@ -31,8 +31,7 @@ 4.0.0 - org.apache.felix - ipojo-manipulator-creation-test + ipojo-online-manipulator-test ${project.artifactId} Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/Consumer.java (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/Consumer.java?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/Consumer.java&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/Consumer.java Wed Mar 20 07:35:37 2013 @@ -1,8 +1,27 @@ -package org.apache.felix.ipojo.online.manipulator.test.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.felix.ipojo.test.online.components; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Requires; -import org.apache.felix.ipojo.online.manipulator.test.service.Hello; +import org.apache.felix.ipojo.test.online.services.Hello; @Component public class Consumer { Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/MyProvider.java (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/MyProvider.java?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/MyProvider.java&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/components/MyProvider.java Wed Mar 20 07:35:37 2013 @@ -1,6 +1,26 @@ -package org.apache.felix.ipojo.online.manipulator.test.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -import org.apache.felix.ipojo.online.manipulator.test.service.Hello; +package org.apache.felix.ipojo.test.online.components; + + +import org.apache.felix.ipojo.test.online.services.Hello; public class MyProvider implements Hello { Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/Hello.java (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/Hello.java?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/Hello.java&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/java/org/apache/felix/ipojo/test/online/services/Hello.java Wed Mar 20 07:35:37 2013 @@ -1,4 +1,23 @@ -package org.apache.felix.ipojo.online.manipulator.test.service; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.felix.ipojo.test.online.services; public interface Hello { Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/consumer.xml (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/consumer.xml?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/consumer.xml&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/consumer.xml Wed Mar 20 07:35:37 2013 @@ -1,3 +1,22 @@ + + - + \ No newline at end of file Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/provider.xml (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/provider.xml?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/provider.xml&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/main/resources/provider.xml Wed Mar 20 07:35:37 2013 @@ -1,6 +1,25 @@ + + - + - + \ No newline at end of file Copied: felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/OnlineManipulatorTest.java (from r1458279, felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java) URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/OnlineManipulatorTest.java?p2=felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/OnlineManipulatorTest.java&p1=felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java&r1=1458279&r2=1458665&rev=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java (original) +++ felix/trunk/ipojo/manipulator/manipulator-it/src/it/online-manipulator-it/src/test/java/org/apache/felix/ipojo/test/online/OnlineManipulatorTest.java Wed Mar 20 07:35:37 2013 @@ -1,42 +1,58 @@ -package org.apache.felix.ipojo.online.manipulator.test; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.ipojo.test.online; -import static org.ops4j.pax.exam.CoreOptions.*; -import static org.ops4j.pax.exam.MavenUtils.asInProject; -import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle; - -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; import org.apache.felix.ipojo.architecture.InstanceDescription; -import org.apache.felix.ipojo.online.manipulator.test.impl.Consumer; -import org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider; -import org.apache.felix.ipojo.online.manipulator.test.service.Hello; +import org.apache.felix.ipojo.test.online.components.Consumer; +import org.apache.felix.ipojo.test.online.components.MyProvider; +import org.apache.felix.ipojo.test.online.services.Hello; import org.junit.After; 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.Configuration; 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; -import org.osgi.framework.Constants; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; +import org.ops4j.pax.exam.junit.PaxExam; +import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; +import org.ops4j.pax.exam.spi.reactors.PerMethod; +import org.ops4j.pax.tinybundles.core.TinyBundles; +import org.osgi.framework.*; +import org.ow2.chameleon.testing.helpers.OSGiHelper; + +import javax.inject.Inject; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; + +import static org.ops4j.pax.exam.CoreOptions.*; +import static org.ops4j.pax.exam.MavenUtils.asInProject; -@RunWith(JUnit4TestRunner.class) +@RunWith(PaxExam.class) +@ExamReactorStrategy(PerMethod.class) public class OnlineManipulatorTest { @@ -48,17 +64,8 @@ public class OnlineManipulatorTest { private OSGiHelper helper; - /* - * org.apache.felix - org.apache.felix.ipojo.online.manipulator - 1.3.0-SNAPSHOT - - */ - @Configuration - public static Option[] configure() throws IOException { - - + public Option[] configure() throws IOException { String providerWithMetadata = providerWithMetadata(); String providerWithMetadataInMetaInf = providerWithMetadataInMetaInf(); String providerWithoutMetadata = providerWithoutMetadata(); @@ -66,40 +73,25 @@ public class OnlineManipulatorTest { String consumerWithoutMetadata = consumerWithoutMetadata(); return options( - frameworks( - felix(), - equinox(), - knopflerfish() //KF does not export an XML parser. - ), - provision( - mavenBundle() - .groupId("org.apache.felix") - .artifactId("org.apache.felix.ipojo") - .version(asInProject()) - ), + cleanCaches(), + mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(), + mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject(), + mavenBundle("org.apache.felix","org.apache.felix.ipojo.manipulator.online").versionAsInProject(), + junitBundles(), provision( - newBundle() + TinyBundles.bundle() .add(Hello.class) .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterface") - .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service") + .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build() ), + systemProperty("providerWithMetadata").value(providerWithMetadata), systemProperty("providerWithMetadataInMetaInf").value(providerWithMetadataInMetaInf), systemProperty("providerWithoutMetadata").value(providerWithoutMetadata), systemProperty("consumerWithMetadata").value(consumerWithMetadata), - systemProperty("consumerWithoutMetadata").value(consumerWithoutMetadata), - - new Customizer() { - @Override - public InputStream customizeTestProbe(InputStream testProbe) { - return TinyBundles.modifyBundle(testProbe).set(Constants.IMPORT_PACKAGE, - "org.apache.felix.ipojo.online.manipulator.test.service") - .build(); - } - - } + systemProperty("consumerWithoutMetadata").value(consumerWithoutMetadata) ); } @@ -213,14 +205,14 @@ public class OnlineManipulatorTest { * Gets a regular bundle containing metadata file * * @return the url of the bundle - * @throws IOException + * @throws java.io.IOException */ public static String providerWithMetadata() throws IOException { - InputStream is = newBundle() + InputStream is = TinyBundles.bundle() .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml")) .add(MyProvider.class) .set(Constants.BUNDLE_SYMBOLICNAME, "Provider") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build(); File out = getTemporaryFile("providerWithMetadata"); @@ -232,14 +224,14 @@ public class OnlineManipulatorTest { * Gets a regular bundle containing metadata file in the META-INF directory * * @return the url of the bundle - * @throws IOException + * @throws java.io.IOException */ public static String providerWithMetadataInMetaInf() throws IOException { - InputStream is = newBundle() + InputStream is = TinyBundles.bundle() .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.ipojo.online.manipulator.test.service") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build(); File out = getTemporaryFile("providerWithMetadataInMetaInf"); @@ -251,14 +243,14 @@ public class OnlineManipulatorTest { * Gets a provider bundle which does not contain the metadata file. * * @return the url of the bundle + metadata - * @throws IOException + * @throws java.io.IOException */ public static String providerWithoutMetadata() throws IOException { - InputStream is = newBundle() + InputStream is = TinyBundles.bundle() //.addResource("metadata.xml", this.getClass().getClassLoader().getResource("provider.xml")) .add(MyProvider.class) .set(Constants.BUNDLE_SYMBOLICNAME, "Provider") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build(); File out = getTemporaryFile("providerWithoutMetadata"); @@ -273,14 +265,14 @@ public class OnlineManipulatorTest { * declaration in the metadata. * * @return the url of the bundle - * @throws IOException + * @throws java.io.IOException */ public static String consumerWithMetadata() throws IOException { - InputStream is = newBundle() + InputStream is = TinyBundles.bundle() .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml")) .add(Consumer.class) .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build(); File out = getTemporaryFile("consumerWithMetadata"); @@ -293,13 +285,13 @@ public class OnlineManipulatorTest { * metadata * * @return the url of the bundle + metadata - * @throws IOException + * @throws java.io.IOException */ public static String consumerWithoutMetadata() throws IOException { - InputStream is = newBundle() + InputStream is = TinyBundles.bundle() .add(Consumer.class) .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer") - .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service") + .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.test.online.services") .build(); File out = getTemporaryFile("consumerWithoutMetadata"); @@ -345,8 +337,8 @@ public class OnlineManipulatorTest { try { ServiceReference[] refs = context.getServiceReferences(Architecture.class.getName(), null); Assert.assertNotNull(refs); - for (int i = 0; i < refs.length; i++) { - InstanceDescription id = ((Architecture) context.getService(refs[i])).getInstanceDescription(); + for (ServiceReference ref : refs) { + InstanceDescription id = ((Architecture) context.getService(ref)).getInstanceDescription(); int state = id.getState(); Assert.assertEquals("State of " + id.getName(), ComponentInstance.VALID, state); } Propchange: felix/trunk/ipojo/manipulator/online-manipulator/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Wed Mar 20 07:35:37 2013 @@ -0,0 +1,8 @@ +target +*.iml +*.out +*.old +.classpath +.project +.settings +.idea Added: felix/trunk/ipojo/manipulator/online-manipulator/changelog.txt URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/changelog.txt?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/changelog.txt (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/changelog.txt Wed Mar 20 07:35:37 2013 @@ -0,0 +1,20 @@ +Changes from the 1.4.2 to 1.6.0 +------------------------------- +** Improvement + * [FELIX-1427] - Service injection with Smart Proxies + * [FELIX-1906] - Allow calling a method when service properties of an already injected service are modified + + +Changes from the 1.4.0 to 1.4.2 +------------------------------- +** Bug + * [FELIX-1518] - iPOJO manipulator is really slow even when annotation are ignored + + +Version 1.4.0 +------------- +** Improvement + * Update parent pom + * Initial commit + + Added: felix/trunk/ipojo/manipulator/online-manipulator/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/pom.xml?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/pom.xml (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/pom.xml Wed Mar 20 07:35:37 2013 @@ -0,0 +1,179 @@ + + + + org.apache.felix + felix-parent + 2.1 + ../../../pom/pom.xml + + 4.0.0 + bundle + Apache Felix iPOJO - Online Manipulator + org.apache.felix.ipojo.manipulator.online + 1.9.0-SNAPSHOT + + + iPOJO online manipulator allowing install time manipulation of iPOJO bundle. + + http://felix.apache.org/site/apache-felix-ipojo-online-manipulator.html + + + [1.8.0,2.0.0) + ${project.version} + + + + + org.osgi + org.osgi.core + 4.3.1 + + + org.osgi + org.osgi.compendium + 4.0.0 + + + org.apache.felix + org.apache.felix.ipojo.metadata + 1.6.0 + + + org.apache.felix + org.apache.felix.ipojo.manipulator + ${project.version} + + + asm + asm-all + 3.3.1 + + + asm + asm-tree + + + + + org.mockito + mockito-all + 1.9.5 + test + + + + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.0 + + 1.5 + 1.5 + 1.5 + 1.5 + + + + org.apache.felix + maven-bundle-plugin + 2.3.7 + true + + + ${pom.artifactId} + org.apache.felix.ipojo.online.manipulator + + http://felix.apache.org/site/apache-felix-ipojo-online-manipulator.html + + + org.apache.felix.ipojo.manipulation*; version="${ipojo.manipulator.version}", + org.apache.felix.ipojo.xml.parser; version="${ipojo.manipulator.version}", + org.apache.felix.ipojo.manipulator*; version="${ipojo.manipulator.version}", + org.apache.felix.ipojo.annotations*; version="${ipojo.manipulator.version}", + + + org.objectweb.asm, + org.objectweb.asm.commons, + org.objectweb.asm.signature, + org.objectweb.asm.tree, + org.apache.felix.ipojo.online.manipulator + + !sun.io, org.osgi.framework;version=1.3, * + + + + + + org.apache.felix + maven-ipojo-plugin + 1.9.0-SNAPSHOT + + + + ipojo-bundle + + + true + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + false + warning + http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml + + + + org.apache.rat + apache-rat-plugin + + + verify + + check + + + + + + + src/** + + + src/main/appended-resources/** + src/main/resources/META-INF/** + + + + + + Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/DEPENDENCIES URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/DEPENDENCIES?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/DEPENDENCIES (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/DEPENDENCIES Wed Mar 20 07:35:37 2013 @@ -0,0 +1,21 @@ +I. Included Third-Party Software + +This product includes software developed at +Copyright (c) 2000-2005 INRIA, France Telecom +Licensed under BSD License. + +This product includes software developed at +The OSGi Alliance (http://www.osgi.org/). +Copyright (c) OSGi Alliance (2000, 2007). +Licensed under the Apache License 2.0. + +II. Used Third-Party Software + +This product uses software developed at +The OSGi Alliance (http://www.osgi.org/). +Copyright (c) OSGi Alliance (2000, 2009). +Licensed under the Apache License 2.0. + +III. Overall License Summary +- Apache License 2.0 +- BSD License Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/LICENSE URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/LICENSE?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/LICENSE (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/LICENSE Wed Mar 20 07:35:37 2013 @@ -0,0 +1,42 @@ + + +APACHE FELIX iPOJO Online Manipulator: + +The Apache Felix iPOJO Online Manipulator includes a number of subcomponents with +separate copyright notices and license terms. Your use of the source +code for the these subcomponents is subject to the terms and +conditions of the following licenses. + + +For the ASM component: + +Copyright (c) 2000-2005 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/NOTICE URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/NOTICE?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/NOTICE (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/appended-resources/META-INF/NOTICE Wed Mar 20 07:35:37 2013 @@ -0,0 +1,8 @@ +This product includes software developed at +The OSGi Alliance (http://www.osgi.org/). +Copyright (c) OSGi Alliance (2000, 2009). +Licensed under the Apache License 2.0. + +This product includes software developed at +Copyright (c) 2000-2005 INRIA, France Telecom +Licensed under BSD License. Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/IPOJOURLHandler.java URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/IPOJOURLHandler.java?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/IPOJOURLHandler.java (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/java/org/apache/felix/ipojo/online/manipulator/IPOJOURLHandler.java Wed Mar 20 07:35:37 2013 @@ -0,0 +1,245 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.felix.ipojo.online.manipulator; + +import org.apache.felix.ipojo.manipulator.Pojoization; +import org.osgi.framework.BundleContext; +import org.osgi.service.url.URLStreamHandlerService; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +/** + * iPOJO URL Handler allowing installation time manipulation. + * When a bundle is installed with the ipojo: URL + * prefix, the bundle is downloaded and manipulated by this + * handler. + * The metadata.xml file can either be provided inside the bundle (root, + * or in META-INF) or given in the URL: + * ipojo:URL_BUNDLE!URL_METADATA. + * + * @author Felix Project Team + */ +public class IPOJOURLHandler + extends org.osgi.service.url.AbstractURLStreamHandlerService implements URLStreamHandlerService { + + /** + * The bundle context. + */ + private BundleContext m_context; + /** + * The directory storing bundles. + */ + private File m_temp; + + /** + * Creates a IPOJOURLHandler. + * Gets the bundle context and create the working + * directory. + * + * @param bc the bundle context + */ + public IPOJOURLHandler(BundleContext bc) { + m_context = bc; + m_temp = m_context.getDataFile("temp"); + if (!m_temp.exists()) { + m_temp.mkdir(); + } + } + + /** + * Stops the URL handler: + * Deletes the working directory. + */ + public void stop() { + File[] files = m_temp.listFiles(); + if (files != null) { + for (int i = 0; i < files.length; i++) { + files[i].delete(); + } + } + m_temp.delete(); + } + + /** + * Opens a connection using the ipojo url handler. + * This methods parses the URL and manipulate the given bundle. + * + * @param url the url. + * @return the URL connection on the manipulated bundle + * @throws java.io.IOException occurs when the bundle cannot be either downloaded, or manipulated or + * installed correctly. + * @see org.osgi.service.url.AbstractURLStreamHandlerService#openConnection(java.net.URL) + */ + public URLConnection openConnection(URL url) throws IOException { + System.out.println("Processing URL : " + url); + + // Parse the url: + String full = url.toExternalForm(); + // Remote ipojo:// + if (full.startsWith("ipojo:")) { + full = full.substring(6); + } + // Remove '/' or '//' + while (full.startsWith("/")) { + full = full.substring(1); + } + + full = full.trim(); + + // Now full is like : URL,URL or URL + String[] urls = full.split("!"); + URL bundleURL = null; + URL metadataURL = null; + if (urls.length == 1) { + // URL form + System.out.println("Extracted URL : " + urls[0]); + bundleURL = new URL(urls[0]); + } else if (urls.length == 2) { + // URL,URL form + bundleURL = new URL(urls[0]); + metadataURL = new URL(urls[1]); + } else { + throw new MalformedURLException("The iPOJO url is not formatted correctly, ipojo:bundle_url[!metadata_url] expected"); + } + + File bundle = File.createTempFile("ipojo_", ".jar", m_temp); + save(bundleURL, bundle); + File metadata = null; + if (metadataURL != null) { + metadata = File.createTempFile("ipojo_", ".xml", m_temp); + save(metadataURL, metadata); + } else { + // Check that the metadata are in the jar file + JarFile jar = new JarFile(bundle); + metadata = findMetadata(jar); + } + + // Pojoization + Pojoization pojoizator = new Pojoization(); + File out = new File(m_temp, bundle.getName() + "-ipojo.jar"); + System.out.println("Pojoization " + bundle.exists() + " - " + metadata.exists()); + try { + pojoizator.pojoization(bundle, out, metadata); + } catch (Exception e) { + if (!pojoizator.getErrors().isEmpty()) { + throw new IOException("Errors occured during the manipulation : " + pojoizator.getErrors()); + } + e.printStackTrace(); + throw new RuntimeException(e.getMessage()); + } + + if (!pojoizator.getErrors().isEmpty()) { + throw new IOException("Errors occured during the manipulation : " + pojoizator.getErrors()); + } + if (!pojoizator.getWarnings().isEmpty()) { + System.err.println("Warnings occured during the manipulation : " + pojoizator.getWarnings()); + } + + System.out.println("Manipulation done : " + out.exists()); + + // Cleanup + bundle.delete(); + if (metadata != null) { + metadata.delete(); + } + out.deleteOnExit(); + // Returns the URL Connection + return out.toURI().toURL().openConnection(); + + + } + + /** + * Downloads the content pointed by the given url to + * the given file. + * + * @param url the url + * @param file the file + * @throws java.io.IOException occurs if the content cannot be read + * and save inside the file + */ + private void save(URL url, File file) throws IOException { + InputStream is = url.openStream(); + save(is, file); + } + + /** + * Saves the content of the input stream to the given file. + * + * @param is the input stream to read + * @param file the file + * @throws java.io.IOException occurs if the content cannot be read + * and save inside the file + */ + private void save(InputStream is, File file) throws IOException { + FileOutputStream writer = new FileOutputStream(file); + int cc = 0; + do { + int i = is.read(); + if (i == -1) { + break; + } + cc++; + writer.write(i); + } while (true); + System.out.println(cc + " bytes copied"); + is.close(); + writer.close(); + } + + /** + * Looks for the metadata.xml file in the jar file. + * Two locations are checked: + *
    + *
  1. the root of the jar file
  2. + *
  3. the META-INF directory
  4. + *
+ * + * @param jar the jar file + * @return the founded file or null if not found. + * @throws java.io.IOException occurs when the Jar file cannot be read. + */ + private File findMetadata(JarFile jar) throws IOException { + JarEntry je = jar.getJarEntry("metadata.xml"); + if (je == null) { + je = jar.getJarEntry("META-INF/metadata.xml"); + } + + if (je == null) { + System.out.println("Metadata file not found, use annotations only."); + return null; // Not Found, use annotation only + } else { + System.out.println("Metadata file found: " + je.getName()); + File metadata = File.createTempFile("ipojo_", ".xml", m_temp); + save(jar.getInputStream(je), metadata); + System.out.println("Metadata file saved to " + metadata.getAbsolutePath()); + return metadata; + } + + } + +} Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/constants.properties URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/constants.properties?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/constants.properties (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/constants.properties Wed Mar 20 07:35:37 2013 @@ -0,0 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# This file define the different constant we use in the manipulator. This file is filtered by Maven. +manipulator.version=${project.version} +ipojo.import.packages=${ipojo.import.packages} \ No newline at end of file Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/org.apache.felix.ipojo.manipulator.spi.Module URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/org.apache.felix.ipojo.manipulator.spi.Module?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/org.apache.felix.ipojo.manipulator.spi.Module (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/META-INF/services/org.apache.felix.ipojo.manipulator.spi.Module Wed Mar 20 07:35:37 2013 @@ -0,0 +1 @@ +org.apache.felix.ipojo.manipulator.metadata.annotation.module.DefaultBindingModule \ No newline at end of file Added: felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/metadata.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/metadata.xml?rev=1458665&view=auto ============================================================================== --- felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/metadata.xml (added) +++ felix/trunk/ipojo/manipulator/online-manipulator/src/main/resources/metadata.xml Wed Mar 20 07:35:37 2013 @@ -0,0 +1,32 @@ + + + + + + + + + + + \ No newline at end of file Modified: felix/trunk/ipojo/manipulator/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/manipulator/pom.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/manipulator/pom.xml (original) +++ felix/trunk/ipojo/manipulator/pom.xml Wed Mar 20 07:35:37 2013 @@ -40,6 +40,7 @@ ipojo-ant-task maven-ipojo-plugin bnd-ipojo-plugin + online-manipulator Modified: felix/trunk/ipojo/runtime/core/pom.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/pom.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/runtime/core/pom.xml (original) +++ felix/trunk/ipojo/runtime/core/pom.xml Wed Mar 20 07:35:37 2013 @@ -39,9 +39,6 @@ * change in ComponentTypeDescription (FELIX-3560) --> 1.8.4 - - - 1.8.6 @@ -68,11 +65,6 @@ 1.6.0
- org.apache.felix - org.apache.felix.ipojo.manipulator - ${ipojo.manipulator.version} - - asm asm-all 3.3.1 @@ -128,28 +120,14 @@ org.osgi.service.log, org.osgi.util.tracker;version=1.3, !sun.io, - !net.sourceforge.cobertura.*, - - - javax.xml.parsers;resolution:=optional, - org.osgi.service.url;resolution:=optional, - org.w3c.dom;resolution:=optional, - org.xml.sax;resolution:=optional, - org.xml.sax.helpers;resolution:=optional + !net.sourceforge.cobertura.* org.apache.felix.ipojo.handlers.architecture, org.apache.felix.ipojo.handlers.lifecycle.callback, org.apache.felix.ipojo.handlers.lifecycle.controller, org.apache.felix.ipojo.extender.internal*, - - org.objectweb.asm.commons;-split-package:=merge-last, - org.objectweb.asm.signature;-split-package:=merge-last, - org.objectweb.asm;-split-package:=merge-last, - org.objectweb.asm.tree;-split-package:=merge-last + org.objectweb.asm;-split-package:=merge-last org.apache.felix.ipojo; version="${ipojo.package.version}", @@ -165,11 +143,6 @@ org.apache.felix.ipojo.handlers.providedservice.*; version="${ipojo.package.version}", org.apache.felix.ipojo.handlers.configuration; version="${ipojo.package.version}", org.apache.felix.ipojo.context; version="${ipojo.package.version}", - - org.apache.felix.ipojo.manipulation*; version="${ipojo.manipulator.version}", - org.apache.felix.ipojo.xml.parser; version="${ipojo.manipulator.version}", - org.apache.felix.ipojo.manipulator*; version="${ipojo.manipulator.version}", - org.apache.felix.ipojo.annotations*; version="${ipojo.package.version}", org.osgi.service.cm, org.osgi.service.log Modified: felix/trunk/ipojo/runtime/core/src/main/resources/metadata.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core/src/main/resources/metadata.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/runtime/core/src/main/resources/metadata.xml (original) +++ felix/trunk/ipojo/runtime/core/src/main/resources/metadata.xml Wed Mar 20 07:35:37 2013 @@ -44,14 +44,4 @@ - - - - - - - - \ No newline at end of file Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/java/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/ipojo/online/manipulator/test/OnlineManipulatorTest.java?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java Wed Mar 20 07:35:37 2013 @@ -13,8 +13,8 @@ import java.io.InputStream; import org.apache.felix.ipojo.ComponentInstance; import org.apache.felix.ipojo.architecture.Architecture; import org.apache.felix.ipojo.architecture.InstanceDescription; -import org.apache.felix.ipojo.online.manipulator.test.impl.Consumer; -import org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider; +import org.apache.felix.ipojo.test.online.components.Consumer; +import org.apache.felix.ipojo.test.online.components.MyProvider; import org.apache.felix.ipojo.online.manipulator.test.service.Hello; import org.junit.After; import org.junit.Assert; Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java Wed Mar 20 07:35:37 2013 @@ -1,4 +1,4 @@ -package org.apache.felix.ipojo.online.manipulator.test.impl; +package org.apache.felix.ipojo.test.online.components; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Requires; Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java Wed Mar 20 07:35:37 2013 @@ -1,4 +1,4 @@ -package org.apache.felix.ipojo.online.manipulator.test.impl; +package org.apache.felix.ipojo.test.online.components; import org.apache.felix.ipojo.online.manipulator.test.service.Hello; Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/resources/consumer.xml Wed Mar 20 07:35:37 2013 @@ -1,3 +1,3 @@ - + \ No newline at end of file Modified: felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml?rev=1458665&r1=1458664&r2=1458665&view=diff ============================================================================== --- felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml (original) +++ felix/trunk/ipojo/tests/online-manipulator/src/test/resources/provider.xml Wed Mar 20 07:35:37 2013 @@ -1,6 +1,6 @@ - + - + \ No newline at end of file