Package org.codehaus.loom.components.assembler

Examples of org.codehaus.loom.components.assembler.Assembler


        provides[0].setAttribute( "role", role0 );
        provides[1] = new DefaultConfiguration( "provide", "", "" );
        provides[1].setAttribute( "name", name1 );
        provides[1].setAttribute( "role", role1 );

        final Assembler assembler = new Assembler();
        final DependencyDirective[] directives = assembler.buildDependencies( provides );

        assertEquals( provides.length, directives.length );
        assertEquals( name0, directives[0].getProviderName() );
        assertEquals( name1, directives[1].getProviderName() );
        assertEquals( role0, directives[0].getKey() );
View Full Code Here


        throws Exception
    {
        final String name = "Blah";
        final String alias = name;
        final String role = "com.biz.Service";
        final Assembler assembler = new Assembler();
        final DefaultConfiguration provide = new DefaultConfiguration( "provide", "", "" );
        provide.setAttribute( "name", name );
        provide.setAttribute( "role", role );
        final DependencyDirective directive =
            assembler.buildDependency( provide );
        assertEquals( "name", name, directive.getProviderName() );
        assertEquals( "role", role, directive.getKey() );
        assertEquals( "alias", alias, directive.getAlias() );
    }
View Full Code Here

        throws Exception
    {
        final String name = "Blah";
        final String alias = "Blee";
        final String role = "com.biz.Service";
        final Assembler assembler = new Assembler();
        final DefaultConfiguration provide = new DefaultConfiguration( "provide", "", "" );
        provide.setAttribute( "name", name );
        provide.setAttribute( "role", role );
        provide.setAttribute( "alias", alias );
        final DependencyDirective directive =
            assembler.buildDependency( provide );
        assertEquals( "name", name, directive.getProviderName() );
        assertEquals( "role", role, directive.getKey() );
        assertEquals( "alias", alias, directive.getAlias() );
    }
View Full Code Here

    }

    public void testBuildDependencyThatMissesName()
        throws Exception
    {
        final Assembler assembler = new Assembler();
        final DefaultConfiguration provide = new DefaultConfiguration( "provide", "", "" );
        provide.setAttribute( "role", "com.biz.Service" );
        try
        {
            assembler.buildDependency( provide );
        }
        catch( final ConfigurationException ce )
        {
            return;
        }
View Full Code Here

    }

    public void testBuildDependencyThatMissesRole()
        throws Exception
    {
        final Assembler assembler = new Assembler();
        final DefaultConfiguration provide = new DefaultConfiguration( "provide", "", "" );
        provide.setAttribute( "name", "MyService" );
        try
        {
            assembler.buildDependency( provide );
        }
        catch( final ConfigurationException ce )
        {
            return;
        }
View Full Code Here

    {
        final DefaultConfiguration listener = new DefaultConfiguration( "listner", "", "" );
        final DefaultConfiguration config = new DefaultConfiguration( "config",
                                                                      "",
                                                                      "" );
        final Assembler assembler = new Assembler();

        try
        {
            assembler.buildBlockListener( listener, config );
            fail( "buildBlockListner allowed no 'name' attribute" );
        }
        catch( LoomException e )
        {
            assertEquals( "Malformed listener entry in assembly.xml at \"\". " +
                          "(Reason: Attribute named name not specified.).",
                          e.getMessage() );
        }

        listener.setAttribute( "name", "foo" );

        try
        {
            assembler.buildBlockListener( listener, config );
            fail( "buildBlockListner allowed no 'class' attribute" );
        }
        catch( LoomException e )
        {
            assertEquals( "Malformed listener entry in assembly.xml at \"\". " +
View Full Code Here

TOP

Related Classes of org.codehaus.loom.components.assembler.Assembler

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.