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 0000000000000000000000000000000000000000..985ab0dfdb3ae2ad0363128abd73e883ba8bd8e5 --- /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(); + } + } +}