1 /****************************************************************************** 2 * Copyright (C) PicoContainer Organization. All rights reserved. * 3 * ------------------------------------------------------------------------- * 4 * The software in this package is published under the terms of the BSD * 5 * style license a copy of which has been included with this distribution in * 6 * the LICENSE.txt file. * 7 * * 8 * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant * 9 *****************************************************************************/ 10 11 package picocontainer.hierarchical; 12 13 import junit.framework.TestCase; 14 import picocontainer.PicoInitializationException; 15 16 import java.lang.reflect.InvocationTargetException; 17 18 public class DummiesTestCase extends TestCase { 19 20 public void testDummyContainer() { 21 picocontainer.defaults.NullContainer dc = new picocontainer.defaults.NullContainer(); 22 assertFalse(dc.hasComponent(String.class)); 23 assertNull(dc.getComponent(String.class)); 24 assertEquals(0, dc.getComponents().length); 25 } 26 27 public void testDefaultComponentFactory() throws PicoInitializationException, 28 NoSuchMethodException, 29 InvocationTargetException, 30 IllegalAccessException, 31 InstantiationException { 32 picocontainer.defaults.DefaultComponentFactory dcd = new picocontainer.defaults.DefaultComponentFactory(); 33 Object decorated = dcd.createComponent(Object.class, Object.class.getConstructor(null), null); 34 assertNotNull(decorated); 35 //TODO check no methods were called, via proxy ? 36 37 } 38 39 40 }

This page was automatically generated by Maven