You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2008/04/26 19:07:50 UTC
svn commit: r651837 -
/commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
Author: sebb
Date: Sat Apr 26 10:07:48 2008
New Revision: 651837
URL: http://svn.apache.org/viewvc?rev=651837&view=rev
Log:
Document some more test assertions
Modified:
commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
Modified: commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java
URL: http://svn.apache.org/viewvc/commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java?rev=651837&r1=651836&r2=651837&view=diff
==============================================================================
--- commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java (original)
+++ commons/sandbox/exec/trunk/src/test/java/org/apache/commons/exec/DefaultExecutorTest.java Sat Apr 26 10:07:48 2008
@@ -160,7 +160,7 @@
Thread.sleep(2000);
// teminate it
watchdog.destroyProcess();
- assertTrue(watchdog.killedProcess());
+ assertTrue("Watchdog should have killed the process",watchdog.killedProcess());
}
/**
@@ -175,9 +175,9 @@
exec.execute(cl, handler);
// wait for script to be terminated by the watchdog
Thread.sleep(6000);
- // try to teminate the already terminated process
+ // try to terminate the already terminated process
watchdog.destroyProcess();
- assertTrue(watchdog.killedProcess());
+ assertTrue("Watchdog should have killed the process already",watchdog.killedProcess());
}
/**
@@ -321,14 +321,14 @@
// wait for script to run
Thread.sleep(2000);
assertNotNull("Process destroyer should exist",exec.getProcessDestroyer());
- assertEquals("process destroyer size should be 1",1,processDestroyer.size());
- assertTrue(processDestroyer.isAddedAsShutdownHook());
+ assertEquals("Process destroyer size should be 1",1,processDestroyer.size());
+ assertTrue("Process destroyer should exist as shutdown hook",processDestroyer.isAddedAsShutdownHook());
// teminate it and the process destroyer is detached
watchdog.destroyProcess();
assertTrue(watchdog.killedProcess());
Thread.sleep(100);
- assertTrue(processDestroyer.size() == 0);
- assertTrue(processDestroyer.isAddedAsShutdownHook() == false);
+ assertEquals("Processor Destroyer size should be 0",0,processDestroyer.size());
+ assertFalse("Process destroyer should not exist as shutdown hook",processDestroyer.isAddedAsShutdownHook());
}
}