@Test public void testRegisterJar() throws Exception { DirectProvider direct = new DirectProvider(); ApplicationService appService = AppService.createAndRegister(direct, direct); // Make sure the applications haven't been available before registering the jar. assertEquals(0, appService.getApplicationNames().size()); File testAppsJar = getServerJar(); assertNotNull(testAppsJar); assertTrue(testAppsJar.exists()); System.out.println("Using server jar at: " + testAppsJar.toString()); URL testAppsJarURL = testAppsJar.toURI().toURL(); appService.registerJar(testAppsJarURL.toExternalForm(), null); System.out.println(appService.getApplicationNames()); assertEquals(3, appService.getApplicationNames().size()); assertTrue(appService.getApplicationNames().contains("FirstJarApp")); assertTrue(appService.getApplicationNames().contains("SecondJarApp")); assertTrue(appService.getApplicationNames().contains("ThirdJarApp")); }