~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-13 21:43:22 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130513214322-6frgd9du1n0w2uo7
Tags: 1.2.1-1
* Team upload.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
package org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures;
13
13
 
14
 
import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
 
14
import static org.junit.Assert.assertFalse;
 
15
import static org.junit.Assert.assertNotNull;
 
16
import static org.junit.Assert.assertTrue;
 
17
 
15
18
import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ConsoleStreamDaemon;
16
19
import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
17
 
 
18
 
import junit.framework.TestCase;
19
 
 
20
 
public class ConsoleStreamDaemonTest extends TestCase {
21
 
        public ConsoleStreamDaemonTest(String name) {
22
 
                super(name);
23
 
        }
24
 
 
25
 
        protected void setUp() throws Exception {
26
 
                super.setUp();
27
 
                
 
20
import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
 
21
import org.junit.Before;
 
22
import org.junit.Test;
 
23
 
 
24
public class ConsoleStreamDaemonTest {
 
25
 
 
26
        @Before
 
27
        public void setUp() {
28
28
                StreamGobbler gobbler = new StreamGobbler(System.in);
29
29
                gobbler.start();
30
30
                daemon = new ConsoleStreamDaemon(null);
31
31
        }
32
 
        
 
32
        @Test
33
33
        public void testConsoleStreamDaemon() {
34
34
                assertNotNull(daemon);
35
35
 
39
39
                csd = new ConsoleStreamDaemon(ScriptConsole.getInstance("test"));
40
40
                assertNotNull(csd);
41
41
        }
42
 
        
 
42
        @Test
43
43
        public void testHandleDataEvent() {
44
44
                daemon.handleDataEvent("");
45
45
                assertNotNull(daemon);
46
46
        }
47
 
 
 
47
        @Test
48
48
        public void testIsDisposed() {
49
49
                ConsoleStreamDaemon csd = new ConsoleStreamDaemon(null);
50
50
                assertFalse(csd.isDisposed());
51
51
                csd.dispose();
52
52
                assertTrue(csd.isDisposed());
53
53
        }
54
 
        
 
54
        @Test
55
55
        public void testDispose() {
56
56
                daemon.dispose();
57
57
                assertNotNull(daemon);
58
58
        }
59
59
        
60
 
        protected void tearDown() throws Exception {
61
 
                super.tearDown();
62
 
        }
63
 
        
64
60
        private ConsoleStreamDaemon daemon;
65
61
}
 
 
b'\\ No newline at end of file'