Package org.xeustechnologies.jcl.context

Examples of org.xeustechnologies.jcl.context.JclContextLoader


    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()
View Full Code Here

TOP

Related Classes of org.xeustechnologies.jcl.context.JclContextLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.