You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jo...@apache.org on 2017/08/29 23:04:41 UTC

svn commit: r1806651 - in /geronimo/components/config/trunk/impl: internal-suite.xml pom.xml src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java

Author: johndament
Date: Tue Aug 29 23:04:41 2017
New Revision: 1806651

URL: http://svn.apache.org/viewvc?rev=1806651&view=rev
Log:
GERONIMO-6577 - Enabling the tests in jenkins.  Fixing the case where only providers are registered.

Added:
    geronimo/components/config/trunk/impl/internal-suite.xml
      - copied, changed from r1805840, geronimo/components/config/trunk/impl/tck-suite.xml
Modified:
    geronimo/components/config/trunk/impl/pom.xml
    geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
    geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java

Copied: geronimo/components/config/trunk/impl/internal-suite.xml (from r1805840, geronimo/components/config/trunk/impl/tck-suite.xml)
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/internal-suite.xml?p2=geronimo/components/config/trunk/impl/internal-suite.xml&p1=geronimo/components/config/trunk/impl/tck-suite.xml&r1=1805840&r2=1806651&rev=1806651&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/tck-suite.xml (original)
+++ geronimo/components/config/trunk/impl/internal-suite.xml Tue Aug 29 23:04:41 2017
@@ -1,27 +1,29 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 <!--
-    
-    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.
--->
+  ~  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.
+  -->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 <suite name="microprofileconfig-TCK" verbose="2" configfailurepolicy="continue" >
 
-    <test name="Microprofile-config 1_0 TCK">
+    <test name="Geronimo Tests">
         <packages>
-            <package name="org.eclipse.microprofile.config.tck.*">
+            <package name="org.apache.geronimo.config.test.internal.*">
             </package>
-
         </packages>
     </test>
 

Modified: geronimo/components/config/trunk/impl/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/pom.xml?rev=1806651&r1=1806650&r2=1806651&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/pom.xml (original)
+++ geronimo/components/config/trunk/impl/pom.xml Tue Aug 29 23:04:41 2017
@@ -88,6 +88,7 @@
                 <configuration>
                     <suiteXmlFiles>
                         <suiteXmlFile>tck-suite.xml</suiteXmlFile>
+                        <suiteXmlFile>internal-suite.xml</suiteXmlFile>
                     </suiteXmlFiles>
                     <environmentVariables>
                         <CDPATH>value-for-tck-since-we-ignore-empty</CDPATH>

Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java?rev=1806651&r1=1806650&r2=1806651&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java (original)
+++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java Tue Aug 29 23:04:41 2017
@@ -75,6 +75,13 @@ public class ConfigExtension implements
                 .map(ip -> REPLACED_TYPES.getOrDefault(ip.getType(), ip.getType()))
                 .collect(Collectors.toSet());
 
+        Set<Type> providerTypes = injectionPoints.stream()
+                .filter(NOT_PROVIDERS.negate())
+                .map(ip -> ((ParameterizedType)ip.getType()).getActualTypeArguments()[0])
+                .collect(Collectors.toSet());
+
+        types.addAll(providerTypes);
+
         types.stream()
                 .map(type -> new ConfigInjectionBean(bm, type))
                 .forEach(abd::addBean);

Modified: geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java
URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java?rev=1806651&r1=1806650&r2=1806651&view=diff
==============================================================================
--- geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java (original)
+++ geronimo/components/config/trunk/impl/src/test/java/org/apache/geronimo/config/test/internal/ProviderTest.java Tue Aug 29 23:04:41 2017
@@ -30,25 +30,21 @@ import org.jboss.shrinkwrap.api.spec.Web
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-
 public class ProviderTest extends Arquillian {
     private static final String SOME_KEY = "org.apache.geronimo.config.test.internal.somekey";
-    private static final String ANOTHER_KEY = "org.apache.geronimo.config.test.internal.anotherkey";
 
     @Deployment
     public static WebArchive deploy() {
         System.setProperty(SOME_KEY, "someval");
-        System.setProperty(ANOTHER_KEY, "someval");
         JavaArchive testJar = ShrinkWrap
                 .create(JavaArchive.class, "configProviderTest.jar")
                 .addClasses(ProviderTest.class, SomeBean.class)
                 .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
                 .as(JavaArchive.class);
 
-        WebArchive war = ShrinkWrap
+        return ShrinkWrap
                 .create(WebArchive.class, "providerTest.war")
                 .addAsLibrary(testJar);
-        return war;
     }
 
     private @Inject SomeBean someBean;
@@ -73,16 +69,9 @@ public class ProviderTest extends Arquil
         @ConfigProperty(name=SOME_KEY)
         private Provider<String> myconfig;
 
-        @Inject
-        @ConfigProperty(name=ANOTHER_KEY)
-        private Provider<String> anotherconfig;
-
         public String getMyconfig() {
             return myconfig.get();
         }
 
-        public Provider<String> getAnotherconfig() {
-            return anotherconfig;
-        }
     }
 }