tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: reactivating DependenceValidationTest + fixing new ContainerClassesFilter package
Date Sun, 01 Feb 2015 10:57:06 GMT
Repository: tomee
Updated Branches:
  refs/heads/develop b3cddbed0 -> ebe63371a


reactivating DependenceValidationTest + fixing new ContainerClassesFilter package


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

Branch: refs/heads/develop
Commit: ebe63371a22709a50e79c42206b5e9a0fd8946cc
Parents: b3cddbe
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Sun Feb 1 11:55:45 2015 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Sun Feb 1 11:55:45 2015 +0100

----------------------------------------------------------------------
 .../org/apache/openejb/bval/BValCdiFilter.java  |   2 +-
 .../openejb/config/ContainerClassesFilter.java  | 127 -------------------
 .../openejb/util/ContainerClassesFilter.java    | 127 +++++++++++++++++++
 .../openejb/DependenceValidationTest.java       |   3 +-
 .../config/ContainerClassesFilterTest.java      |   1 +
 .../org/apache/tomee/embedded/Container.java    |   2 +-
 6 files changed, 131 insertions(+), 131 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/container/openejb-core/src/main/java/org/apache/openejb/bval/BValCdiFilter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/bval/BValCdiFilter.java
b/container/openejb-core/src/main/java/org/apache/openejb/bval/BValCdiFilter.java
index fc383e2..12ca171 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/bval/BValCdiFilter.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/bval/BValCdiFilter.java
@@ -17,7 +17,7 @@
 package org.apache.openejb.bval;
 
 import org.apache.bval.cdi.BValExtension;
