Hibernate SVN: r20867 - in beanvalidation/tck/trunk: src/main/java/org/hibernate/jsr303/tck/tests/bootstrap and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-11-17 05:07:14 -0500 (Wed, 17 Nov 2010)
New Revision: 20867
Added:
beanvalidation/tck/trunk/foo.txt
Modified:
beanvalidation/tck/trunk/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/ValidationProviderResolverTest.java
Log:
testing ro access to repo
Added: beanvalidation/tck/trunk/foo.txt
===================================================================
Modified: beanvalidation/tck/trunk/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/ValidationProviderResolverTest.java
===================================================================
--- beanvalidation/tck/trunk/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/ValidationProviderResolverTest.java 2010-11-17 10:02:57 UTC (rev 20866)
+++ beanvalidation/tck/trunk/src/main/java/org/hibernate/jsr303/tck/tests/bootstrap/ValidationProviderResolverTest.java 2010-11-17 10:07:14 UTC (rev 20867)
@@ -68,10 +68,22 @@
}
private List<Class<?>> readBeanValidationServiceFile() {
- ClassLoader classloader = Thread.currentThread().getContextClassLoader();
- if ( classloader == null ) {
- classloader = ValidationProviderResolverTest.class.getClassLoader();
+ List<Class<?>> providers = new ArrayList<Class<?>>();
+
+ // first check application classpath
+ ClassLoader classloader = ValidationProviderResolverTest.class.getClassLoader();
+ providers.addAll( getProviderListFromClassLoader( classloader ));
+
+ // then the context classpath
+ classloader = Thread.currentThread().getContextClassLoader();
+ if ( classloader != null ) {
+ providers.addAll( getProviderListFromClassLoader( classloader ) );
}
+
+ return providers;
+ }
+
+ private List<Class<?>> getProviderListFromClassLoader(ClassLoader classloader) {
List<Class<?>> providers = new ArrayList<Class<?>>();
try {