296569 - removeLifeCycleListener() has no effect
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1341 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
e2e5f03cc2
commit
435a0d256b
|
@ -1,6 +1,7 @@
|
|||
jetty-7.0.2-SNAPSHOT
|
||||
+ JSON parses NaN as null
|
||||
+ 290765 Reset input for HttpExchange retry.
|
||||
+ 296569 removeLifeCycleListener() has no effect
|
||||
+ 296765 JMX Connector Server and ShutdownThread
|
||||
+ 297421 Hide server/system classes from WebAppClassLoader.getResources
|
||||
+ 297783 Handle HEAD reponses in HttpClient
|
||||
|
|
|
@ -130,7 +130,7 @@ public abstract class AbstractLifeCycle implements LifeCycle
|
|||
|
||||
public void removeLifeCycleListener(LifeCycle.Listener listener)
|
||||
{
|
||||
LazyList.removeFromArray(_listeners,listener);
|
||||
_listeners = (LifeCycle.Listener[])LazyList.removeFromArray(_listeners,listener);
|
||||
}
|
||||
|
||||
public String getState()
|
||||
|
|
|
@ -125,6 +125,27 @@ public class LifeCycleListenerTest extends TestCase
|
|||
assertTrue("The lifecycle state is not stooped",lifecycle.isStopped());
|
||||
}
|
||||
|
||||
|
||||
public void testRemoveLifecycleListener ()
|
||||
throws Exception
|
||||
{
|
||||
|
||||
|
||||
TestLifeCycle lifecycle = new TestLifeCycle();
|
||||
TestListener listener = new TestListener();
|
||||
lifecycle.addLifeCycleListener(listener);
|
||||
|
||||
lifecycle.start();
|
||||
((StdErrLog)Log.getLog()).setHideStacks(true);
|
||||
assertTrue("The starting event didn't occur",listener.starting);
|
||||
lifecycle.removeLifeCycleListener(listener);
|
||||
lifecycle.stop();
|
||||
assertFalse("The stopping event occurred", listener.stopping);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
private class TestLifeCycle extends AbstractLifeCycle
|
||||
{
|
||||
Exception cause;
|
||||
|
@ -155,6 +176,8 @@ public class LifeCycleListenerTest extends TestCase
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class TestListener implements LifeCycle.Listener
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in New Issue