1
/*******************************************************************************
2
* Copyright (c) 2006 IBM Corporation.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse
10
*******************************************************************************/
12
package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
14
import org.eclipse.linuxtools.systemtap.ui.structures.runnable.Command;
16
import junit.framework.TestCase;
18
public class CommandTest extends TestCase {
19
public CommandTest(String name) {
23
protected void setUp() throws Exception {
26
tc = new Command(new String[] {"ls", "/home/"}, null, null);
29
public void testCommand() {
30
assertNotNull("Command not null", tc);
32
tc = new Command(null, null, null);
33
assertNotNull("Command not null", tc);
35
tc = new Command(new String[] {}, null, null);
36
assertNotNull("Command not null", tc);
38
tc = new Command(new String[] {""}, null, null);
39
assertNotNull("Command not null", tc);
41
tc = new Command(new String[] {"a"}, null, null);
42
assertNotNull("Command not null", tc);
44
tc = new Command(new String[] {"ls", "/"}, null, null);
45
assertNotNull("Command not null", tc);
48
public void testIsFinished() {
49
assertTrue("Not finished", tc.isRunning());
51
assertFalse("Finished", tc.isRunning());
54
public void testStop() {
55
assertTrue("Running", tc.isRunning());
57
assertFalse("Not running", tc.isRunning());
60
public void testGetReturnValue() {
61
assertEquals(-1, tc.getReturnValue());
64
public void testIsDisposed() {
65
assertFalse(tc.isDisposed());
67
assertTrue(tc.isDisposed());
70
public void testDispose() {
74
protected void tearDown() throws Exception {