Package org.apache.fulcrum.yaafi

Examples of org.apache.fulcrum.yaafi.TestComponent


     * @throws Exception
     */
    private void checkTestComponent()
        throws Exception
    {
        TestComponent testComponent = (TestComponent) container.lookup(
            TestComponent.ROLE
            );

        testComponent.test();

        assertEquals( testComponent.getBar(), "BAR" );
        assertEquals( testComponent.getFoo(), "FOO" );

        assertNotNull( testComponent.getUrnAvalonClassLoader() );
        assertNotNull( testComponent.getUrnAvaloneHome() );
        assertNotNull( testComponent.getUrnAvaloneTemp() );
        assertNotNull( testComponent.getUrnAvalonName() );
        assertNotNull( testComponent.getUrnAvalonPartition() );
    }
View Full Code Here


    /**
     * Create an exception which should be handled by the JAMon interceptor.
     */
    public void testException() throws Exception
    {
      TestComponent testComponent = (TestComponent) container.lookup(
          TestComponent.ROLE
          );

      try
      {
          testComponent.createException("testException", this);
      }
      catch(Exception e)
      {
          return;
      }
View Full Code Here

    }

    private void checkTestComponent()
        throws Exception
    {
        TestComponent testComponent = this.getTestComponent();

        testComponent.test();

        assertEquals( testComponent.getBar(), "BAR" );
        assertEquals( testComponent.getFoo(), "FOO" );

        assertNotNull( testComponent.getUrnAvalonClassLoader() );
        assertNotNull( testComponent.getUrnAvaloneHome() );
        assertNotNull( testComponent.getUrnAvaloneTemp() );
        assertNotNull( testComponent.getUrnAvalonName() );
        assertNotNull( testComponent.getUrnAvalonPartition() );

        try
        {
            testComponent.createException("enforce exception", this);
        }
        catch( Exception e )
        {
            // nothing to do
        }
View Full Code Here

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration configuration = builder.buildFromFile( "./src/test/TestReconfigurationConfig.xml" );
        System.out.println(ConfigurationUtil.toString(configuration));

        this.container.reconfigure( configuration );
        TestComponent testComponent = this.getTestComponent();
        testComponent.test();

        // the TestReconfigurationConfig.xml overwrites the
        // TestComponentImpl.foo and the SystemProperty.FOO

        assertEquals( System.getProperty("FOO"), "YAAFI" );
        assertEquals( testComponent.getFoo(), "YAAFI" );

    }
View Full Code Here

TOP

Related Classes of org.apache.fulcrum.yaafi.TestComponent

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.