Examples of importClass()


Examples of org.apache.tapestry5.ioc.services.ClassFactory.importClass()

    public void import_ordinary_class()
    {
        ClassFactory factory = new ClassFactoryImpl();

        assertSame(factory.importClass(Object.class), Object.class);
        assertSame(factory.importClass(LocationImpl.class), LocationImpl.class);
    }

    /**
     * Import a class where the bytecode is not available, to ensure that the super-class (from an available class
     * loader) is returned.
View Full Code Here

Examples of org.apache.tapestry5.ioc.services.ClassFactory.importClass()

        Class alienClass = cf.createClass();

        ClassFactory factory = new ClassFactoryImpl();

        assertSame(factory.importClass(alienClass), clazz);
    }
}
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

                context.put( "smf-classLoader",
                             cl );
            }

            Importer importer = rule.getImporter( );
            clazz = importer.importClass( cl,
                                          className );

            // make sure field getter exists
            clazz.getMethod( "get" + fieldName.toUpperCase( ).charAt( 0 ) + fieldName.substring( 1 ),
                             (Class[]) null );
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

                context.put( "smf-classLoader",
                             cl );
            }

            Importer importer = rule.getImporter( );
            clazz = importer.importClass( cl,
                                          className );
        }
        catch ( ClassNotFoundException e )
        {
            throw new FactoryException( e.getMessage( ) );
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

                context.put( "smf-classLoader",
                             cl );
            }

            Importer importer = ruleSet.getImporter( );
            clazz = importer.importClass( cl,
                                          className );
        }
        catch ( ClassNotFoundException e )
        {
            throw new FactoryException( e.getMessage( ) );
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

        /* static import, should work */
        ClassLoader cl = getClass( ).getClassLoader( );
        try
        {
            Class clazz = importer.importClass( cl,
                                                "HashMap" );
            assertSame( java.util.HashMap.class,
                        clazz );
        }
        catch ( ClassNotFoundException e )
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

        }

        /* static import, should fail */
        try
        {
            Class clazz = importer.importClass( cl,
                                                "ArrayList" );
            fail( "Class ArrayList should not be found" );
        }
        catch ( ClassNotFoundException e )
        {
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

        ClassLoader cl = getClass( ).getClassLoader( );

        /* dynamic import, should work */
        try
        {
            Class clazz = importer.importClass( cl,
                                                "HashMap" );
            assertSame( java.util.HashMap.class,
                        clazz );
        }
        catch ( ClassNotFoundException e )
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

        }

        /* dynamic import, should throw ClassNotFoundException */
        try
        {
            Class clazz = importer.importClass( cl,
                                                "NoneExistingClass" );
            fail( "Class NoneExistingClass should not be found" );
        }
        catch ( ClassNotFoundException e )
        {
View Full Code Here

Examples of org.drools.spi.Importer.importClass()

        /* dynamic import, should fail and throw Error */
        importer.addImport( new DefaultImportEntry( "java.awt.*" ) );
        try
        {
            Class clazz = importer.importClass( cl,
                                                "List" );
            fail( "Should fail as imports are ambiguous for List" );
        }
        catch ( ClassNotFoundException e )
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.