assertTrue("Incorrect number of events. Expected 2, got " + listAppender2.getEvents().size(), listAppender2.getEvents().size() == 2);
assertTrue("Incorrect number of events. Expected 1, got " + listAppender1.getEvents().size(), listAppender1.getEvents().size() == 1);
// now set jndi resource to Application3.
// The context name, 'Application3', will be used as log file name by the default route.
context.rebind("java:comp/env/logging/context-name", "Application3");
msg = new StructuredDataMessage("Test", "This is a message from Application3", "Context");
EventLogger.logEvent(msg);
File application3LogFile = new File("target/routingbyjndi/routingbyjnditest-Application3.log");
assertTrue("The Application3 log file was not created", application3LogFile.exists());