File: DrivableConsoleTest.java

package info (click to toggle)
jython 2.7.2%2Brepack1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 62,676 kB
  • sloc: python: 640,908; java: 306,458; xml: 1,984; sh: 522; ansic: 126; makefile: 76
file content (37 lines) | stat: -rw-r--r-- 974 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package org.python.util.install.driver;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;

import org.python.util.install.driver.ConsoleDriver;
import org.python.util.install.driver.Tunnel;

import junit.framework.TestCase;

public class DrivableConsoleTest extends TestCase {

    private DrivableConsole _console;
    private Tunnel _tunnel;

    protected void setUp() throws IOException {
        _tunnel = new Tunnel();
        _console = new DrivableConsole(_tunnel);
    }

    public void testDrive() throws Exception {
        // sequence matters here (have to fork off the driver thread first
        ConsoleDriver driver = new ConsoleDriver(_tunnel, getAnswers());
        driver.start();
        _console.handleConsoleIO();
    }

    private Collection getAnswers() {
        Collection answers = new ArrayList();
        answers.add("1");
        answers.add("2");
        answers.add("3");
        return answers;
    }

}