Skip to content

Commit

Permalink
JBIDE-21192 - /home/usr/jboss-runtimes should be added as a path to b…
Browse files Browse the repository at this point in the history
…e scanned every startup

fix test regression

JBIDE-21368 - fixes failing unit test for windows
  • Loading branch information
Denis Golovin authored and robstryker committed Dec 23, 2015
1 parent e002c26 commit ad7ea58
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.handlers.TestHandler1;
import org.jboss.tools.runtime.ui.RuntimeUIActivator;
import org.jboss.tools.test.util.JobUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -68,16 +69,23 @@ private String displayRuntimes(RuntimePath[] paths) {

@Test
public void testLoadSaveRuntimePaths() {
JobUtils.waitForIdle(300);
String path = "test/path/one";
RuntimePath[] runtimePaths = RuntimeUIActivator.getDefault().getModel().getRuntimePaths();
assertEquals(displayRuntimes(runtimePaths), 0, runtimePaths.length);
// First start should include the default jboss-runtimes path
assertEquals(displayRuntimes(runtimePaths), 1, runtimePaths.length);
assertTrue(runtimePaths[0].getPath().endsWith("jboss-runtimes"));

// adding a new path
RuntimePath runtimePath = new RuntimePath(path);
runtimePath.setScanOnEveryStartup(false);
RuntimeUIActivator.getDefault().getModel().addRuntimePath(runtimePath);
RuntimeUIActivator.getDefault().getModel().saveRuntimePaths();
restartBundle();
runtimePaths = RuntimeUIActivator.getDefault().getModel().getRuntimePaths();
assertEquals(1, runtimePaths.length);
assertEquals(2, runtimePaths.length);

// Clear all paths, make sure jboss-runtimes doesn't magically return
RuntimeUIActivator.getDefault().getModel().setRuntimePaths(new RuntimePath[]{});
restartBundle();
runtimePaths = RuntimeUIActivator.getDefault().getModel().getRuntimePaths();
Expand Down

0 comments on commit ad7ea58

Please sign in to comment.