tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-2266 upgrading bval tck and making tomee ones passing back
Date Tue, 30 Oct 2018 14:10:59 GMT
Repository: tomee
Updated Branches:
  refs/heads/master dfe07dd00 -> f815b5036


TOMEE-2266 upgrading bval tck and making tomee ones passing back


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f815b503
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f815b503
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f815b503

Branch: refs/heads/master
Commit: f815b503690c4ce395f3704430158c88680b4edc
Parents: dfe07dd
Author: Romain Manni-Bucau <rmannibucau@gmail.com>
Authored: Tue Oct 30 15:10:28 2018 +0100
Committer: Romain Manni-Bucau <rmannibucau@gmail.com>
Committed: Tue Oct 30 15:10:28 2018 +0100

----------------------------------------------------------------------
 .../util/classloader/URLClassLoaderFirst.java   | 36 ++++++++------------
 pom.xml                                         |  2 +-
 tck/bval-embedded/pom.xml                       |  7 +---
 tck/bval-tomee/pom.xml                          | 10 +++---
 .../src/test/resources/arquillian.xml           | 17 ++++++++-
 tck/bval-tomee/src/test/resources/dev.xml       |  6 +---
 tck/pom.xml                                     |  7 ++--
 7 files changed, 42 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
index c6c9bcf..d749584 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
@@ -48,6 +48,7 @@ public class URLClassLoaderFirst extends URLClassLoader {
     // - will not match anything, that's the desired default behavior
     public static final Collection<String> FORCED_SKIP = new ArrayList<>();
     public static final Collection<String> FORCED_LOAD = new ArrayList<>();
+    public static final Collection<String> FILTERABLE_RESOURCES = new ArrayList<>();
 
     static {
         reloadConfig();
@@ -61,14 +62,22 @@ public class URLClassLoaderFirst extends URLClassLoader {
     private static final boolean ALLOW_OPEN_EJB_SYSTEM_LOADING = !Boolean.getBoolean("openejb.classloader.first.disallow-system-loading");
 
     public static void reloadConfig() {
-        list(FORCED_SKIP, "openejb.classloader.forced-skip");
-        list(FORCED_LOAD, "openejb.classloader.forced-load");
+        list(FORCED_SKIP, "openejb.classloader.forced-skip", null);
+        list(FORCED_LOAD, "openejb.classloader.forced-load", null);
+        list(FILTERABLE_RESOURCES, "openejb.classloader.filterable-resources",
+                "META-INF/services/javax.validation.spi.ValidationProvider," +
+                "META-INF/services/javax.ws.rs.client.ClientBuilder," +
+                "META-INF/services/javax.json.spi.JsonProvider," +
+                "META-INF/services/javax.cache.spi.CachingProvider," +
+                "META-INF/javamail.default.providers,META-INF/javamail.default.address.map,"
+
+                "META-INF/javamail.charset.map,META-INF/mailcap," +
+                SLF4J_BINDER_CLASS);
     }
 
-    private static void list(final Collection<String> list, final String key) {
+    private static void list(final Collection<String> list, final String key, final
String def) {
         list.clear();
 
-        final String s = SystemInstance.get().getOptions().get(key, (String) null);
+        final String s = SystemInstance.get().getOptions().get(key, def);
         if (s != null && !s.trim().isEmpty()) {
             list.addAll(Arrays.asList(s.trim().split(",")));
         }
@@ -567,24 +576,7 @@ public class URLClassLoaderFirst extends URLClassLoader {
     public static boolean isFilterableResource(final String name) {
         // currently bean validation, Slf4j, myfaces (because of enrichment)
         return name != null
-            && (
-                // bval
-                "META-INF/services/javax.validation.spi.ValidationProvider".equals(name)
-                // jaxrs 2
-            || "META-INF/services/javax.ws.rs.client.ClientBuilder".equals(name)
-                // jsonp
-            || "META-INF/services/javax.json.spi.JsonProvider".equals(name)
-                // jcache
-            || "META-INF/services/javax.cache.spi.CachingProvider".equals(name)
-                // javamail
-            || "META-INF/javamail.default.providers".equals(name)
-            || "META-INF/javamail.default.address.map".equals(name)
-            || "META-INF/javamail.charset.map".equals(name)
-            || "META-INF/mailcap".equals(name)
-                // myfaces
-            || name.startsWith("META-INF/services/org.apache.myfaces.spi")
-                // slf4j
-            || SLF4J_BINDER_CLASS.equals(name));
+            && (FILTERABLE_RESOURCES.contains(name) || name.startsWith("META-INF/services/org.apache.myfaces.spi"));
     }
 
     public static boolean shouldSkipSlf4j(final ClassLoader loader, final String name) {

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a3d9fa8..42b6643 100644
--- a/pom.xml
+++ b/pom.xml
@@ -167,7 +167,7 @@
     <commons-io.version>2.4</commons-io.version>
     <commons-net.version>3.3</commons-net.version>
 
-    <bval.version>2.0.0-SNAPSHOT</bval.version>
+    <bval.version>2.0.1-SNAPSHOT</bval.version>
     <org.apache.activemq.version>5.15.6</org.apache.activemq.version>
     <org.springframework.version>3.1.4.RELEASE</org.springframework.version>
     <junit.version>4.12</junit.version>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/tck/bval-embedded/pom.xml
----------------------------------------------------------------------
diff --git a/tck/bval-embedded/pom.xml b/tck/bval-embedded/pom.xml
index 7c64e0f..a3b1139 100644
--- a/tck/bval-embedded/pom.xml
+++ b/tck/bval-embedded/pom.xml
@@ -27,11 +27,6 @@
   <artifactId>bval-embedded</artifactId>
   <name>OpenEJB :: TCK :: Bean Validation Embedded</name>
 
-  <properties>
-    <tck.version>2.0.3.Final</tck.version>
-    <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
-  </properties>
-
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
@@ -83,7 +78,7 @@
     <dependency>
       <groupId>org.hibernate.beanvalidation.tck</groupId>
       <artifactId>beanvalidation-tck-tests</artifactId>
-      <version>${tck.version}</version>
+      <version>${bval-tck.version}</version>
     </dependency>
     <dependency>
       <groupId>org.jboss.arquillian.testng</groupId>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/tck/bval-tomee/pom.xml
----------------------------------------------------------------------
diff --git a/tck/bval-tomee/pom.xml b/tck/bval-tomee/pom.xml
index f1b68f1..91e879a 100644
--- a/tck/bval-tomee/pom.xml
+++ b/tck/bval-tomee/pom.xml
@@ -29,8 +29,7 @@
 
   <properties>
     <openejb.home>${project.build.directory}${file.separator}apache-tomee-webprofile-${project.version}</openejb.home>
-    <tck.version>2.0.3.Final</tck.version>
-    <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
+    <suiteFile>${project.build.directory}/dependency/beanvalidation-tck-tests-suite.xml</suiteFile>
   </properties>
 
   <dependencies>
@@ -84,7 +83,7 @@
     <dependency>
       <groupId>org.hibernate.beanvalidation.tck</groupId>
       <artifactId>beanvalidation-tck-tests</artifactId>
-      <version>${tck.version}</version>
+      <version>${bval-tck.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -165,11 +164,12 @@
           </execution>
         </executions>
         <configuration>
+          <trimStackTrace>false</trimStackTrace>
           <systemPropertyVariables>
-            <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
+            <validation.provider>${validation.provider}</validation.provider>
           </systemPropertyVariables>
           <suiteXmlFiles>
-            <suiteXmlFile>${project.build.directory}/dependency/beanvalidation-tck-tests-suite.xml</suiteXmlFile>
+            <suiteXmlFile>${suiteFile}</suiteXmlFile>
           </suiteXmlFiles>
           <parallel>classes</parallel>
           <threadCount>1</threadCount>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/tck/bval-tomee/src/test/resources/arquillian.xml
----------------------------------------------------------------------
diff --git a/tck/bval-tomee/src/test/resources/arquillian.xml b/tck/bval-tomee/src/test/resources/arquillian.xml
index 706dc39..17f3d3f 100644
--- a/tck/bval-tomee/src/test/resources/arquillian.xml
+++ b/tck/bval-tomee/src/test/resources/arquillian.xml
@@ -31,7 +31,22 @@
       <property name="dir">target/tomee-tck</property>
       <property name="appWorkingDir">target/tck-workdir</property>
       <property name="simpleLog">true</property>
-      <property name="properties">validation.provider = org.apache.bval.jsr.ApacheValidationProvider</property>
+      <property name="properties">
+        validation.provider = org.apache.bval.jsr.ApacheValidationProvider
+
+        # disable our filtering feature for TCK - but it is important to keep it at runtime
since
+        # that's what users rely on
+        #
+        # note: this config just drop ValidationProvider from this list
+        #
+        openejb.classloader.filterable-resources = \
+          META-INF/services/javax.ws.rs.client.ClientBuilder,\
+          META-INF/services/javax.json.spi.JsonProvider,\
+          META-INF/services/javax.cache.spi.CachingProvider,\
+          META-INF/javamail.default.providers,META-INF/javamail.default.address.map,\
+          META-INF/javamail.charset.map,META-INF/mailcap,\
+          org/slf4j/impl/StaticLoggerBinder.class
+      </property>
     </configuration>
   </container>
 </arquillian>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/tck/bval-tomee/src/test/resources/dev.xml
----------------------------------------------------------------------
diff --git a/tck/bval-tomee/src/test/resources/dev.xml b/tck/bval-tomee/src/test/resources/dev.xml
index 7cdc1e8..3c73916 100644
--- a/tck/bval-tomee/src/test/resources/dev.xml
+++ b/tck/bval-tomee/src/test/resources/dev.xml
@@ -19,11 +19,7 @@
 <suite name="BVal-TCK" verbose="1">
     <test name="BVal-TCK">
       <classes>
-        <class name="org.hibernate.beanvalidation.tck.tests.valueextraction.declaration.ValueExtractorsPrecedenceTest"
/>
-        <!--
-        <class name="org.hibernate.beanvalidation.tck.tests.integration.cdi.managedobjects.ManagedValueExtractorsTest"
/>
-        <class name="org.hibernate.beanvalidation.tck.tests.valueextraction.declaration.MultipleValueExtractorsInValidationXmlForSameTypeAndTypeArgumentTest"
/>
-        -->
+        <class name="org.hibernate.beanvalidation.tck.tests.bootstrap.customprovider.BootstrapCustomProviderDefinedInServiceFileTest"
/>
       </classes>
     </test>
 </suite>

http://git-wip-us.apache.org/repos/asf/tomee/blob/f815b503/tck/pom.xml
----------------------------------------------------------------------
diff --git a/tck/pom.xml b/tck/pom.xml
index 0e268d0..7005970 100644
--- a/tck/pom.xml
+++ b/tck/pom.xml
@@ -29,17 +29,18 @@
 
   <properties>
     <cdi.tck.20.version>2.0.3.Final</cdi.tck.20.version>
+
+    <bval-tck.version>2.0.4.Final</bval-tck.version>
+    <validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
   </properties>
 
   <modules>
     <module>tck-common</module>
     <module>cdi-embedded</module>
     <module>cdi-tomee</module>
+    <module>bval-embedded</module>
     <module>bval-tomee</module>
     <module>microprofile-tck</module>
-
-    <!-- TODO: either really use this module or delete it -->
-    <module>bval-embedded</module>
   </modules>
 
   <repositories>


Mime
View raw message