mil.dod.th.ose.remote.integration/src/mil/dod/th/ose/remote/integration/base/TestSocketChannel.java
@Test(expected = SocketException.class)
    public void testBigMessage() throws IOException
    {
        try (Socket socket = SocketHostHelper.connectToController())
        {
            // send out message with the payload being the max size
            byte[] bytes = new byte[16777216];        
            ByteString bs = ByteString.copyFrom(bytes);
            TerraHarvestMessage msg = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.Base,
                    BaseNamespace.newBuilder().setType(BaseMessageType.ControllerInfo).setData(bs));
            msg.writeDelimitedTo(socket.getOutputStream());
        }
    }
/**
     * Confirm that sending a message over the max size will close the connection.
     */
Confirm that sending a message over the max size will close the connection.
Confirm that sending a message over the max size will close the connection .
@Test(expected = SocketException.class)
    public void testBigMessage() throws IOException
    {
        try (Socket socket = SocketHostHelper.connectToController())
        {
            byte[] bytes = new byte[16777216];        
            ByteString bs = ByteString.copyFrom(bytes);
            TerraHarvestMessage msg = TerraHarvestMessageHelper.createTerraHarvestMsg(Namespace.Base,
                    BaseNamespace.newBuilder().setType(BaseMessageType.ControllerInfo).setData(bs));
            msg.writeDelimitedTo(socket.getOutputStream());
        }
    }
@ Test ( expected = SocketException . class ) public void testBigMessage ( ) throws IOException { try ( Socket socket = SocketHostHelper . connectToController ( ) ) { byte [ ] bytes = new byte [ 16777216 ] ; ByteString bs = ByteString . copyFrom ( bytes ) ; TerraHarvestMessage msg = TerraHarvestMessageHelper . createTerraHarvestMsg ( Namespace . Base , BaseNamespace . newBuilder ( ) . setType ( BaseMessageType . ControllerInfo ) . setData ( bs ) ) ; msg . writeDelimitedTo ( socket . getOutputStream ( ) ) ; } }
Confirm that sending a message over the max size will close the connection.
Confirm that sending a message over the max size will close the connection .
// send out message with the payload being the max size