Permalink
Browse files
Probably found a bug. Fixed Components.
- Loading branch information...
|
|
@@ -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