package dslab; import at.ac.tuwien.dsg.orvell.StopShellException; import dslab.mailbox.IMailboxServer; import dslab.monitoring.IMonitoringServer; import org.junit.Test; import static dslab.ComponentFactory.createMailboxServer; import static dslab.ComponentFactory.createMonitoringServer; public class ComponentInitializationTest extends TestBase { /** * The components should be set up in a way that * makes it possible to initialize multiple components in the same JVM, so that * the tests used by the DS Lab team pass * https://tuwel.tuwien.ac.at/mod/forum/discuss.php?d=288072#p697563 */ @Test public void shouldBeAbleToInitializeMultipleComponentsInSameJvm() throws Exception { IMailboxServer mailboxServer = null; IMonitoringServer monitoringServer = null; try { mailboxServer = createMailboxServer("mailbox-earth-planet", in, out); monitoringServer = createMonitoringServer("monitoring", in, out); } finally { if (mailboxServer != null) try {mailboxServer.shutdown();} catch (StopShellException ignore) {} if (monitoringServer != null) try {monitoringServer.shutdown();} catch (StopShellException ignore) {} } } }