aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1690254 - in /aries/trunk/blueprint: blueprint-core/src/main/java/org/apache/aries/blueprint/container/ blueprint-itests/ blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/ blueprint-sample-annotation/ blueprint-sample-annot...
Date Fri, 10 Jul 2015 13:25:13 GMT
Author: gnodet
Date: Fri Jul 10 13:25:13 2015
New Revision: 1690254

URL: http://svn.apache.org/r1690254
Log:
[ARIES-1324] Allow to use Blueprint annotations and configuration files simultaneously

Added:
    aries/trunk/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/TestXmlConfigBean.java
    aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/
    aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/
    aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/
    aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/config.xml
Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
    aries/trunk/blueprint/blueprint-itests/pom.xml
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
    aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/Helper.java
    aries/trunk/blueprint/blueprint-sample-annotation/pom.xml

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java?rev=1690254&r1=1690253&r2=1690254&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintExtender.java
Fri Jul 10 13:25:13 2015
@@ -378,7 +378,7 @@ public class BlueprintExtender implement
                 }
             }
             // Check annotations
-            if (pathList.isEmpty() && blueprintHeaderAnnotation != null &&
blueprintHeaderAnnotation.trim().equalsIgnoreCase("true")) {
+            if (blueprintHeaderAnnotation != null && blueprintHeaderAnnotation.trim().equalsIgnoreCase("true"))
{
                 LOGGER.debug("Scanning bundle {} for blueprint annotations", bundle.getSymbolicName());
                 ServiceReference sr = this.context.getServiceReference(BlueprintAnnotationScanner.class.getName());
                 if (sr != null) {

Modified: aries/trunk/blueprint/blueprint-itests/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/pom.xml?rev=1690254&r1=1690253&r2=1690254&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-itests/pom.xml Fri Jul 10 13:25:13 2015
@@ -67,7 +67,7 @@
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>blueprint-parser</artifactId>
-            <version>1.3.1-SNAPSHOT</version>
+            <version>1.3.2-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
@@ -208,18 +208,18 @@
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-asm4-shaded</artifactId>
-            <version>3.16</version>
+            <artifactId>xbean-asm5-shaded</artifactId>
+            <version>3.18</version>
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
             <artifactId>xbean-bundleutils</artifactId>
-            <version>3.16</version>
+            <version>3.18</version>
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-finder-shaded</artifactId>
-            <version>3.16</version>
+            <artifactId>xbean-finder</artifactId>
+            <version>3.18</version>
         </dependency>
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
@@ -265,7 +265,7 @@
         <dependency>
             <groupId>org.apache.aries.blueprint</groupId>
             <artifactId>org.apache.aries.blueprint.sample-annotation</artifactId>
-            <version>1.0.0</version>
+            <version>1.1.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java?rev=1690254&r1=1690253&r2=1690254&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
(original)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/BlueprintAnnotationTest.java
Fri Jul 10 13:25:13 2015
@@ -30,6 +30,7 @@ import java.util.Currency;
 
 import org.apache.aries.blueprint.sample.Bar;
 import org.apache.aries.blueprint.sample.Foo;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Configuration;
@@ -41,12 +42,16 @@ import org.osgi.service.blueprint.contai
 @RunWith(PaxExam.class)
 public class BlueprintAnnotationTest extends AbstractBlueprintIntegrationTest {
 
+    private BlueprintContainer blueprintContainer;
+
+    @Before
+    public void setUp() throws InvalidSyntaxException, InterruptedException {
+        blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample-annotation");
+        assertNotNull(blueprintContainer);
+    }
+
     @Test
     public void test() throws Exception {
-        BlueprintContainer blueprintContainer = getBlueprintContainerForBundle("org.apache.aries.blueprint.sample-annotation");
-    
-        assertNotNull(blueprintContainer);
-    
         Object obj = blueprintContainer.getComponentInstance("bar");
         assertNotNull(obj);
         assertEquals(Bar.class, obj.getClass());
@@ -69,11 +74,18 @@ public class BlueprintAnnotationTest ext
         
         assertNotNull(blueprintContainer.getComponentInstance("fragment"));
     
-        obj = context().getService(Foo.class, null, 5000);
+        obj = context().getService(Foo.class, "(blueprint.annotation.sample=true)", 5000);
         assertNotNull(obj);
         assertEquals(foo.toString(), obj.toString());
     }
 
+    @Test
+    public void testXmlConfig() {
+        Object obj = blueprintContainer.getComponentInstance("testXmlConfigBean");
+        assertNotNull(obj);
+        assertEquals("org.apache.aries.blueprint.sample.TestXmlConfigBean", obj.getClass().getName());
+    }
+
     private BlueprintContainer getBlueprintContainerForBundle(String symbolicName) throws
InvalidSyntaxException, InterruptedException {
         return context().getService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname="
+ symbolicName + ")", 15000);
     }    

Modified: aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/Helper.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/Helper.java?rev=1690254&r1=1690253&r2=1690254&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/Helper.java
(original)
+++ aries/trunk/blueprint/blueprint-itests/src/test/java/org/apache/aries/blueprint/itests/Helper.java
Fri Jul 10 13:25:13 2015
@@ -71,9 +71,9 @@ public class Helper {
                 mvnBundle("org.apache.aries.proxy", "org.apache.aries.proxy.impl"),
                 mvnBundle("org.apache.commons", "commons-jexl"),
                 mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.jexl.evaluator"),
-                mvnBundle("org.apache.xbean", "xbean-asm4-shaded"),
+                mvnBundle("org.apache.xbean", "xbean-asm5-shaded"),
                 mvnBundle("org.apache.xbean", "xbean-bundleutils"),
-                mvnBundle("org.apache.xbean", "xbean-finder-shaded"),
+                mvnBundle("org.apache.xbean", "xbean-finder"),
                 mvnBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", startBlueprint),
                 mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.api",
startBlueprint),
                 mvnBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint.core",
startBlueprint),

Modified: aries/trunk/blueprint/blueprint-sample-annotation/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-sample-annotation/pom.xml?rev=1690254&r1=1690253&r2=1690254&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-sample-annotation/pom.xml (original)
+++ aries/trunk/blueprint/blueprint-sample-annotation/pom.xml Fri Jul 10 13:25:13 2015
@@ -31,7 +31,7 @@
     <groupId>org.apache.aries.blueprint</groupId>
     <artifactId>org.apache.aries.blueprint.sample-annotation</artifactId>
     <name>Apache Aries Blueprint Sample for Testing Annotation</name>
-    <version>1.0.1-SNAPSHOT</version>
+    <version>1.1.0-SNAPSHOT</version>
     <packaging>bundle</packaging>
     <description>
         Example blueprint application, mostly used for annotation tests.

Added: aries/trunk/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/TestXmlConfigBean.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/TestXmlConfigBean.java?rev=1690254&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/TestXmlConfigBean.java
(added)
+++ aries/trunk/blueprint/blueprint-sample-annotation/src/main/java/org/apache/aries/blueprint/sample/TestXmlConfigBean.java
Fri Jul 10 13:25:13 2015
@@ -0,0 +1,17 @@
+package org.apache.aries.blueprint.sample;
+
+/**
+ * Created by Maxim Becker on 12.04.15.
+ */
+public class TestXmlConfigBean {
+
+    private String name;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

Added: aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/config.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/config.xml?rev=1690254&view=auto
==============================================================================
--- aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/config.xml
(added)
+++ aries/trunk/blueprint/blueprint-sample-annotation/src/main/resources/OSGI-INF/blueprint/config.xml
Fri Jul 10 13:25:13 2015
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+	<!--
+		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.
+	-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+	default-availability="optional">
+
+	<bean id="testXmlConfigBean" class="org.apache.aries.blueprint.sample.TestXmlConfigBean">
+		<property name="name" value="Test" />
+	</bean>
+</blueprint>
+



Mime
View raw message