felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
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 GMT
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 @@
             <version>1.9.0-SNAPSHOT</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.manipulator.online</artifactId>
+            <version>1.9.0-SNAPSHOT</version>
+        </dependency>
+
         <!-- End of tested version -->
 
         <dependency>

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 @@
 
     <modelVersion>4.0.0</modelVersion>
 
-    <groupId>org.apache.felix</groupId>
-    <artifactId>ipojo-manipulator-creation-test</artifactId>
+    <artifactId>ipojo-online-manipulator-test</artifactId>
 
     <name>${project.artifactId}</name>
 

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 @@
+<!--
+  ~ 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.
+  -->
+
 <ipojo>
-<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.Consumer"/>
+<instance component="org.apache.felix.ipojo.test.online.components.Consumer"/>
 </ipojo>
\ 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 @@
+<!--
+  ~ 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.
+  -->
+
 <ipojo>
-<component classname="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider">
+<component classname="org.apache.felix.ipojo.test.online.components.MyProvider">
 	<provides/>
 </component>
-<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider"/>
+<instance component="org.apache.felix.ipojo.test.online.components.MyProvider"/>
 </ipojo>
\ 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;
 
 
-    /*
-     * <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.ipojo.online.manipulator</artifactId>
-  <version>1.3.0-SNAPSHOT</version>
-
-     */
-
     @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 @@
+<!--
+  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.
+-->
+<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">
+    <parent>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>felix-parent</artifactId>
+        <version>2.1</version>
+        <relativePath>../../../pom/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>bundle</packaging>
+    <name>Apache Felix iPOJO - Online Manipulator</name>
+    <artifactId>org.apache.felix.ipojo.manipulator.online</artifactId>
+    <version>1.9.0-SNAPSHOT</version>
+
+    <description>
+        iPOJO online manipulator allowing install time manipulation of iPOJO bundle.
+    </description>
+    <url>http://felix.apache.org/site/apache-felix-ipojo-online-manipulator.html</url>
+
+    <properties>
+        <ipojo.import.packages>[1.8.0,2.0.0)</ipojo.import.packages>
+        <ipojo.manipulator.version>${project.version}</ipojo.manipulator.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <version>4.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.metadata</artifactId>
+            <version>1.6.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>asm</groupId>
+            <artifactId>asm-all</artifactId>
+            <version>3.3.1</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>asm</groupId>
+                    <artifactId>asm-tree</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.9.5</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.0</version>
+                <configuration>
+                    <target>1.5</target>
+                    <source>1.5</source>
+                    <testTarget>1.5</testTarget>
+                    <testSource>1.5</testSource>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>2.3.7</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+                        <Private-Package>org.apache.felix.ipojo.online.manipulator</Private-Package>
+                        <Bundle-DocURL>
+                            http://felix.apache.org/site/apache-felix-ipojo-online-manipulator.html
+                        </Bundle-DocURL>
+                        <Export-Package>
+                            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}",
+                        </Export-Package>
+                        <Private-Package>
+                            org.objectweb.asm,
+                            org.objectweb.asm.commons,
+                            org.objectweb.asm.signature,
+                            org.objectweb.asm.tree,
+                            org.apache.felix.ipojo.online.manipulator
+                        </Private-Package>
+                        <Import-Package>!sun.io, org.osgi.framework;version=1.3, *
+                        </Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-ipojo-plugin</artifactId>
+                <version>1.9.0-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>ipojo-bundle</goal>
+                        </goals>
+                        <configuration>
+                            <ignoreAnnotations>true</ignoreAnnotations>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-checkstyle-plugin</artifactId>
+                <configuration>
+                    <enableRulesSummary>false</enableRulesSummary>
+                    <violationSeverity>warning</violationSeverity>
+                    <configLocation>http://felix.apache.org/ipojo/dev/checkstyle_ipojo.xml</configLocation>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!-- check src only (except remote resources additions) -->
+                    <includes>
+                        <include>src/**</include>
+                    </includes>
+                    <excludes>
+                        <exclude>src/main/appended-resources/**</exclude>
+                        <exclude>src/main/resources/META-INF/**</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

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 <code>ipojo:</code> 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 <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
+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:
+     * <ol>
+     * <li>the root of the jar file</li>
+     * <li>the META-INF directory</li>
+     * </ol>
+     *
+     * @param jar the jar file
+     * @return the founded file or <code>null</code> 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 @@
+<!--
+	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.
+-->
+<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
+       xmlns="org.apache.felix.ipojo">
+
+    <component classname="org.apache.felix.ipojo.online.manipulator.IPOJOURLHandler"
+               public="false"
+               immediate="true">
+        <provides>
+            <property name="url.handler.protocol" type="java.lang.String" value="ipojo"/>
+        </provides>
+        <callback transition="invalidate" method="stop"/>
+    </component>
+    <instance component="org.apache.felix.ipojo.online.manipulator.IPOJOURLHandler"/>
+</ipojo>
\ 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 @@
         <module>ipojo-ant-task</module>
         <module>maven-ipojo-plugin</module>
         <module>bnd-ipojo-plugin</module>
+        <module>online-manipulator</module>
     </modules>
 
 </project>

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)
         -->
         <ipojo.package.version>1.8.4</ipojo.package.version>
-
-        <!-- Embedded manipulator version -->
-        <ipojo.manipulator.version>1.8.6</ipojo.manipulator.version>
     </properties>
 
     <description>
@@ -68,11 +65,6 @@
             <version>1.6.0</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-            <version>${ipojo.manipulator.version}</version>
-        </dependency>
-        <dependency>
             <groupId>asm</groupId>
             <artifactId>asm-all</artifactId>
             <version>3.3.1</version>
@@ -128,28 +120,14 @@
                             org.osgi.service.log,
                             org.osgi.util.tracker;version=1.3,
                             !sun.io,
-                            !net.sourceforge.cobertura.*, <!--  To support code coverage -->
-
-                            <!--
-                              Packages used for the online-manipulator.
-                              They are optionals
-                            -->
-                            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.* <!--  To support code coverage -->
                         </Import-Package>
                         <Private-Package>
                             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*,
-                            <!-- ASM (Manipulator dependencies) -->
-                            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
                         </Private-Package>
                         <Export-Package>
                             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}",
-                            <!-- Embedded manipulator -->
-                            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}",
                             <!-- Compendium packages -->
                             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 @@
             <property field="m_name" name="architecture.instance"/>
         </provides>
     </handler>
-    <!-- iPOJO Online Manipulator -->
-    <component classname="org.apache.felix.ipojo.IPOJOURLHandler"
-               public="false"
-               immediate="true">
-        <provides>
-            <property name="url.handler.protocol" type="java.lang.String" value="ipojo"/>
-        </provides>
-        <callback transition="invalidate" method="stop"/>
-    </component>
-    <instance component="org.apache.felix.ipojo.IPOJOURLHandler"/>
 </ipojo>
\ 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 @@
 <ipojo>
-<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.Consumer"/>
+<instance component="org.apache.felix.ipojo.test.online.components.Consumer"/>
 </ipojo>
\ 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 @@
 <ipojo>
-<component classname="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider">
+<component classname="org.apache.felix.ipojo.test.online.components.MyProvider">
 	<provides/>
 </component>
-<instance component="org.apache.felix.ipojo.online.manipulator.test.impl.MyProvider"/>
+<instance component="org.apache.felix.ipojo.test.online.components.MyProvider"/>
 </ipojo>
\ No newline at end of file



Mime
View raw message