Package org.apache.harmony.xnet.provider.jsse

Examples of org.apache.harmony.xnet.provider.jsse.ServerHelloDone


    /*
     * Class under test for void ServerHelloDone()
     */
    public void testServerHelloDone() throws Exception {

        ServerHelloDone message = new ServerHelloDone();
        assertEquals("incorrect type", Handshake.SERVER_HELLO_DONE, message
                .getType());
        assertEquals("incorrect ServerHelloDone", 0, message.length());

        HandshakeIODataStream out = new HandshakeIODataStream();
        message.send(out);
        byte[] encoded = out.getData(1000);
        assertEquals("incorrect out data length", message.length(),
                encoded.length);

        HandshakeIODataStream in = new HandshakeIODataStream();
        in.append(encoded);
        ServerHelloDone message_2 = new ServerHelloDone(in, message.length());
        assertEquals("incorrect message decoding", 0, message_2.length());

        in.append(encoded);
        try {
            new ServerHelloDone(in, message.length() - 1);
            fail("Small length: No expected AlertException");
        } catch (AlertException e) {
        }

        in.append(encoded);
        in.append(new byte[] { 1, 2, 3 });
        try {
            new ServerHelloDone(in, message.length() + 3);
            fail("Extra bytes: No expected AlertException ");
        } catch (AlertException e) {
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.xnet.provider.jsse.ServerHelloDone

Copyright © 2018 www.massapicom. 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.