ShutdownHookEmailModuleUnitTest

public class ShutdownHookEmailModuleUnitTest extends ModuleTest<ShutdownHookEmailModule>

The ShutdownHookEmailModuleUnitTest is unit test of ShutdownHookEmailModule.

Author:Twinsen Tsang

Fields

MODULE_DESCRIPTORS

public static final String[] MODULE_DESCRIPTORS

Constructors

ShutdownHookEmailModuleUnitTest

public ShutdownHookEmailModuleUnitTest(String moduleDescriptor)

Create an instance of parameterized (parameter=module descriptor) ShutdownHookEmailModuleUnitTest.

Parameters:
  • moduleDescriptor – The parameterized module descriptor.

Methods

getModuleDescription

public String getModuleDescription()

getModuleDescriptionSet

public static Collection getModuleDescriptionSet()

initAtOnce

public boolean initAtOnce()

tearDown

public void tearDown()

testCreateShutdownHookWorker

public void testCreateShutdownHookWorker()

Test whether the ShutdownHookEmailModule.createShutdownHookWorker() able to wire up all properties from the module descriptor and it is an instance of ShutdownHookEmailThread. Note that the assertion actually take place in a helper class called CreateShudownHookWorkerAssertionThread. It is essential because the ShutdownHook worker thread is loaded through a clone of current class loader and therefore the class only appear in that domain.

testGetThread

public void testGetThread()

Test whether ShutdownHookEmailModule.getThread() always return non null value.

testOnCreateMailNotificationBody

public void testOnCreateMailNotificationBody()

This test has not implemented yet because the mail subject is subject to change.

testOnCreateMailNotificationSubject

public void testOnCreateMailNotificationSubject()

This test has not implemented yet because the mail subject is subject to change.

testShutdownHookRegisteredToRuntime

public void testShutdownHookRegisteredToRuntime()

Test whether the thread from ShutdownHookEmailModule.getThread() is registered inside the runtime shutdown hook.

testStop

public void testStop()

This test has not implemented yet because it is not a automated test case (it is for debugging purpose only).