1 | package com.framsticks.running; |
---|
2 | |
---|
3 | |
---|
4 | // import java.util.Arrays; |
---|
5 | // import java.util.Arrays; |
---|
6 | // import java.util.LinkedList; |
---|
7 | // import java.util.List; |
---|
8 | |
---|
9 | import org.testng.annotations.Test; |
---|
10 | |
---|
11 | // import com.framsticks.params.EventListener; |
---|
12 | // import com.framsticks.structure.messages.ValueChange; |
---|
13 | // import com.framsticks.util.dispatching.Monitor; |
---|
14 | |
---|
15 | // import static org.fest.assertions.Assertions.*; |
---|
16 | import com.framsticks.test.TestConfiguration; |
---|
17 | |
---|
18 | @Test |
---|
19 | public class ExternalProcessTest extends TestConfiguration { |
---|
20 | |
---|
21 | @Test(timeOut = 1000) |
---|
22 | public void runBash() throws InterruptedException { |
---|
23 | // TODO: needs improvement in directory configuration of the ExternalProcess |
---|
24 | // final ExternalProcess process = new ExternalProcess(); |
---|
25 | // process.setCommand("bash"); |
---|
26 | |
---|
27 | // final List<String> input = Arrays.asList("test", "another line"); |
---|
28 | // final List<String> output = new LinkedList<>(); |
---|
29 | |
---|
30 | // process.addOutputListener(new EventListener<ValueChange>() { |
---|
31 | // @Override |
---|
32 | // public void action(ValueChange change) { |
---|
33 | // output.add(change.value.toString()); |
---|
34 | // } |
---|
35 | // }); |
---|
36 | // Monitor monitor = new Monitor(process); |
---|
37 | // monitor.use(); |
---|
38 | |
---|
39 | // for (String l : input) { |
---|
40 | // process.getInput().println("echo " + l); |
---|
41 | // } |
---|
42 | |
---|
43 | // process.getInput().close(); |
---|
44 | |
---|
45 | // monitor.waitFor(); |
---|
46 | // monitor.drop(); |
---|
47 | // monitor.join(); |
---|
48 | |
---|
49 | // assertThat(output).isEqualTo(input); |
---|
50 | } |
---|
51 | |
---|
52 | } |
---|