From 1b6ba71f9cf8ef037d7ff6522105622eff2c1f5a Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Sat, 9 Nov 2013 14:54:43 -0800 Subject: [PATCH] [JENKINS-20128] reproduced the problem --- .../groovy/hudson/cli/CLIActionTest.groovy | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/src/test/groovy/hudson/cli/CLIActionTest.groovy diff --git a/test/src/test/groovy/hudson/cli/CLIActionTest.groovy b/test/src/test/groovy/hudson/cli/CLIActionTest.groovy new file mode 100644 index 0000000000..985ab0dfdb --- /dev/null +++ b/test/src/test/groovy/hudson/cli/CLIActionTest.groovy @@ -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(); + } + } +} -- GitLab