Skip to content

Commit

Permalink
Exec65Test#testExec65WithSudoUsingShellScript: skip this test on trav…
Browse files Browse the repository at this point in the history
…is, because we have to be a sudoer on travis to make the other tests pass.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/exec/trunk@1804823 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
PascalSchumacher committed Aug 11, 2017
1 parent f27283c commit b986b31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/org/apache/commons/exec/issues/Exec65Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.OS;
import org.apache.commons.exec.PumpStreamHandler;
import org.junit.Assume;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

import java.io.File;

/**
* Test to show that watchdog can destroy 'sudo' and 'sleep'.
*
Expand Down Expand Up @@ -101,7 +104,8 @@ public void testExec65WithSleepUsingShellScriptAndJDKOnly() throws Exception {
*/
@Test(expected = ExecuteException.class, timeout = TEST_TIMEOUT)
public void testExec65WithSudoUsingShellScript() throws Exception {

Assume.assumeFalse("Test is skipped on travis, because we have to be a sudoer "
+ "to make the other tests pass.", new File(".").getAbsolutePath().contains("travis"));
if (OS.isFamilyUnix()) {
final DefaultExecutor executor = new DefaultExecutor();
executor.setStreamHandler(new PumpStreamHandler(System.out, System.err, System.in));
Expand Down

0 comments on commit b986b31

Please sign in to comment.