b[6] |= 0x02; //set "more fragments follow"
messages.add( b );
MessageOutputStream m_out =
new MessageOutputStream(orb);
m_out.writeGIOPMsgHeader( MsgType_1_1._Fragment,
2 // giop minor
);
m_out.write_ulong( 0 ); // Fragment Header (request id)
m_out.write_octet( (byte) 'b' );
m_out.write_octet( (byte) 'a' );
m_out.write_octet( (byte) 'z' );
m_out.write_octet( (byte) 0);
m_out.insertMsgSize();
messages.add( m_out.getBufferCopy() );
DummyTransport transport =
new DummyTransport( messages );
DummyRequestListener request_listener =
new DummyRequestListener();
DummyReplyListener reply_listener =
new DummyReplyListener();
GIOPConnectionManager giopconn_mg =
new GIOPConnectionManager();
try
{
giopconn_mg.configure (config);
}
catch (Exception e)
{
}
ServerGIOPConnection conn =
giopconn_mg.createServerGIOPConnection( null,
transport,
request_listener,
reply_listener );
try
{
//will not return until an IOException is thrown (by the
//DummyTransport)
conn.receiveMessages();
}
catch( IOException e )
{
//o.k., thrown by DummyTransport
}
//did the GIOPConnection hand the complete request over to the
//listener?
assertTrue( request_listener.getRequest() != null );
RequestInputStream r_in = new RequestInputStream
( getORB(), null, request_listener.getRequest() );
//is the body correct?
assertEquals( "barbaz", r_in.read_string() );
r_out.close();
r_in.close();
m_out.close();
}