Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-20128] reproduced the problem
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package hudson.cli | ||
|
||
import hudson.remoting.Channel | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.jvnet.hudson.test.JenkinsRule | ||
|
||
import java.util.concurrent.ExecutorService | ||
import java.util.concurrent.Executors | ||
|
||
/** | ||
* | ||
* | ||
* @author Kohsuke Kawaguchi | ||
*/ | ||
class CLIActionTest { | ||
@Rule | ||
public JenkinsRule j = new JenkinsRule() | ||
|
||
ExecutorService pool; | ||
|
||
/** | ||
* Makes sure that the /cli endpoint is functioning. | ||
*/ | ||
@Test | ||
public void testDuplexHttp() { | ||
pool = Executors.newCachedThreadPool() | ||
try { | ||
FullDuplexHttpStream con = new FullDuplexHttpStream(new URL(j.URL,"cli")); | ||
Channel ch = new Channel("test connection", pool, con.inputStream, con.outputStream); | ||
ch.close(); | ||
} finally { | ||
pool.shutdown(); | ||
} | ||
} | ||
} |