openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1610771 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java webbeans-tomcat7/src/it/servletinjection/pom.xml
Date Tue, 15 Jul 2014 17:48:41 GMT
Author: rmannibucau
Date: Tue Jul 15 17:48:41 2014
New Revision: 1610771

URL: http://svn.apache.org/r1610771
Log:
OWB-985 tomcat 7.0.54 - updating integration tetss

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
    openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/pom.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java?rev=1610771&r1=1610770&r2=1610771&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/corespi/scanner/AbstractMetaDataDiscovery.java
Tue Jul 15 17:48:41 2014
@@ -49,6 +49,8 @@ import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import static java.util.Arrays.asList;
+
 
 public abstract class AbstractMetaDataDiscovery implements ScannerService
 {
@@ -229,45 +231,16 @@ public abstract class AbstractMetaDataDi
 
     protected void filterExcludedJars(Set<URL> classPathUrls)
     {
-        Iterator<URL> it = classPathUrls.iterator();
+        final Iterator<URL> it = classPathUrls.iterator();
         while (it.hasNext())
         {
-            URL url = it.next();
-            String path = url.toExternalForm();
-            if (path.contains("/jre/lib") ||
-                path.contains("/Contents/Home/") ||
-                path.contains("/dt.jar") ||
-                path.contains("/tools.jar") ||
-                path.contains("/asm") ||
-                path.contains("/javassist") ||
-                path.contains("/xbean-") ||
-                path.contains("/jconsole.jar") ||
-                path.contains("/geronimo-") ||
-                path.contains("/commons-") ||
-                path.contains("/arquillian-") ||
-                path.contains("/bsh-") ||
-                path.contains("/shrinkwrap-") ||
-                path.contains("/junit-") ||
-                path.contains("/testng-") ||
-                path.contains("/openjpa-") ||
-                path.contains("/bcel") ||
-                path.contains("/hamcrest") ||
-                path.contains("/mysql-connector") ||
-                path.contains("/testng") ||
-                path.contains("/idea_rt") ||
-                path.contains("/eclipse") ||
-                path.contains("/jcommander") ||
-                path.contains("/tomcat") ||
-                path.contains("/catalina") ||
-                path.contains("/jasper") ||
-                path.contains("/jsp-api") ||
-                path.contains("/myfaces-") ||
-                path.contains("/servlet-api") ||
-                path.contains("/javax") ||
-                path.contains("/annotation-api") ||
-                path.contains("/el-api") ||
-                path.contains("/mojarra") ||
-                path.contains("/openwebbeans-"))
+            final URL url = it.next();
+            final String path = url.toExternalForm();
+            // TODO: should extract file path and test file.getName(), not the whole path
+            // + should be configurable
+            final int knownJarIdx = isKnownJar(path);
+            // -Prun-its openwebbeans-tomcat7 in path but WEB-INF/classes
+            if (knownJarIdx > 0 && knownJarIdx < path.indexOf(".jar"))
             {
                 //X TODO this should be much more actually
                 //X TODO we might need to configure it via files
@@ -276,6 +249,53 @@ public abstract class AbstractMetaDataDi
         }
     }
 
+    private int isKnownJar(final String path)
+    {
+        for (final String p : asList(
+                                "/jre/lib",
+                                "/Contents/Home/",
+                                "/dt.jar",
+                                "/tools.jar",
+                                "/asm",
+                                "/javassist",
+                                "/xbean-",
+                                "/jconsole.jar",
+                                "/geronimo-",
+                                "/commons-",
+                                "/arquillian-",
+                                "/bsh-",
+                                "/shrinkwrap-",
+                                "/junit-",
+                                "/testng-",
+                                "/openjpa-",
+                                "/bcel",
+                                "/hamcrest",
+                                "/mysql-connector",
+                                "/testng",
+                                "/idea_rt",
+                                "/eclipse",
+                                "/jcommander",
+                                "/tomcat",
+                                "/catalina",
+                                "/jasper",
+                                "/jsp-api",
+                                "/myfaces-",
+                                "/servlet-api",
+                                "/javax",
+                                "/annotation-api",
+                                "/el-api",
+                                "/mojarra",
+                                "/openwebbeans-"))
+        {
+            final int i = path.indexOf(p);
+            if (i > 0)
+            {
+                return i;
+            }
+        }
+        return -1;
+    }
+
 
     @Override
     public void release()

Modified: openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/pom.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/pom.xml?rev=1610771&r1=1610770&r2=1610771&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/pom.xml (original)
+++ openwebbeans/trunk/webbeans-tomcat7/src/it/servletinjection/pom.xml Tue Jul 15 17:48:41
2014
@@ -32,7 +32,7 @@
 
     <properties>
         <tomcat.port.it>9081</tomcat.port.it>
-        <tomcat7.version>7.0.30</tomcat7.version>
+        <tomcat7.version>7.0.54</tomcat7.version>
         <jstl.version>1.2</jstl.version>
         <projectStage>Development</projectStage>
     </properties>
@@ -42,7 +42,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.8.2</version>
+            <version>4.11</version>
             <scope>test</scope>
         </dependency>
 
@@ -233,7 +233,7 @@
                         <dependency>
                             <groupId>org.apache.geronimo.specs</groupId>
                             <artifactId>geronimo-jcdi_1.1_spec</artifactId>
-                            <version>1.0</version>
+                            <version>1.0-SNAPSHOT</version>
                         </dependency>
 
                         <dependency>
@@ -245,7 +245,7 @@
                         <dependency>
                             <groupId>org.apache.geronimo.specs</groupId>
                             <artifactId>geronimo-interceptor_1.2_spec</artifactId>
-                            <version>1.0</version>
+                            <version>1.0-SNAPSHOT</version>
                         </dependency>
                     </dependencies>
                 </plugin>



Mime
View raw message