Package org.apache.etch.bindings.java.msg

Examples of org.apache.etch.bindings.java.msg.Message


    filter.sessionNotify( Session.UP );
//    System.out.println("Sleeping for 5 seconds");
    Thread.sleep( 5000 );    
//    System.out.println("Out of sleep");
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_KeepAliveReq", msg.type().getName() );
    assertEquals( 4, msg.get( new Field( "count" ) ) );
    assertEquals( 3, msg.get( new Field( "delay" ) ) );
  }
View Full Code Here


   
    assertNull( transport.what );
    assertNull( transport.recipient );
    assertNull( transport.msg );
   
    Message msg = constructAddResultMessage();
    assertNull( msg.getMessageId() );
    assertNull( msg.getInReplyTo() );
    msg.setInReplyTo( 1L );
   
    mmgr.transportMessage( who, msg );
   
    assertSame( transport.what, What.TRANSPORT_MESSAGE );
    assertSame( transport.recipient, who );
    assertSame( transport.msg, msg );
   
    assertEquals( 0, mmgr.size() );
    assertNotNull( msg.getMessageId() );
    assertEquals( 1L, msg.getInReplyTo() );
    assertNull( mmgr.getMailbox( msg.getMessageId() ) );
  }
View Full Code Here

    );
  }
 
  private void testTypeField( Type type, Field field, Object value )
  {
    Message msg = new Message( type, vf );
    msg.put( field, value );
  }
View Full Code Here

    filter.sessionNotify( Session.UP );
//    System.out.println("Sleeping for 4 seconds");
    Thread.sleep( 4000 );    
//    System.out.println("Out of sleep");
    assertSame( What.TRANSPORT_MESSAGE, transport.what );
    Message msg = transport.msg;
    assertEquals( "_Etch_KeepAliveReq", msg.type().getName() );
    assertEquals( 4, msg.get( new Field( "count" ) ) );
    assertEquals( 2, msg.get( new Field( "delay" ) ) );
  }
View Full Code Here

  public void messageId() throws Exception
  {
    Type mt_foo = new Type( "foo" );
    mt_foo.putValidator( DefaultValueFactory._mf__messageId, Validator_long.get( 0 ) );
   
    Message msg = new Message( mt_foo, vf );
   
    assertNull( vf.getMessageId( msg ) );
   
    vf.setMessageId( msg, 234L );
   
View Full Code Here

  public void inReplyTo() throws Exception
  {
    Type mt_foo = new Type( "foo" );
    mt_foo.putValidator( DefaultValueFactory._mf__inReplyTo, Validator_long.get( 0 ) );
   
    Message msg = new Message( mt_foo, vf );
   
    assertNull( vf.getInReplyTo( msg ) );
   
    vf.setInReplyTo( msg, 234L );
   
View Full Code Here

    String uri = "tcp://localhost:4801?filter=KeepAlive";    
    KeepAlive filter = newKeepAlive(uri);
    filter.setSession( session );   
    filter.sessionNotify( Session.UP )
   
    Message req = constructMessage();
   
    filter.sessionMessage( null, req );
   
    assertEquals(req.reply(),transport.msg);
   
  }
View Full Code Here

   
    assertNull( transport.what );
    assertNull( transport.recipient );
    assertNull( transport.msg );
   
    Message msg = constructAddMessage();
    assertNull( msg.getMessageId() );
    msg.setMessageId( 1L );

    // this should trigger msg already sent
    mmgr.transportMessage( who, msg );
  }
View Full Code Here

    Type mt_response = new Type( "_Etch_KeepAliveResp" );
    vf1.addType( mt_response );
   
    mt_request.setResult( mt_response );
   
    Message msg = new Message( mt_request, vf1 );
    msg.put( mf_delay, delay );
    msg.put( mf_count, count );
   
    return msg;
  }
View Full Code Here

   
    assertNull( transport.what );
    assertNull( transport.recipient );
    assertNull( transport.msg );
   
    Message msg = constructAddMessage();
    assertNull( msg.getMessageId() );
    assertNull( msg.getInReplyTo() );
   
    Mailbox mb = mmgr.transportCall( who, msg );
   
    assertSame( transport.what, What.TRANSPORT_MESSAGE );
    assertSame( transport.recipient, who );
    assertSame( transport.msg, msg );
    assertNotNull( mb );
   
    assertEquals( 1, mmgr.size() );
    assertNotNull( msg.getMessageId() );
    assertNull( msg.getInReplyTo() );
    assertSame( mb, mmgr.getMailbox( msg.getMessageId() ) );
   
    mb.closeRead();
   
    assertEquals( 0, mmgr.size() );
    assertNull( mmgr.getMailbox( msg.getMessageId() ) );
  }
View Full Code Here

TOP

Related Classes of org.apache.etch.bindings.java.msg.Message

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.