Examples of TelnetPrintStream


Examples of org.jboss.as.test.integration.ejb.mdb.dynamic.impl.TelnetPrintStream

    @Test
    public void test1() throws Exception {
        final Socket socket = new Socket(EJBManagementUtil.getNodeName(), 2020);
        final OutputStream sockOut = socket.getOutputStream();
        final DataInputStream in = new DataInputStream(new TelnetInputStream(socket.getInputStream(), sockOut));
        final PrintStream out = new TelnetPrintStream(sockOut);

        assertEmptyLine(in);
        assertEquals("type 'help' for a list of commands", in.readLine());

        out.println("set a b");
        out.flush();
        assertReply("set a to b", in.readLine());
        assertEmptyLine(in);

        out.println("get a");
        out.flush();
        assertReply("b", in.readLine());
        assertEmptyLine(in);

        out.println("list");
        out.flush();
        assertReply("a = b", in.readLine());
        assertEmptyLine(in);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.