aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alien11...@apache.org
Subject svn commit: r1778900 - in /aries/trunk/blueprint/plugin: ./ blueprint-maven-plugin-annotation/ blueprint-maven-plugin-spi/ blueprint-maven-plugin/ blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/ blueprint-maven-plugin/src/te...
Date Sun, 15 Jan 2017 10:30:15 GMT
Author: alien11689
Date: Sun Jan 15 10:30:15 2017
New Revision: 1778900

URL: http://svn.apache.org/viewvc?rev=1778900&view=rev
Log:
[ARIES-1663] Generate reference id without dash when filter is not provided

Added:
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean7.java
      - copied, changed from r1778754, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean6.java
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceD.java
Modified:
    aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml
    aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/pom.xml
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/GeneratorTest.java
    aries/trunk/blueprint/plugin/pom.xml

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml (original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation/pom.xml Sun Jan 15 10:30:15
2017
@@ -5,13 +5,13 @@
         <groupId>org.apache.aries</groupId>
         <artifactId>parent</artifactId>
         <version>2.0.1</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
     <groupId>org.apache.aries.blueprint</groupId>
     <artifactId>blueprint-maven-plugin-annotation</artifactId>
     <packaging>bundle</packaging>
     <version>1.0.1-SNAPSHOT</version>
-    <name>Apache Aries Blueprint Plugin Annotations</name>
+    <name>Apache Aries Blueprint Maven Plugin Annotations</name>
 
     <scm>
         <connection>scm:svn:http://svn.apache.org/repos/asf/aries/trunk/blueprint/plugin/blueprint-maven-plugin-annotation</connection>

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/pom.xml?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/pom.xml (original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-spi/pom.xml Sun Jan 15 10:30:15 2017
@@ -6,7 +6,7 @@
         <groupId>org.apache.aries</groupId>
         <artifactId>parent</artifactId>
         <version>2.0.1</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
     <groupId>org.apache.aries.blueprint</groupId>
@@ -31,5 +31,5 @@
         </plugins>
     </build>
 
-    <name>Apache Aries Blueprint Plugin Spi</name>
+    <name>Apache Aries Blueprint Maven Plugin SPI</name>
 </project>

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml (original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/pom.xml Sun Jan 15 10:30:15 2017
@@ -25,7 +25,7 @@
         <groupId>org.apache.aries</groupId>
         <artifactId>parent</artifactId>
         <version>2.0.1</version>
-        <relativePath>../../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
     <groupId>org.apache.aries.blueprint</groupId>

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/pax/OsgiServiceHandler.java
Sun Jan 15 10:30:15 2017
@@ -141,7 +141,7 @@ public class OsgiServiceHandler implemen
         final public String compName;
 
         public ServiceFilter(String filterValue) {
-            if (filterValue == null) {
+            if (filterValue == null || filterValue.isEmpty()) {
                 filter = null;
                 compName = null;
             } else if (filterValue.contains("(")) {

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/GeneratorTest.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/GeneratorTest.java?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/GeneratorTest.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/GeneratorTest.java
Sun Jan 15 10:30:15 2017
@@ -25,6 +25,7 @@ import org.apache.aries.blueprint.plugin
 import org.apache.aries.blueprint.plugin.test.MyProduced;
 import org.apache.aries.blueprint.plugin.test.ServiceA;
 import org.apache.aries.blueprint.plugin.test.ServiceB;
+import org.apache.aries.blueprint.plugin.test.ServiceD;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.xbean.finder.ClassFinder;
 import org.junit.BeforeClass;
@@ -68,7 +69,7 @@ public class GeneratorTest {
         String packageName = MyBean1.class.getPackage().getName();
         Set<Class<?>> beanClasses = findClasses(classFinder, Collections.singletonList(packageName));
         Set<String> namespaces = new HashSet<String>(Arrays.asList(NS_JPA, NS_TX1));
-        Map<String,String> customParameters = new HashMap<>();
+        Map<String, String> customParameters = new HashMap<>();
         customParameters.put("ex.t", "1");
         customParameters.put("example.p1", "v1");
         customParameters.put("example.p2", "v2");
@@ -105,12 +106,12 @@ public class GeneratorTest {
             defs.add(new TransactionalDef(xpath.evaluate("@method", tx), xpath.evaluate("@value",
tx)));
         }
         Set<TransactionalDef> expectedDefs = Sets.newHashSet(new TransactionalDef("*",
"RequiresNew"),
-            new TransactionalDef("txNotSupported", "NotSupported"),
-            new TransactionalDef("txMandatory", "Mandatory"),
-            new TransactionalDef("txNever", "Never"),
-            new TransactionalDef("txRequired", "Required"),
-            new TransactionalDef("txOverridenWithRequiresNew", "RequiresNew"),
-            new TransactionalDef("txSupports", "Supports"));
+                new TransactionalDef("txNotSupported", "NotSupported"),
+                new TransactionalDef("txMandatory", "Mandatory"),
+                new TransactionalDef("txNever", "Never"),
+                new TransactionalDef("txRequired", "Required"),
+                new TransactionalDef("txOverridenWithRequiresNew", "RequiresNew"),
+                new TransactionalDef("txSupports", "Supports"));
         assertEquals(expectedDefs, defs);
     }
 
@@ -125,12 +126,12 @@ public class GeneratorTest {
             defs.add(new TransactionalDef(xpath.evaluate("@method", tx), xpath.evaluate("@value",
tx)));
         }
         Set<TransactionalDef> expectedDefs = Sets.newHashSet(new TransactionalDef("*",
"RequiresNew"),
-            new TransactionalDef("txNotSupported", "NotSupported"),
-            new TransactionalDef("txMandatory", "Mandatory"),
-            new TransactionalDef("txNever", "Never"),
-            new TransactionalDef("txRequired", "Required"),
-            new TransactionalDef("txOverridenWithRequiresNew", "RequiresNew"),
-            new TransactionalDef("txSupports", "Supports"));
+                new TransactionalDef("txNotSupported", "NotSupported"),
+                new TransactionalDef("txMandatory", "Mandatory"),
+                new TransactionalDef("txNever", "Never"),
+                new TransactionalDef("txRequired", "Required"),
+                new TransactionalDef("txOverridenWithRequiresNew", "RequiresNew"),
+                new TransactionalDef("txSupports", "Supports"));
         assertEquals(expectedDefs, defs);
     }
 
@@ -187,7 +188,7 @@ public class GeneratorTest {
             interfaceNames.add(interfaceValue.getTextContent());
         }
         assertEquals(Sets.newHashSet(ServiceA.class.getName(), ServiceB.class.getName()),
-            interfaceNames);
+                interfaceNames);
     }
 
     @Test
@@ -342,6 +343,14 @@ public class GeneratorTest {
     }
 
     @Test
+    public void testGenerateReferenceWithoutFilterAndComponentName() throws Exception {
+        Node reference = getReferenceById("serviceD");
+        assertXpathEquals(reference, "@interface", ServiceD.class.getName());
+        assertXpathDoesNotExist(reference, "@filter");
+        assertXpathDoesNotExist(reference, "@component-name");
+    }
+
+    @Test
     public void testLazyWithTrueBeanHasActivationEager() throws Exception {
         Node bean = getBeanById("beanWithSetters");
 
@@ -502,7 +511,7 @@ public class GeneratorTest {
     }
 
     private static Document readToDocument(ByteArrayOutputStream os) throws ParserConfigurationException,
-        SAXException, IOException {
+            SAXException, IOException {
         InputStream is = new ByteArrayInputStream(os.toByteArray());
         DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = builderFactory.newDocumentBuilder();

Copied: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean7.java
(from r1778754, aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean6.java)
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean7.java?p2=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean7.java&p1=aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean6.java&r1=1778754&r2=1778900&rev=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean6.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/MyBean7.java
Sun Jan 15 10:30:15 2017
@@ -18,19 +18,14 @@
  */
 package org.apache.aries.blueprint.plugin.test;
 
-import org.springframework.context.annotation.DependsOn;
+import org.ops4j.pax.cdi.api.OsgiService;
 
-import javax.inject.Named;
 import javax.inject.Singleton;
 
 @Singleton
-@DependsOn
-public class MyBean6 {
+public class MyBean7 {
 
-    @SuppressWarnings("unused")
-    private final ServiceA serviceA1;
+    public MyBean7(@OsgiService ServiceD serviceD) {
 
-    public MyBean6(@Named("my2") ServiceA serviceA1) {
-        this.serviceA1 = serviceA1;
     }
 }

Added: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceD.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceD.java?rev=1778900&view=auto
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceD.java
(added)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/java/org/apache/aries/blueprint/plugin/test/ServiceD.java
Sun Jan 15 10:30:15 2017
@@ -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.
+ */
+package org.apache.aries.blueprint.plugin.test;
+
+public interface ServiceD {
+}

Modified: aries/trunk/blueprint/plugin/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/pom.xml?rev=1778900&r1=1778899&r2=1778900&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/pom.xml (original)
+++ aries/trunk/blueprint/plugin/pom.xml Sun Jan 15 10:30:15 2017
@@ -25,12 +25,11 @@
         <groupId>org.apache.aries</groupId>
         <artifactId>parent</artifactId>
         <version>2.0.1</version>
-        <relativePath>../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
-    <groupId>org.apache.aries</groupId>
     <artifactId>plugin-parent</artifactId>
-    <name>Apache Aries Blueprint plugin parent</name>
+    <name>Apache Aries Blueprint Maven Plugin Parent</name>
     <packaging>pom</packaging>
     <version>1.0.0-SNAPSHOT</version>
 



Mime
View raw message