Permalink
Browse files

Probably found a bug. Fixed Components.

  • Loading branch information...
stephan
stephan committed Apr 6, 2005
1 parent 907f1f7 commit 2d5b49856000832ab7a88acc69dd4b3c919baab2
BIN +3.46 KB (100%) lib/junit.jar
Binary file not shown.
@@ -0,0 +1,13 @@
package org.snipsnap.test.container;

import junit.framework.TestCase;
import org.snipsnap.container.PicoContainer;
import org.snipsnap.container.Container;

public class PicoContainerTest extends TestCase {
public void testFindComponents() {
Container container = new PicoContainer();
container.addComponent(TestService.class);
assertTrue("findComponents finds one component", container.findComponents(TestService.class).size() == 1);
}
}
@@ -0,0 +1,4 @@
package org.snipsnap.test.container;

public class TestService {
}
@@ -32,7 +32,7 @@

private static Container container;

private static synchronized Container getContainer() {
public static synchronized Container getContainer() {
if (null == container) {
container = new PicoContainer();
container.init();
@@ -47,6 +47,7 @@
private static org.picocontainer.MutablePicoContainer container;

public PicoContainer() {
container = new DefaultPicoContainer();
}

public void init() {
@@ -58,7 +59,7 @@ public void init() {

DynaopComponentAdapterFactory factory = new DynaopComponentAdapterFactory(
new DefaultComponentAdapterFactory(), aspects);
MutablePicoContainer container = new DefaultPicoContainer(factory);
container = new DefaultPicoContainer(factory);


Globals globals = ConfigurationProxy.getInstance();

0 comments on commit 2d5b498

Please sign in to comment.