-import org.apache.openejb.config.ContainerClassesFilter;
+import org.apache.openejb.util.ContainerClassesFilter;
 
 import javax.enterprise.inject.spi.AnnotatedType;
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerClassesFilter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerClassesFilter.java
b/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerClassesFilter.java
deleted file mode 100644
index a6feb08..0000000
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ContainerClassesFilter.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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.openejb.config;
-
-import org.apache.openejb.loader.SystemInstance;
-import org.apache.openejb.util.classloader.URLClassLoaderFirst;
-import org.apache.xbean.finder.filter.Filter;
-
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-
-// a bit more brutal than URLClassLoaderFirst.shouldSkip
-public class ContainerClassesFilter implements Filter {
-    private static final String[] EMPTY_ARRAY = new String[0];
-
-    private final String[] forced;
-    private final String[] skipped;
-    private final Filter delegateAccept;
-    private final Filter delegateSkip;
-
-    public ContainerClassesFilter(final Properties configuration) {
-        final String forcedStr = configuration.getProperty("openejb.container.additional.exclude",
null);
-        final String skippedStr = configuration.getProperty("openejb.container.additional.include",
null);
-        forced = forcedStr == null ? EMPTY_ARRAY : forcedStr.split(" *, *");
-        skipped = skippedStr == null ? EMPTY_ARRAY : skippedStr.split(" *, *");
-
-        final Set<String> excluded = new HashSet<>();
-        excluded.add("javax");
-        excluded.add("org.apache.myfaces");
-        excluded.add("org.apache.cxf");
-        excluded.add("org.apache.oro");
-        excluded.add("org.apache.ws");
-        excluded.add("org.apache.jcp");
-        excluded.add("org.apache.openejb");
-        excluded.add("org.apache.tomee");
-        excluded.add("org.apache.tomcat");
-        excluded.add("org.apache.juli");
-        excluded.add("org.apache.johnzon");
-        excluded.add("org.apache.activemq");
-        excluded.add("org.apache.neethi");
-        excluded.add("org.apache.xml");
-        excluded.add("org.apache.velocity");
-        excluded.add("org.apache.wss4j");
-        excluded.add("org.apache.commons.logging");
-        excluded.add("org.metatype.sxc");
-        excluded.add("org.openejb");
-        excluded.add("org.slf4j");
-        excluded.add("org.fusesource.hawtbuf");
-        excluded.add("org.objectweb.howl");
-        excluded.add("org.joda.time");
-        excluded.add("org.codehaus.stax2");
-        excluded.add("org.jvnet.mimepull");
-        excluded.add("org.jasypt");
-        excluded.add("org.hamcrest");
-        excluded.add("org.swizzle");
-        excluded.add("com.ctc.wstx");
-        excluded.add("com.ibm.wsdl");
-        excluded.add("net.sf.ehcache");
-        excluded.add("junit");
-        excluded.add("serp");
-
-        final Set<String> included = new HashSet<>();
-        included.add("org.apache.myfaces.cdi");
-
-        delegateSkip = new OptimizedExclusionFilter(excluded);
-        delegateAccept = new OptimizedExclusionFilter(included);
-    }
-
-    public ContainerClassesFilter() {
-        this(SystemInstance.get().getProperties());
-    }
-
-    @Override
-    public boolean accept(final String name) {
-        if (forced != null && startsWith(forced, name)) {
-            return true;
-        }
-        if (skipped != null && startsWith(skipped, name)) {
-            return false;
-        }
-        return delegateAccept.accept(name) || (!delegateSkip.accept(name) && !URLClassLoaderFirst.shouldSkip(name));
-    }
-
-    private static boolean startsWith(final String[] array, String name) {
-        for (final String prefix : array) {
-            if (name.startsWith(prefix)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static class OptimizedExclusionFilter implements Filter {
-        private final Set<String> included;
-
-        public OptimizedExclusionFilter(final Set<String> exclusions) {
-            included = exclusions;
-        }
-
-        @Override
-        public boolean accept(final String name) {
-            int dot = name.indexOf('.');
-            while (dot > 0) {
-                if (included.contains(name.substring(0, dot))) {
-                    return true;
-                }
-                dot = name.indexOf('.', dot + 1);
-            }
-            return false;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/container/openejb-core/src/main/java/org/apache/openejb/util/ContainerClassesFilter.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/util/ContainerClassesFilter.java
b/container/openejb-core/src/main/java/org/apache/openejb/util/ContainerClassesFilter.java
new file mode 100644
index 0000000..94d61cd
--- /dev/null
+++ b/container/openejb-core/src/main/java/org/apache/openejb/util/ContainerClassesFilter.java
@@ -0,0 +1,127 @@
+/*
+ * 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.openejb.util;
+
+import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.util.classloader.URLClassLoaderFirst;
+import org.apache.xbean.finder.filter.Filter;
+
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+// a bit more brutal than URLClassLoaderFirst.shouldSkip
+public class ContainerClassesFilter implements Filter {
+    private static final String[] EMPTY_ARRAY = new String[0];
+
+    private final String[] forced;
+    private final String[] skipped;
+    private final Filter delegateAccept;
+    private final Filter delegateSkip;
+
+    public ContainerClassesFilter(final Properties configuration) {
+        final String forcedStr = configuration.getProperty("openejb.container.additional.exclude",
null);
+        final String skippedStr = configuration.getProperty("openejb.container.additional.include",
null);
+        forced = forcedStr == null ? EMPTY_ARRAY : forcedStr.split(" *, *");
+        skipped = skippedStr == null ? EMPTY_ARRAY : skippedStr.split(" *, *");
+
+        final Set<String> excluded = new HashSet<>();
+        excluded.add("javax");
+        excluded.add("org.apache.myfaces");
+        excluded.add("org.apache.cxf");
+        excluded.add("org.apache.oro");
+        excluded.add("org.apache.ws");
+        excluded.add("org.apache.jcp");
+        excluded.add("org.apache.openejb");
+        excluded.add("org.apache.tomee");
+        excluded.add("org.apache.tomcat");
+        excluded.add("org.apache.juli");
+        excluded.add("org.apache.johnzon");
+        excluded.add("org.apache.activemq");
+        excluded.add("org.apache.neethi");
+        excluded.add("org.apache.xml");
+        excluded.add("org.apache.velocity");
+        excluded.add("org.apache.wss4j");
+        excluded.add("org.apache.commons.logging");
+        excluded.add("org.metatype.sxc");
+        excluded.add("org.openejb");
+        excluded.add("org.slf4j");
+        excluded.add("org.fusesource.hawtbuf");
+        excluded.add("org.objectweb.howl");
+        excluded.add("org.joda.time");
+        excluded.add("org.codehaus.stax2");
+        excluded.add("org.jvnet.mimepull");
+        excluded.add("org.jasypt");
+        excluded.add("org.hamcrest");
+        excluded.add("org.swizzle");
+        excluded.add("com.ctc.wstx");
+        excluded.add("com.ibm.wsdl");
+        excluded.add("net.sf.ehcache");
+        excluded.add("junit");
+        excluded.add("serp");
+
+        final Set<String> included = new HashSet<>();
+        included.add("org.apache.myfaces.cdi");
+
+        delegateSkip = new OptimizedExclusionFilter(excluded);
+        delegateAccept = new OptimizedExclusionFilter(included);
+    }
+
+    public ContainerClassesFilter() {
+        this(SystemInstance.get().getProperties());
+    }
+
+    @Override
+    public boolean accept(final String name) {
+        if (forced != null && startsWith(forced, name)) {
+            return true;
+        }
+        if (skipped != null && startsWith(skipped, name)) {
+            return false;
+        }
+        return delegateAccept.accept(name) || (!delegateSkip.accept(name) && !URLClassLoaderFirst.shouldSkip(name));
+    }
+
+    private static boolean startsWith(final String[] array, String name) {
+        for (final String prefix : array) {
+            if (name.startsWith(prefix)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static class OptimizedExclusionFilter implements Filter {
+        private final Set<String> included;
+
+        public OptimizedExclusionFilter(final Set<String> exclusions) {
+            included = exclusions;
+        }
+
+        @Override
+        public boolean accept(final String name) {
+            int dot = name.indexOf('.');
+            while (dot > 0) {
+                if (included.contains(name.substring(0, dot))) {
+                    return true;
+                }
+                dot = name.indexOf('.', dot + 1);
+            }
+            return false;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
b/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
index 4c62fcd..02e2456 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/DependenceValidationTest.java
@@ -59,7 +59,6 @@ public class DependenceValidationTest extends TestCase {
         final String dynamicAssembler = "org.apache.openejb.assembler.dynamic";
         assertNotDependentOn("org.apache.openejb", "org.apache.openejb.assembler.classic",
"org.apache.openejb.config.typed.util", "org.apache.openejb.assembler", "org.apache.openejb.assembler.classic.util",
"org.apache.openejb.config", "org.apache.openejb.assembler.dynamic", "org.apache.openejb.assembler.classic.cmd",
"org.apache.openejb.assembler.monitoring", "org.apache.openejb.cdi", "org.apache.openejb.junit",
"org.apache.openejb.assembler.classic.event", "org.apache.openejb.web", "org.apache.openejb.testng",
"org.apache.openejb.testing");
 
-        /*
         // Nothing may depend on the Dynamic Assembler
         assertNotDependentOn("org.apache.openejb", dynamicAssembler);
 
@@ -76,7 +75,7 @@ public class DependenceValidationTest extends TestCase {
         assertNotDependentOn("org.apache.openejb", "org.apache.openejb.core.singleton", dynamicAssembler);
         assertNotDependentOn("org.apache.openejb", "org.apache.openejb.core.stateless", dynamicAssembler);
         assertNotDependentOn("org.apache.openejb", "org.apache.openejb.core.stateful", dynamicAssembler);
-        // TODO: This needs fixing... containers are supposed to be pluggable
+        /* TODO: This needs fixing... containers are supposed to be pluggable
         // assertNotDependentOn("org.apache.openejb", "org.apache.openejb.core.entity", dynamicAssembler);
          */
     }

http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/container/openejb-core/src/test/java/org/apache/openejb/config/ContainerClassesFilterTest.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/test/java/org/apache/openejb/config/ContainerClassesFilterTest.java
b/container/openejb-core/src/test/java/org/apache/openejb/config/ContainerClassesFilterTest.java
index 9c66825..4dbaf30 100644
--- a/container/openejb-core/src/test/java/org/apache/openejb/config/ContainerClassesFilterTest.java
+++ b/container/openejb-core/src/test/java/org/apache/openejb/config/ContainerClassesFilterTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.openejb.config;
 
+import org.apache.openejb.util.ContainerClassesFilter;
 import org.junit.Test;
 
 import java.util.Properties;

http://git-wip-us.apache.org/repos/asf/tomee/blob/ebe63371/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
index 600a148..0ef0cc4 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
@@ -46,7 +46,6 @@ import org.apache.openejb.assembler.classic.WebAppInfo;
 import org.apache.openejb.config.AnnotationDeployer;
 import org.apache.openejb.config.AppModule;
 import org.apache.openejb.config.ConfigurationFactory;
-import org.apache.openejb.config.ContainerClassesFilter;
 import org.apache.openejb.config.DeploymentLoader;
 import org.apache.openejb.config.DeploymentsResolver;
 import org.apache.openejb.config.EjbModule;
@@ -66,6 +65,7 @@ import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.loader.provisining.ProvisioningResolver;
 import org.apache.openejb.spi.ContainerSystem;
+import org.apache.openejb.util.ContainerClassesFilter;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
 import org.apache.tomee.catalina.TomEERuntimeException;


Mime
View raw message