diff options
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java')
-rw-r--r-- | systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java index c2d8de221d..5f8f458b03 100644 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java +++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java @@ -15,8 +15,6 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; -import java.io.IOException; - import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; @@ -24,10 +22,10 @@ import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPCompletionProcessor; import org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPDocumentProvider; import org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.STPEditor; -import org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory; +import org.eclipse.linuxtools.systemtap.ui.tests.SystemtapTest; import org.junit.Test; -public class STPCompletionProcessorTest { +public class STPCompletionProcessorTest extends SystemtapTest{ private static String TEST_STP_SCRIPT = ""+ "\n"+ @@ -104,7 +102,7 @@ public class STPCompletionProcessorTest { @Test public void testProbeCompletion() throws BadLocationException { - assumeTrue(stapInstalled()); + assumeTrue(stapInstalled); String prefix = "probe "; ICompletionProposal[] proposals = getCompletionsForPrefix(prefix); assertTrue(proposalsContain(proposals, "syscall")); @@ -113,7 +111,7 @@ public class STPCompletionProcessorTest { @Test public void testMultiProbeCompletion() throws BadLocationException { - assumeTrue(stapInstalled()); + assumeTrue(stapInstalled); String prefix = "probe begin,e"; ICompletionProposal[] proposals = getCompletionsForPrefix(prefix); assertTrue(proposalsContain(proposals, "end")); @@ -139,7 +137,7 @@ public class STPCompletionProcessorTest { @Test public void testEndProbeCompletion() throws BadLocationException { - assumeTrue(stapInstalled()); + assumeTrue(stapInstalled); Document testDocument = new Document(TEST_STP_SCRIPT); @SuppressWarnings("unused") @@ -163,7 +161,7 @@ public class STPCompletionProcessorTest { @Test public void testProbeVariableCompletion() throws BadLocationException { - assumeTrue(stapInstalled()); + assumeTrue(stapInstalled); Document testDocument = new Document(TEST_STP_SCRIPT); @SuppressWarnings("unused") @@ -217,19 +215,9 @@ public class STPCompletionProcessorTest { return proposals; } - private boolean stapInstalled(){ - try { - Process process = RuntimeProcessFactory.getFactory().exec(new String[]{"stap", "-V"}, null); - return (process != null); - } catch (IOException e) { - e.printStackTrace(); - } - return false; - } - @Test public void testFunctionCompletion() throws BadLocationException { - assumeTrue(stapInstalled()); + assumeTrue(stapInstalled); Document testDocument = new Document(TEST_STP_SCRIPT); @SuppressWarnings("unused") |