Package org.nanocontainer.nanowar.webwork

Examples of org.nanocontainer.nanowar.webwork.TestAction


        requestMock.expects(atLeastOnce()).method("getAttribute").with(eq(KeyConstants.REQUEST_CONTAINER)).will(
                returnValue(container));
        requestMock.expects(atLeastOnce()).method("setAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER),
                isA(MutablePicoContainer.class));
    container.registerComponentInstance("foo");
    TestAction action = (TestAction) factory
        .buildBean("org.nanocontainer.nanowar.webwork.TestAction");
    assertNotNull(action);
    assertEquals("foo", action.getFoo());
  }
View Full Code Here


                returnValue(null));
        requestMock.expects(atLeastOnce()).method("getAttribute").with(eq(KeyConstants.REQUEST_CONTAINER)).will(
                returnValue(container));
        requestMock.expects(atLeastOnce()).method("setAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER),
                isA(MutablePicoContainer.class));
        TestAction action = null;
        try {
            action = (TestAction) factory
                            .buildBean("org.nanocontainer.nanowar.webwork.TestAction");
            fail("should have barfed");
        } catch (UnsatisfiableDependenciesException e) {
View Full Code Here

                returnValue(container));
        requestMock.expects(atLeastOnce()).method("setAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER),
                isA(MutablePicoContainer.class));
        container.registerComponentInstance("foo");
        container.registerComponentImplementation(TestAction.class);
        TestAction action1 = (TestAction) container.getComponentInstance(TestAction.class);
        TestAction action2 = (TestAction) factory
                .buildBean("org.nanocontainer.nanowar.webwork.TestAction");
        assertSame(action1, action2);
    }
View Full Code Here

    public void testActionInstantiationWhichHasAlreadyBeenRequested() throws Exception {
        requestMock.expects(atLeastOnce()).method("getAttribute").with(eq(KeyConstants.ACTIONS_CONTAINER)).will(
                returnValue(container));
        container.registerComponentInstance("foo");
        TestAction action1 = (TestAction) factory
                .buildBean("org.nanocontainer.nanowar.webwork.TestAction");
        TestAction action2 = (TestAction) factory
                .buildBean("org.nanocontainer.nanowar.webwork.TestAction");
        assertSame(action1, action2);
    }
View Full Code Here

TOP

Related Classes of org.nanocontainer.nanowar.webwork.TestAction

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.