using the direct url to springsource's junit bundle seems to have worked. thus cleaning up the code.

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1303524 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java b/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
index 1e112b6..7c5d0cc 100644
--- a/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
+++ b/src/test/java/org/apache/sling/commons/classloader/it/DynamicClassLoaderIT.java
@@ -16,9 +16,7 @@
  */
 package org.apache.sling.commons.classloader.it;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 import static org.ops4j.pax.exam.Constants.*;
 import static org.ops4j.pax.exam.CoreOptions.*;
 
@@ -39,9 +37,6 @@
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.ops4j.pax.exam.junit.ProbeBuilder;
 import org.ops4j.pax.exam.options.AbstractDelegateProvisionOption;
-import org.ops4j.pax.exam.options.CompositeOption;
-import org.ops4j.pax.exam.options.DefaultCompositeOption;
-import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -112,64 +107,14 @@
                 mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.2.14"),
                 mavenBundle("org.ops4j.pax.url", "pax-url-mvn", "1.3.5")
              ),
-             customJunitBundles()
-
+             // below is instead of normal Pax Exam junitBundles() to deal
+             // with build server issue
+             new DirectURLJUnitBundlesOption(), 
+             systemProperty("pax.exam.invoker").value("junit"),  
+             bundle("link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link")
         );
     }
-    
-    private static CompositeOption customJunitBundles() {
-        return new DefaultCompositeOption(new JUnitBundlesOption(), 
-            systemProperty( "pax.exam.invoker" ).value( "junit" ),  
-            bundle( "link:classpath:META-INF/links/org.ops4j.pax.exam.invoker.junit.link" ));
-    }
-    
-    public static class JUnitBundlesOption
-        extends AbstractDelegateProvisionOption<JUnitBundlesOption> {
-    
-        /**
-         * Constructor.
-         */
-        public JUnitBundlesOption(){
-            super(
-                bundle("http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.9.0/com.springsource.org.junit-4.9.0.jar")
-            );
-            noUpdate();
-            startLevel( START_LEVEL_SYSTEM_BUNDLES );
-        }
-    
-        /**
-         * Sets the junit version.
-         *
-         * @param version junit version.
-         *
-         * @return itself, for fluent api usage
-         */
-        public JUnitBundlesOption version( final String version ) {
-            ( (MavenArtifactProvisionOption) getDelegate() ).version( version );
-            return this;
-        }
-    
-        /**
-         * {@inheritDoc}
-         */
-        @Override
-        public String toString() {
-            final StringBuilder sb = new StringBuilder();
-            sb.append( "JUnitBundlesOption" );
-            sb.append( "{url=" ).append( getURL() );
-            sb.append( '}' );
-            return sb.toString();
-        }
-    
-        /**
-         * {@inheritDoc}
-         */
-        protected JUnitBundlesOption itself() {
-            return this;
-        }
-    
-    }
-
+        
     @Test
     public void testPackageAdminClassLoader() throws Exception {
         // check class loader
@@ -217,4 +162,40 @@
             fail("Class should be available");
         }
     }
+
+    /**
+     * Clone of Pax Exam's JunitBundlesOption which uses a direct
+     * URL to the SpringSource JUnit bundle to avoid some weird
+     * repository issues on the Apache build server.
+     */
+    private static class DirectURLJUnitBundlesOption
+        extends AbstractDelegateProvisionOption<DirectURLJUnitBundlesOption> {
+    
+        /**
+         * Constructor.
+         */
+        public DirectURLJUnitBundlesOption(){
+            super(
+                bundle("http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.9.0/com.springsource.org.junit-4.9.0.jar")
+            );
+            noUpdate();
+            startLevel(START_LEVEL_SYSTEM_BUNDLES);
+        }
+
+        /**
+         * {@inheritDoc}
+         */
+        @Override
+        public String toString() {
+            return String.format("DirectURLJUnitBundlesOption{url=%s}", getURL());
+        }
+    
+        /**
+         * {@inheritDoc}
+         */
+        protected DirectURLJUnitBundlesOption itself() {
+            return this;
+        }
+    
+    }
 }
\ No newline at end of file