Class LifecycleHandlerTest
- java.lang.Object
-
- test.de.iip_ecosphere.platform.support.LifecycleHandlerTest
-
public class LifecycleHandlerTest extends java.lang.ObjectTestsLifecycleDescriptorandLifecycleHandler.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLifecycleHandlerTest.LcDesc1A test handler without shutdown hook.static classLifecycleHandlerTest.LcDesc2A test handler with shutdown hook.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]cmdArgsprivate static intcountDescriptorsprivate static intshutdownCountprivate static intshutdownHookCalledCountprivate static intshutdownHookCountprivate static intstartupCount
-
Constructor Summary
Constructors Constructor Description LifecycleHandlerTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidsetCmdArgs(java.lang.String[] args)Changes the command line arguments used inLifecycleHandlerTest.LcDesc1andLifecycleHandlerTest.LcDesc2for asserting expected command line arguments.voidtestLifecycleHandler()Tests the lifecycle handler with no waiting.voidtestLifecycleHandlerWaiting()Tests the lifecycle handler with waiting and shutdown by hook.voidtestLifecycleHandlerWaitingShutdown()Tests the lifecycle handler with waiting and shutdown at the end.
-
-
-
Field Detail
-
cmdArgs
private static java.lang.String[] cmdArgs
-
startupCount
private static int startupCount
-
shutdownCount
private static int shutdownCount
-
shutdownHookCount
private static int shutdownHookCount
-
shutdownHookCalledCount
private static int shutdownHookCalledCount
-
countDescriptors
private static int countDescriptors
-
-
Method Detail
-
setCmdArgs
public static void setCmdArgs(java.lang.String[] args)
Changes the command line arguments used inLifecycleHandlerTest.LcDesc1andLifecycleHandlerTest.LcDesc2for asserting expected command line arguments. May be used by other tests ifLifecycleHandlerTest.LcDesc1orLifecycleHandlerTest.LcDesc2are linked into the test execution via- Parameters:
args- the command line arguments to use for assertions
-
testLifecycleHandler
public void testLifecycleHandler()
Tests the lifecycle handler with no waiting.
-
testLifecycleHandlerWaiting
public void testLifecycleHandlerWaiting()
Tests the lifecycle handler with waiting and shutdown by hook. May end up in an endless loop in case of bugs.LifecycleHandlerTest.LcDesc2shall terminate the loop after 10 iterations.
-
testLifecycleHandlerWaitingShutdown
public void testLifecycleHandlerWaitingShutdown()
Tests the lifecycle handler with waiting and shutdown at the end. May end up in an endless loop in case of bugs.LifecycleHandlerTest.LcDesc2shall terminate the loop after 10 iterations.
-
-