Package com.sun.jini.test.spec.jeri.mux.util

Examples of com.sun.jini.test.spec.jeri.mux.util.DataMessage.receive()


        ServerConnectionHeader sHeader = new ServerConnectionHeader();
        sHeader.setRation((short)0x0001).send(os);
        int receivedBytes = 0;
        long stopTime = System.currentTimeMillis() + getTimeout()*5;
        DataMessage dm = new DataMessage().suppressFormatCheck();
        dm.receive(is,getTimeout());
        receivedBytes += dm.getSize();
        //Verify that no more that 256 bytes are received
        if (dm.getSize()>256) {
            throw new TestException("More than 256 bytes"
                + " were sent");
View Full Code Here


        long stopTime = System.currentTimeMillis() + getTimeout()*5;
        long messageTime = getTimeout();
        do {
            DataMessage dm = new DataMessage().suppressFormatCheck();
            //new TimedReceiveTask(dm,is,getTimeout());
            dm.receive(is,messageTime);
            receivedBytes += dm.getSize();
            if (receivedBytes==expectedBytes) {
                break;
            }
            //Verify that no more that 256 bytes are received
View Full Code Here

            int session = dm.getsessionId();
            //Verify that no data is sent before an increment ration
            //message is sent;
            DataMessage dummy = new DataMessage().suppressFormatCheck();
            boolean dataSent = true;
            dummy.receive(is,messageTime);
            if (dummy.getSize()>0) {
                throw new TestException("Data was sent before"
                    + " the server sent an increment ration message");
            }
            //request that an additional 256 bytes be sent
View Full Code Here

        //verify that 600 bytes are received
        byte[] payload = (byte[])dm.getPayload();
        if (payload.length!=600) {
            //try once again - it is possible the message was split
            try {
               dm.receive(is,getTimeout());
            } catch (ProtocolException e) {
                e.printStackTrace();
                throw new TestException(e.getMessage(),e);
            }
        }
View Full Code Here

        os.flush();
        int received = 0;
        int sessionId = 0;
        //Receive message fragment
        DataMessage dm = new DataMessage().suppressFormatCheck();
        dm.receive(is,getTimeout());
        if (dm.getSize()>256) {
            throw new TestException("Message fragment size"
                + " over 256 bytes: " + dm);
        }
        AbortMessage am = new AbortMessage();
View Full Code Here

        int received = 0;
        int sessionId = 0;
        while (received < size) {
            //Receive message fragment
            DataMessage dm = new DataMessage().suppressFormatCheck();
            dm.receive(is,getTimeout());
            int dataSize = dm.getSize();
            if (dataSize > 256) {
                throw new TestException("Message fragment size"
                    + " over 256 bytes: " + dm);
            } else if (dataSize > 0) {
View Full Code Here

        ServerConnectionHeader sHeader = new ServerConnectionHeader();
        sHeader.setRation((short)0x0001).send(os);
        int receivedBytes = 0;
        long stopTime = System.currentTimeMillis() + getTimeout()*5;
        DataMessage dm = new DataMessage().suppressFormatCheck();
        dm.receive(is,getTimeout());
        receivedBytes += dm.getSize();
        //Verify that no more that 256 bytes are received
        if (dm.getSize()>256) {
            throw new TestException("More than 256 bytes"
                + " were sent");
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.