Examples of Finished


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

*/
public class FinishedTest extends TestCase {

    public void testFinished() throws Exception {
        byte[] bytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2 };
        Finished message = new Finished(bytes);
        assertEquals("incorrect type", Handshake.FINISHED, message.getType());
        assertTrue("incorrect CertificateVerify", Arrays.equals(message
                .getData(), bytes));

        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);
        Finished message_2 = new Finished(in, message.length());
        assertTrue("incorrect message decoding", Arrays.equals(message
                .getData(), message_2.getData()));

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

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

Examples of org.gradle.launcher.daemon.protocol.Finished

            connection.dispatch(stopCommand);
            Result result = (Result) connection.receive();
            if (result instanceof Failure) {
                failure = ((Failure) result).getValue();
            }
            connection.dispatch(new Finished());
        } catch (Throwable e) {
            failure = e;
        }
        if (failure != null) {
            LOGGER.lifecycle("Unable to stop one of the daemons. The daemon may have crashed.");
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.