1 package org.picocontainer.alternatives.issues; 2 3 import junit.framework.TestCase; 4 5 import org.picocontainer.MutablePicoContainer; 6 import org.picocontainer.alternatives.ImplementationHidingPicoContainer; 7 import org.picocontainer.defaults.VerifyingVisitor; 8 9 public class Issue0214TestCase extends TestCase { 10 11 public void testTheBug() { 13 final MutablePicoContainer pico = new ImplementationHidingPicoContainer(); 14 pico.registerComponentImplementation(A.class); 15 16 23 pico.registerComponentImplementation(I1.class, B.class, null); 24 25 33 pico.registerComponentImplementation(I2.class, C.class); 34 35 52 new VerifyingVisitor().traverse(pico); 53 } 54 55 public static interface I1 { 56 } 57 58 public static interface I2 { 59 } 60 61 public static class A { 62 public A() { 63 } 64 } 65 66 public static class B implements I1 { 67 public B(final A a) { 68 } 69 } 70 71 public static class C implements I2 { 72 public C(final A a) { 73 } 74 } 75 } 76 | Popular Tags |