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 * Original code by Paul Hammant * 9 *****************************************************************************/ 10 11 package org.picocontainer.alternatives; 12 13 import org.jmock.MockObjectTestCase; 14 15 /** 16 * @author Paul Hammant 17 * @version $Revision: 2024 $ 18 */ 19 public class RootVisitingLifecycleManagerTestCase extends MockObjectTestCase { 20 21 public void testNothing() { 22 // My major problem with this testcase (renamed from DefaultLifecycleTestCase) is that is was not testing lifecycle 23 // events. Specifically start, stop and dispose. It was insteat testing traversal. The clue is the mocking 24 // only of the invocation of 'traverse' in each of the three nethods below. 25 // As such, the methods should be called things like - testShouldDelegateToTraverseOperationTraverseOnStart 26 // and alike. - Paul. 27 } 28 29 // public void testShouldDelegateToStartVisitorTraverseOnStart() throws NoSuchMethodException { 30 // Mock visitor = mock(PicoVisitor.class); 31 // Mock pico = mock(PicoContainer.class); 32 // visitor.expects(once()).method("traverse").with(same(pico.proxy())); 33 // 34 // LifecycleManager lifecycleManager = new RootVisitingLifecycleManager(); 35 // lifecycleManager.start((PicoContainer) pico.proxy()); 36 // } 37 // 38 // public void testShouldDelegateToStopVisitorTraverseOnStart() throws NoSuchMethodException { 39 // Mock visitor = mock(PicoVisitor.class); 40 // Mock pico = mock(PicoContainer.class); 41 // visitor.expects(once()).method("traverse").with(same(pico.proxy())); 42 // 43 // LifecycleManager lifecycleManager = new RootVisitingLifecycleManager(); 44 // lifecycleManager.stop((PicoContainer) pico.proxy()); 45 // } 46 // 47 // public void testShouldDelegateToDisposeVisitorTraverseOnStart() throws NoSuchMethodException { 48 // Mock visitor = mock(PicoVisitor.class); 49 // Mock pico = mock(PicoContainer.class); 50 // visitor.expects(once()).method("traverse").with(same(pico.proxy())); 51 // 52 // LifecycleManager lifecycleManager = new RootVisitingLifecycleManager(); 53 // lifecycleManager.dispose((PicoContainer) pico.proxy()); 54 // } 55 } 56