[jboss-cvs] JBossAS SVN: r95109 - in projects/jboss-cl/branches/Branch_2_0: classloader/src/main/java/org/jboss/classloader/spi/filter and 8 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Oct 19 08:22:20 EDT 2009
Author: adrian at jboss.org
Date: 2009-10-19 08:22:20 -0400 (Mon, 19 Oct 2009)
New Revision: 95109
Added:
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilterUtils.java
Modified:
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/ParentPolicy.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilter.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/FilteredDelegateLoader.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/LazyFilteredDelegateLoader.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/test/support/IsolatedClassLoaderTestHelper.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/delegate/test/DelegateLoaderUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/CustomParentLoaderUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentClassLoaderUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentLoaderUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/ParentPolicyUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/filter/test/FilterUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/jbcl114/test/CachingClassesUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/policy/test/ClassLoaderPolicyUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/MockClassLoadingMetaDataUnitTestCase.java
projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/metadata/test/ClassLoadingMetaDataUnitTestCase.java
Log:
[JBCL-123] - Avoid recursive static initializers
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/ParentPolicy.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/ParentPolicy.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/ParentPolicy.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -22,6 +22,7 @@
package org.jboss.classloader.spi;
import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
/**
* ParentPolicy
@@ -32,19 +33,19 @@
public class ParentPolicy
{
/** Standard Java Delegation */
- public static final ParentPolicy BEFORE = new ParentPolicy(ClassFilter.EVERYTHING, ClassFilter.NOTHING, "BEFORE");
+ public static final ParentPolicy BEFORE = new ParentPolicy(ClassFilterUtils.EVERYTHING, ClassFilterUtils.NOTHING, "BEFORE");
/** Servlet style */
- public static final ParentPolicy AFTER = new ParentPolicy(ClassFilter.NOTHING_BUT_JAVA, ClassFilter.EVERYTHING, "AFTER");
+ public static final ParentPolicy AFTER = new ParentPolicy(ClassFilterUtils.NOTHING_BUT_JAVA, ClassFilterUtils.EVERYTHING, "AFTER");
/** Standard Java Delegation for java classes */
- public static final ParentPolicy BEFORE_BUT_JAVA_ONLY = new ParentPolicy(ClassFilter.JAVA_ONLY, ClassFilter.NOTHING, "BEFORE_BUT_JAVA_ONLY");
+ public static final ParentPolicy BEFORE_BUT_JAVA_ONLY = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, ClassFilterUtils.NOTHING, "BEFORE_BUT_JAVA_ONLY");
/** Java and Javax classes before, everything else after */
- public static final ParentPolicy AFTER_BUT_JAVA_BEFORE = new ParentPolicy(ClassFilter.JAVA_ONLY, ClassFilter.EVERYTHING, "AFTER_BUT_JAVA_BEFORE");
+ public static final ParentPolicy AFTER_BUT_JAVA_BEFORE = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, ClassFilterUtils.EVERYTHING, "AFTER_BUT_JAVA_BEFORE");
/** Java classes before, everything else after */
- public static final ParentPolicy AFTER_BUT_ONLY_JAVA_BEFORE = new ParentPolicy(ClassFilter.NOTHING_BUT_JAVA, ClassFilter.EVERYTHING, "AFTER_BUT_JAVA_BEFORE");
+ public static final ParentPolicy AFTER_BUT_ONLY_JAVA_BEFORE = new ParentPolicy(ClassFilterUtils.NOTHING_BUT_JAVA, ClassFilterUtils.EVERYTHING, "AFTER_BUT_JAVA_BEFORE");
/** The before filter */
private ClassFilter beforeFilter;
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilter.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilter.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilter.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -36,16 +36,28 @@
*/
public interface ClassFilter extends Serializable
{
- /** Match evertything */
+ /** Match evertything
+ *
+ * @deprecated use {@link ClassFilterUtils#EVERYTHING}
+ */
ClassFilter EVERYTHING = EverythingClassFilter.INSTANCE;
- /** Match nothing */
+ /** Match nothing
+ *
+ * @deprecated use {@link ClassFilterUtils#NOTHING}
+ */
ClassFilter NOTHING = NothingClassFilter.INSTANCE;
- /** Match nothing */
+ /** Match nothing
+ *
+ * @deprecated use {@link ClassFilterUtils#NOTHING_BUT_JAVA}
+ */
ClassFilter NOTHING_BUT_JAVA = NothingButJavaClassFilter.INSTANCE;
- /** Java Only */
+ /** Java Only
+ *
+ * @deprecated use {@link ClassFilterUtils#JAVA_ONLY}
+ */
ClassFilter JAVA_ONLY = JavaOnlyClassFilter.INSTANCE;
/**
Added: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilterUtils.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilterUtils.java (rev 0)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/ClassFilterUtils.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -0,0 +1,124 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.classloader.spi.filter;
+
+import java.util.List;
+
+import org.jboss.classloader.plugins.filter.EverythingClassFilter;
+import org.jboss.classloader.plugins.filter.JavaOnlyClassFilter;
+import org.jboss.classloader.plugins.filter.NothingButJavaClassFilter;
+import org.jboss.classloader.plugins.filter.NothingClassFilter;
+
+/**
+ * ClassFilterUtils.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassFilterUtils
+{
+ /** Match evertything */
+ public static final ClassFilter EVERYTHING = EverythingClassFilter.INSTANCE;
+
+ /** Match nothing */
+ public static final ClassFilter NOTHING = NothingClassFilter.INSTANCE;
+
+ /** Match nothing */
+ public static final ClassFilter NOTHING_BUT_JAVA = NothingButJavaClassFilter.INSTANCE;
+
+ /** Java Only */
+ public static final ClassFilter JAVA_ONLY = JavaOnlyClassFilter.INSTANCE;
+
+ /**
+ * Create a package class filter<p>
+ *
+ * Creates the filter from a comma seperated list
+ *
+ * @param string the string
+ * @return the filter
+ */
+ public static PackageClassFilter createPackageClassFilterFromString(String string)
+ {
+ return PackageClassFilter.createPackageClassFilterFromString(string);
+ }
+
+ /**
+ * Create a new package class filter
+ *
+ * @param packageNames the package names
+ * @return the filter
+ * @throws IllegalArgumentException for null packageNames
+ */
+ public static PackageClassFilter createPackageClassFilter(String... packageNames)
+ {
+ return PackageClassFilter.createPackageClassFilter(packageNames);
+ }
+
+ /**
+ * Create a new package class filter
+ *
+ * @param packageNames the package names
+ * @return the filter
+ * @throws IllegalArgumentException for null packageNames
+ */
+ public static PackageClassFilter createPackageClassFilter(List<String> packageNames)
+ {
+ return PackageClassFilter.createPackageClassFilter(packageNames);
+ }
+
+ /**
+ * Create a recursive package class filter<p>
+ *
+ * Creates the filter from a comma seperated list
+ *
+ * @param string the string
+ * @return the filter
+ */
+ public static RecursivePackageClassFilter createRecursivePackageClassFilterFromString(String string)
+ {
+ return RecursivePackageClassFilter.createRecursivePackageClassFilterFromString(string);
+ }
+
+ /**
+ * Create a new recursive package class filter
+ *
+ * @param packageNames the package names
+ * @return the filter
+ * @throws IllegalArgumentException for null packageNames
+ */
+ public static RecursivePackageClassFilter createRecursivePackageClassFilter(String... packageNames)
+ {
+ return RecursivePackageClassFilter.createRecursivePackageClassFilter(packageNames);
+ }
+
+ /**
+ * Create a new recursive package class filter
+ *
+ * @param packageNames the package names
+ * @return the filter
+ * @throws IllegalArgumentException for null packageNames
+ */
+ public static RecursivePackageClassFilter createRecursivePackageClassFilter(List<String> packageNames)
+ {
+ return RecursivePackageClassFilter.createRecursivePackageClassFilter(packageNames);
+ }
+}
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/FilteredDelegateLoader.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/FilteredDelegateLoader.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/FilteredDelegateLoader.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -53,7 +53,7 @@
*/
public FilteredDelegateLoader(ClassLoaderPolicy delegate)
{
- this(delegate, ClassFilter.EVERYTHING);
+ this(delegate, ClassFilterUtils.EVERYTHING);
}
/**
@@ -79,7 +79,7 @@
*/
public FilteredDelegateLoader(ClassLoaderPolicyFactory factory)
{
- this(factory, ClassFilter.EVERYTHING);
+ this(factory, ClassFilterUtils.EVERYTHING);
}
/**
@@ -115,7 +115,7 @@
protected void setFilter(ClassFilter filter)
{
if (filter == null)
- this.filter = ClassFilter.EVERYTHING;
+ this.filter = ClassFilterUtils.EVERYTHING;
else
this.filter = filter;
}
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/LazyFilteredDelegateLoader.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/LazyFilteredDelegateLoader.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/spi/filter/LazyFilteredDelegateLoader.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -40,7 +40,7 @@
*/
public LazyFilteredDelegateLoader(ClassLoaderPolicyFactory factory)
{
- super(factory, ClassFilter.EVERYTHING);
+ super(factory, ClassFilterUtils.EVERYTHING);
}
@Override
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/test/support/IsolatedClassLoaderTestHelper.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/test/support/IsolatedClassLoaderTestHelper.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/main/java/org/jboss/classloader/test/support/IsolatedClassLoaderTestHelper.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -41,6 +41,7 @@
import org.jboss.classloader.spi.Loader;
import org.jboss.classloader.spi.ParentPolicy;
import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.spi.filter.FilteredDelegateLoader;
import org.jboss.classloader.spi.filter.PackageClassFilter;
import org.jboss.logging.Logger;
@@ -227,7 +228,7 @@
// The parent filter
PackageClassFilter filter = new PackageClassFilter(parentPackages);
filter.setIncludeJava(true);
- return initializeClassLoader(clazz, system, filter, ClassFilter.NOTHING, policy);
+ return initializeClassLoader(clazz, system, filter, ClassFilterUtils.NOTHING, policy);
}
/**
@@ -281,7 +282,7 @@
PackageClassFilter filter = new PackageClassFilter(parentPkgs);
filter.setIncludeJava(true);
CombiningClassFilter beforeFilter = CombiningClassFilter.create(filter, parentFilter);
- ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, ClassFilterUtils.NOTHING);
return initializeClassLoader(clazz, system, parentPolicy, policy);
}
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/delegate/test/DelegateLoaderUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/delegate/test/DelegateLoaderUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/delegate/test/DelegateLoaderUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -26,7 +26,7 @@
import org.jboss.classloader.plugins.ClassLoaderUtils;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.DelegateLoader;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.spi.filter.FilteredDelegateLoader;
import org.jboss.classloader.spi.filter.LazyFilteredDelegateLoader;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
@@ -73,7 +73,7 @@
policy.setPathsAndPackageNames(TestA1.class);
system.registerClassLoaderPolicy(policy);
- FilteredDelegateLoader delegate = new FilteredDelegateLoader(policy, ClassFilter.NOTHING);
+ FilteredDelegateLoader delegate = new FilteredDelegateLoader(policy, ClassFilterUtils.NOTHING);
assertLoadClassFail(TestA1.class, delegate);
}
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/CustomParentLoaderUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/CustomParentLoaderUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/CustomParentLoaderUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -23,6 +23,7 @@
import java.util.HashSet;
import java.util.Set;
+
import javax.management.MBeanRegistration;
import junit.framework.Test;
@@ -34,7 +35,7 @@
import org.jboss.classloader.spi.Loader;
import org.jboss.classloader.spi.ParentPolicy;
import org.jboss.classloader.spi.base.BaseClassLoaderDomain;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTestWithSecurity;
import org.jboss.test.classloader.domain.support.MockLoader;
@@ -118,7 +119,7 @@
ClassLoaderSystem system = createClassLoaderSystem();
MockLoader loader = new MockLoader();
NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, loader);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -198,7 +199,7 @@
ClassLoaderSystem system = createClassLoaderSystem();
MockLoader loader = new MockLoader();
NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, loader);
domain.setUseLoadClassForParent(false);
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentClassLoaderUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentClassLoaderUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentClassLoaderUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -28,7 +28,7 @@
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.Loader;
import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTestWithSecurity;
import org.jboss.test.classloader.domain.support.MockLoader;
@@ -142,7 +142,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
- ParentPolicy pp = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy pp = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
@@ -257,7 +257,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
- ParentPolicy pp = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy pp = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentLoaderUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentLoaderUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/HierarchicalParentLoaderUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -27,7 +27,7 @@
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.Loader;
import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTestWithSecurity;
import org.jboss.test.classloader.domain.support.MockLoader;
@@ -128,7 +128,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
- ParentPolicy pp = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy pp = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
ClassLoaderDomain child = system.createAndRegisterDomain("child", pp, parent);
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/ParentPolicyUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/ParentPolicyUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/domain/test/ParentPolicyUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -28,7 +28,7 @@
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.spi.filter.PackageClassFilter;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTestWithSecurity;
@@ -198,7 +198,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -215,7 +215,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
MatchClassFilter filter = new MatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -232,7 +232,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.JAVA_ONLY, filter);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -249,7 +249,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.JAVA_ONLY, filter);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -264,7 +264,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
MatchClassFilter filter = new MatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.JAVA_ONLY, filter);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
@@ -279,7 +279,7 @@
public void testNoMatchBeforeAndAfter() throws Exception
{
ClassLoaderSystem system = createClassLoaderSystem();
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.NOTHING, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.NOTHING, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
@@ -290,7 +290,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
PackageClassFilter filter = PackageClassFilter.createPackageClassFilter("dummy");
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
@@ -302,7 +302,7 @@
ClassLoaderSystem system = createClassLoaderSystem();
PackageClassFilter filter = PackageClassFilter.createPackageClassFilter("dummy");
filter.setIncludeJava(true);
- ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/filter/test/FilterUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/filter/test/FilterUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/filter/test/FilterUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -24,6 +24,7 @@
import junit.framework.Test;
import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.test.classloader.AbstractClassLoaderTestWithSecurity;
/**
@@ -46,7 +47,7 @@
public void testEverything() throws Exception
{
- ClassFilter filter = ClassFilter.EVERYTHING;
+ ClassFilter filter = ClassFilterUtils.EVERYTHING;
assertFilterMatchesClassName("gibberish", filter);
assertFilterMatchesClassName("", filter);
assertFilterMatchesClassName(null, filter);
@@ -60,7 +61,7 @@
public void testNothing() throws Exception
{
- ClassFilter filter = ClassFilter.NOTHING;
+ ClassFilter filter = ClassFilterUtils.NOTHING;
assertFilterNoMatchClassName("gibberish", filter);
assertFilterNoMatchClassName("", filter);
assertFilterNoMatchClassName(null, filter);
@@ -74,7 +75,7 @@
public void testJavaOnly() throws Exception
{
- ClassFilter filter = ClassFilter.JAVA_ONLY;
+ ClassFilter filter = ClassFilterUtils.JAVA_ONLY;
assertFilterMatchesClassName("java.x", filter);
assertFilterMatchesClassName("java.lang.Object", filter);
assertFilterMatchesClassName("java.lang.ref.Method", filter);
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/jbcl114/test/CachingClassesUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/jbcl114/test/CachingClassesUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/jbcl114/test/CachingClassesUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -30,7 +30,7 @@
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTest;
import org.jboss.test.classloader.domain.support.NoMatchClassFilter;
@@ -63,7 +63,7 @@
{
ClassLoaderSystem system = createBlockingClassLoaderSystem();
NoMatchClassFilter filter = new NoMatchClassFilter(ClassLoaderDomain.class);
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.JAVA_ONLY, filter);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
BlockingClassLoaderDomain domain = (BlockingClassLoaderDomain) system.createAndRegisterDomain("test", parentPolicy, null);
MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
Modified: projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/policy/test/ClassLoaderPolicyUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/policy/test/ClassLoaderPolicyUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloader/src/test/java/org/jboss/test/classloader/policy/test/ClassLoaderPolicyUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -36,7 +36,7 @@
import org.jboss.classloader.spi.ClassLoaderDomain;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloader.spi.ParentPolicy;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloader.spi.filter.FilteredDelegateLoader;
import org.jboss.classloader.test.support.MockClassLoaderPolicy;
import org.jboss.test.classloader.AbstractClassLoaderTest;
@@ -122,7 +122,7 @@
{
ClassLoaderSystem system = createClassLoaderSystem();
// Hide java
- ParentPolicy parentPolicy = new ParentPolicy(ClassFilter.NOTHING, ClassFilter.NOTHING);
+ ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.NOTHING, ClassFilterUtils.NOTHING);
ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy);
TestClassLoaderPolicy policy = new TestClassLoaderPolicy();
ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
Modified: projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/MockClassLoadingMetaDataUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/MockClassLoadingMetaDataUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/dependency/test/MockClassLoadingMetaDataUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -28,7 +28,7 @@
import junit.framework.Test;
import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloading.spi.dependency.policy.mock.MockClassLoaderPolicyModule;
import org.jboss.classloading.spi.dependency.policy.mock.MockClassLoadingMetaData;
import org.jboss.classloading.spi.metadata.Capability;
@@ -159,12 +159,12 @@
public void testIncluded() throws Exception
{
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
- a.setIncluded(ClassFilter.JAVA_ONLY);
+ a.setIncluded(ClassFilterUtils.JAVA_ONLY);
KernelControllerContext contextA = install(a);
try
{
MockClassLoaderPolicyModule module = assertModule(contextA);
- assertEquals(ClassFilter.JAVA_ONLY, module.getIncluded());
+ assertEquals(ClassFilterUtils.JAVA_ONLY, module.getIncluded());
}
finally
{
@@ -176,12 +176,12 @@
public void testExcluded() throws Exception
{
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
- a.setExcluded(ClassFilter.JAVA_ONLY);
+ a.setExcluded(ClassFilterUtils.JAVA_ONLY);
KernelControllerContext contextA = install(a);
try
{
MockClassLoaderPolicyModule module = assertModule(contextA);
- assertEquals(ClassFilter.JAVA_ONLY, module.getExcluded());
+ assertEquals(ClassFilterUtils.JAVA_ONLY, module.getExcluded());
}
finally
{
@@ -193,12 +193,12 @@
public void testExcludedExport() throws Exception
{
MockClassLoadingMetaData a = new MockClassLoadingMetaData("a");
- a.setExcludedExport(ClassFilter.JAVA_ONLY);
+ a.setExcludedExport(ClassFilterUtils.JAVA_ONLY);
KernelControllerContext contextA = install(a);
try
{
MockClassLoaderPolicyModule module = assertModule(contextA);
- assertEquals(ClassFilter.JAVA_ONLY, module.getExcludedExport());
+ assertEquals(ClassFilterUtils.JAVA_ONLY, module.getExcludedExport());
}
finally
{
Modified: projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/metadata/test/ClassLoadingMetaDataUnitTestCase.java
===================================================================
--- projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/metadata/test/ClassLoadingMetaDataUnitTestCase.java 2009-10-19 11:52:26 UTC (rev 95108)
+++ projects/jboss-cl/branches/Branch_2_0/classloading/src/test/java/org/jboss/test/classloading/metadata/test/ClassLoadingMetaDataUnitTestCase.java 2009-10-19 12:22:20 UTC (rev 95109)
@@ -27,6 +27,7 @@
import junit.framework.Test;
import org.jboss.classloader.spi.filter.ClassFilter;
+import org.jboss.classloader.spi.filter.ClassFilterUtils;
import org.jboss.classloading.spi.metadata.CapabilitiesMetaData;
import org.jboss.classloading.spi.metadata.Capability;
import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
@@ -211,14 +212,14 @@
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
- test.setIncluded(ClassFilter.JAVA_ONLY);
+ test.setIncluded(ClassFilterUtils.JAVA_ONLY);
filter = test.getIncluded();
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
test.setIncludedPackages(null);
filter = test.getIncluded();
- assertEquals(ClassFilter.JAVA_ONLY, filter);
+ assertEquals(ClassFilterUtils.JAVA_ONLY, filter);
assertTrue(filter.matchesClassName(Object.class.getName()));
assertTrue(filter.matchesClassName(Collection.class.getName()));
}
@@ -233,14 +234,14 @@
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
- test.setExcluded(ClassFilter.JAVA_ONLY);
+ test.setExcluded(ClassFilterUtils.JAVA_ONLY);
filter = test.getExcluded();
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
test.setExcludedPackages(null);
filter = test.getExcluded();
- assertEquals(ClassFilter.JAVA_ONLY, filter);
+ assertEquals(ClassFilterUtils.JAVA_ONLY, filter);
assertTrue(filter.matchesClassName(Object.class.getName()));
assertTrue(filter.matchesClassName(Collection.class.getName()));
}
@@ -255,14 +256,14 @@
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
- test.setExcludedExport(ClassFilter.JAVA_ONLY);
+ test.setExcludedExport(ClassFilterUtils.JAVA_ONLY);
filter = test.getExcludedExport();
assertTrue(filter.matchesClassName(Object.class.getName()));
assertFalse(filter.matchesClassName(Collection.class.getName()));
test.setExcludedExportPackages(null);
filter = test.getExcludedExport();
- assertEquals(ClassFilter.JAVA_ONLY, filter);
+ assertEquals(ClassFilterUtils.JAVA_ONLY, filter);
assertTrue(filter.matchesClassName(Object.class.getName()));
assertTrue(filter.matchesClassName(Collection.class.getName()));
}
More information about the jboss-cvs-commits
mailing list