Created
December 5, 2011 13:53
-
-
Save tfnico/1433647 to your computer and use it in GitHub Desktop.
Splitting tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test(expected=NullPointerException.class) | |
public void psmThrowsNullPointerExceptionWhenCopying() { | |
Aristo a = new Aristo(); | |
Runtime r = mock(Runtime.class); | |
a.setRuntime(r); | |
a.PSMCopy("oldPSM", "newPSM"); | |
} | |
@Test(expected=IOException.class) | |
public void psmThrowsIOExceptionWhenExecuting() { | |
Aristo a = new Aristo(); | |
Runtime r = mock(Runtime.class); | |
a.setRuntime(r); | |
a.PSMCopy("oldPSM", "newPSM"); | |
verify(r).exec("PSMcopy oldPSM newPSM"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
private void run(String command) throws IOException {
BufferedReader r = (new BufferedReader(new InputStreamReader(runtime.
exec(command).
getInputStream())));
String l = new String();
while ((l = r.readLine()) != null) {
out.append(l);
}
}