All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.picocontainer.defaults.issues.Issue0369TestCase Maven / Gradle / Ivy

There is a newer version: 2.15
Show newest version
package org.picocontainer.defaults.issues;

import org.junit.Test;
import org.picocontainer.ComponentAdapter;
import org.picocontainer.PicoCompositionException;
import org.picocontainer.PicoContainer;
import org.picocontainer.PicoVisitor;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

import static junit.framework.Assert.assertSame;

public class Issue0369TestCase {

    @Test
    public void simpleProofOfChangeInGetComponent() {
        MyAdapter mya = new MyAdapter();
        Class componentImplementation = mya.getComponentImplementation();
        assertSame(ArrayList.class, componentImplementation);
    }

    public class MyAdapter implements ComponentAdapter {

        private Class implementationclass = ArrayList.class;

        public Class getComponentImplementation() {
            return implementationclass;
        }

        public Object getComponentKey() {
            return null;
        }

        public List getComponentInstance(PicoContainer container) throws PicoCompositionException {
            return null;
        }

        public List getComponentInstance(PicoContainer container, Type into) throws PicoCompositionException {
            return null;
        }

        public void verify(PicoContainer container) throws PicoCompositionException {

        }

        public void accept(PicoVisitor visitor) {

        }

        public ComponentAdapter getDelegate() {
            return null;
        }

        public  U findAdapterOfType(Class adapterType) {
            return null;
        }

        public String getDescriptor() {
            return null;
        }
    }

}