@Test()
public void testDefaultControllerMsgHandlerFactory()
{
System.out.println("START TestDefaultControllerMsgHandlerFactory at " + new Date(System.currentTimeMillis()));
DefaultControllerMessageHandlerFactory facotry = new DefaultControllerMessageHandlerFactory();
Message message = new Message(MessageType.NO_OP, "0");
NotificationContext context = new NotificationContext(null);
boolean exceptionCaught = false;
try
{
MessageHandler handler = facotry.createHandler(message, context);
} catch (HelixException e)
{
exceptionCaught = true;
}
AssertJUnit.assertTrue(exceptionCaught);
message = new Message(MessageType.CONTROLLER_MSG, "1");
exceptionCaught = false;
try
{
MessageHandler handler = facotry.createHandler(message, context);
} catch (HelixException e)
{
exceptionCaught = true;
}
AssertJUnit.assertFalse(exceptionCaught);