Package org.picocontainer.doc.tutorial.interfaces

Source Code of org.picocontainer.doc.tutorial.interfaces.InterfacesTestCase

package org.picocontainer.doc.tutorial.interfaces;

import junit.framework.TestCase;
import org.picocontainer.MutablePicoContainer;
import org.picocontainer.defaults.DefaultPicoContainer;

public class InterfacesTestCase extends TestCase {
    public void testKissing() {
        MutablePicoContainer pico = new DefaultPicoContainer();
        pico.registerComponentImplementation(Boy.class);
        pico.registerComponentImplementation(Girl.class);

        Girl girl = (Girl) pico.getComponentInstance(Girl.class);
        girl.kissSomeone();
    }
}
TOP

Related Classes of org.picocontainer.doc.tutorial.interfaces.InterfacesTestCase

TOP
Copyright © 2018 www.massapi.com. 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.