trial classloader

This commit is contained in:
Jesse McConnell 2011-10-28 11:14:14 -05:00
parent 5c516c9e7b
commit 148459bc8f
3 changed files with 49 additions and 1 deletions

View File

@ -37,7 +37,11 @@ public class Slf4jLog implements Logger
}
catch (ClassNotFoundException ex)
{
<<<<<<< Updated upstream
ex.printStackTrace(System.err);
=======
ex.printStackTrace();
>>>>>>> Stashed changes
throw new NoClassDefFoundError("org.slf4j.impl.StaticLoggerBinder");
}

View File

@ -61,7 +61,6 @@ public class LogTest
}
@Test
@Ignore
public void testNamedLogNamed_Slf4J() throws Exception
{
Log.setLog(new Slf4jLog());

View File

@ -26,6 +26,46 @@ public class Slf4jTestJarsRunner extends BlockJUnit4ClassRunner
super(urls);
}
@Override
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
{
System.err.printf("[slf4j.cl] loadClass(%s)%n", name);
ClassNotFoundException ex= null;
Class<?> c = null;
try
{
c = this.findClass(name);
if ( resolve )
{
resolveClass(c);
}
return c;
}
catch (ClassNotFoundException e)
{
ex= e;
}
if ( c == null )
{
try
{
c = super.loadClass(name,resolve);
}
catch (ClassNotFoundException e)
{
ex= e;
}
}
throw ex;
}
@Override
public Class<?> loadClass(String name) throws ClassNotFoundException
{
@ -100,6 +140,11 @@ public class Slf4jTestJarsRunner extends BlockJUnit4ClassRunner
System.out.println("Classpath entry: " + url);
}
for ( URL url : urls )
{
System.out.println(url.toString());
}
slf4jClassLoader = new Slf4jTestClassLoader(urls);
}
catch (MalformedURLException e)