public void testDefaultContextLoader() throws InstantiationException, IllegalAccessException,
ClassNotFoundException {
JarClassLoader jc = new JarClassLoader( new String[] { "./target/test-jcl.jar" } );
try {
JclContextLoader contextLoader = new DefaultContextLoader( jc );
throw new AssertionFailedError( "Expected JclContextException" );
} catch (JclContextException e) {
// Expected because the context is already loaded by the previous
// test "testXmlContextLoader()"
}
// Destroy existing context loaded by testXmlContextLoader()
JclContext.destroy();
JclContextLoader contextLoader = new DefaultContextLoader( jc );
contextLoader.loadContext();
// Test context
Object testObj = JclContext.get().loadClass( "org.xeustechnologies.jcl.test.Test" ).newInstance();
assertNotNull( testObj );
assertEquals( "org.xeustechnologies.jcl.JarClassLoader", testObj.getClass().getClassLoader().getClass()