Author: koen.aers(a)jboss.com
Date: 2011-07-05 06:25:28 -0400 (Tue, 05 Jul 2011)
New Revision: 32605
Modified:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeLaunchHelperTest.java
Log:
Simplification of ForgeLaunchHelperTest
Modified:
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeLaunchHelperTest.java
===================================================================
---
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeLaunchHelperTest.java 2011-07-05
10:25:03 UTC (rev 32604)
+++
trunk/forge/tests/org.jboss.tools.forge.core.test/src/org/jboss/tools/forge/core/process/ForgeLaunchHelperTest.java 2011-07-05
10:25:28 UTC (rev 32605)
@@ -1,66 +1,37 @@
package org.jboss.tools.forge.core.process;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
-import java.io.IOException;
-
import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.ui.progress.UIJob;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class ForgeLaunchHelperTest {
- private static String TEST_LOCATION;
-
+ private String testLocation = null;
private IProcess forgeProcess = null;
- static {
- try {
- TEST_LOCATION =
FileLocator.getBundleFile(Platform.getBundle("org.jboss.tools.forge.runtime")).getAbsolutePath();
- } catch (IOException e) {
- TEST_LOCATION = null;
- }
- }
-
@Before
public void setUp() throws Exception {
- forgeProcess = null;
+ testLocation =
FileLocator.getBundleFile(Platform.getBundle("org.jboss.tools.forge.runtime")).getAbsolutePath();
}
@After
public void tearDown() throws Exception {
- if (forgeProcess != null) {
- try {
- forgeProcess.terminate();
- } catch (DebugException e) {}
- }
+ forgeProcess.terminate();
forgeProcess = null;
+ testLocation = null;
}
@Test
public void test() {
- new UIJob("testLaunch") {
- public IStatus runInUIThread(IProgressMonitor monitor) {
- try {
- forgeProcess = ForgeLaunchHelper.launch("test", TEST_LOCATION);
- assertNotNull(forgeProcess);
- assertFalse(forgeProcess.isTerminated());
- } catch (RuntimeException e) {
- fail();
- }
- return null;
- }
-
- }.schedule();
+ forgeProcess = ForgeLaunchHelper.launch("test", testLocation);
+ assertNotNull(forgeProcess);
+ assertFalse(forgeProcess.isTerminated());
}
}
Show replies by date