[picocontainer-scm] [jira] (PICO-397) as() does not work correctly for any containers based on AbstractDelegatingMutablePicoContainer

"Michael Rimov (JIRA)" <jira-yCVjj/[email protected]> Fri, 31 May 2013 22:29:52 -0500 (CDT)
Newsgroups gmane.comp.java.picocontainer.cvs
Message-ID <JIRA.146429.1370057334770.34123.1370057392821@codehaus01.managed.contegix.com>
Michael Rimov
created PICO-397

as() does not work correctly for any containers based on AbstractDelegatingMutablePicoContainer

Issue Type:

Bug

Assignee:

Michael Rimov

Components:

PicoContainer (Java)

Created:

31/May/13 10:28 PM

Description:

The following test case will fail on any container based on AbstractDelegatingPicoContainer:

@Test
public void testAsPropagatesForExactlyOneInvocation() {
MutablePicoContainer mpc = createPicoContainer(null);
mpc.change(Characteristics.CACHE);

mpc
.as(Characteristics.CACHE).addComponent("bufferTwo", StringBuffer.class, DefaultConstructorParameter.INSTANCE)
.as(Characteristics.NO_CACHE).addComponent("bufferOne", StringBuffer.class, DefaultConstructorParameter.INSTANCE)
.addComponent("bufferThree", StringBuffer.class, DefaultConstructorParameter.INSTANCE);

assertNotSame(mpc.getComponent("bufferOne"), mpc.getComponent("bufferOne"));
assertSame(mpc.getComponent("bufferTwo"), mpc.getComponent("bufferTwo"));

//Default behavior is caching.
assertSame(mpc.getComponent("bufferThree"), mpc.getComponent("bufferThree"));

}

Fix Versions:

3.0

Project:

PicoContainer

Priority:

Major

Reporter:

Michael Rimov

This message is automatically generated by JIRA.

If you think it was sent incorrectly, please contact your JIRA administrators

For more information on JIRA, see: http://www.atlassian.com/software/jira

----------

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email