Skip to content

Commit

Permalink
Add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
cupuyc committed Nov 1, 2016
1 parent 538ab01 commit 18232ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ repositories {
dependencies {
testCompile "junit:junit:4.11"
}

test {
testLogging.showStandardStreams = true

afterTest { desc, result ->
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}"
}
}
13 changes: 4 additions & 9 deletions src/test/java/LibraryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class LibraryTest {

@Test
public void testSomeLibraryMethod() throws IOException {
public void testSomeLibraryMethod() throws IOException, InterruptedException {
List<String> commandParts = new ArrayList<String>();
commandParts.add(getExecutable().getCanonicalPath());
commandParts.add("--version");
Expand All @@ -33,14 +33,9 @@ public void testSomeLibraryMethod() throws IOException {
}

//Wait to get exit value
try {
int exitValue = process.waitFor();
boolean success = exitValue == 0;
System.out.println("\n\nExecution success: " + success);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
int exitValue = process.waitFor();
boolean success = exitValue == 0;
System.out.println("\n\nExecution success: " + success);

}

Expand Down

0 comments on commit 18232ef

Please sign in to comment.