Package etch.bindings.java.msg

Examples of etch.bindings.java.msg.Message


 
  /** @throws Exception */
  @org.junit.Test
  public void method_throwExcp5() throws Exception
  {
    Message msg = new Message(
      ValueFactoryTest1._mt_etch_tests_Test1_throwExcp5,
      vf );
    msg.put(ValueFactoryTest1._mf_msg,"raw");
    msg.put(ValueFactoryTest1._mf_code,9);
    msg.put(ValueFactoryTest1._mf_value,"Exception with object as param");
    stub.sessionMessage( null, msg );
    // check the result.
    src.xreply
      .checkType( ValueFactoryTest1._mt_etch_tests_Test1__result_throwExcp5 );
    assertEquals( 1, src.xreply.size() );
View Full Code Here


  /** @throws Exception */
  @org.junit.Test
  public void method_throwExcp6() throws Exception
  {
    Message msg = new Message(
      ValueFactoryTest1._mt_etch_tests_Test1_throwExcp6,
      vf );
    msg.put(ValueFactoryTest1._mf_msg,"raw");
    msg.put(ValueFactoryTest1._mf_code,99);
    msg.put( ValueFactoryTest1._mf_value, method_fillObjectHelper(5,"Exception with array of object as param"));
    stub.sessionMessage( null, msg );
    // check the result.
    src.xreply
      .checkType( ValueFactoryTest1._mt_etch_tests_Test1__result_throwExcp6 );
    assertEquals( 1, src.xreply.size() );
View Full Code Here

    mmgr.setSession( session );
  }
 
  private Message constructAddMessage() throws Exception
  {
    return new Message( MyValueFactory.mt_add, vf );
  }
View Full Code Here

    return new Message( MyValueFactory.mt_add, vf );
  }
 
  private Message constructAddResultMessage() throws Exception
  {
    return new Message( MyValueFactory.mt_add_result, vf );
  }
View Full Code Here

   
    assertNull( transport.what );
    assertNull( transport.recipient );
    assertNull( transport.msg );
   
    Message msg = constructAddMessage();
    assertNull( msg.getMessageId() );
    assertNull( msg.getInReplyTo() );
   
    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() );
    assertNull( msg.getInReplyTo() );
    assertNull( mmgr.getMailbox( msg.getMessageId() ) );
  }
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

   
    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

   
    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

    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

    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

TOP

Related Classes of 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.