Package com.github.ghetolay.jwamp.message

Examples of com.github.ghetolay.jwamp.message.WampArguments


    assertTrue("Automatic Event Subscription",waitEventResponse.done);
  }
 
  @Test(dependsOnMethods = {"connect"})
  public void callSimple() throws IOException, UnsupportedWampActionException, TimeoutException, CallException{
    WampArguments msg = wamp.simpleCall("CallTest");

    assertNotNull("Simple Remote Call",msg);
  }
View Full Code Here


    assertNotNull("Simple Remote Call",msg);
  }
 
  @Test(dependsOnMethods = {"connect"})
  public void callReturnOneList() throws IOException, UnsupportedWampActionException, TimeoutException, CallException{
    WampArguments msg = wamp.simpleCall("oneList");
   
    assertEquals("lol",   msg.nextObject(String.class));
    assertEquals("prout", msg.nextObject(String.class));
    assertEquals("youk",  msg.nextObject(String.class));
    assertNull(msg.nextObject());
  }
View Full Code Here

    assertNull(msg.nextObject());
  }
 
  @Test(dependsOnMethods = {"connect"})
  public void callSingleReturn() throws IOException, UnsupportedWampActionException, TimeoutException, CallException{
    WampArguments msg = wamp.simpleCall("singleReturn");
   
    assertEquals(Integer.valueOf(1),msg.nextObject(Integer.class));
    assertNull(msg.nextObject());
  }
View Full Code Here

  public void callMultipleArgumentsAndReturnsType() throws IOException, UnsupportedWampActionException, TimeoutException, CallException{
    SomeObject obj = new SomeObject();
    obj.setFieldOne("b");
    obj.setFieldTwo(2);
   
    WampArguments msg = wamp.simpleCall("echo", "a", 45, obj, "a");

    assertEquals"a" ,  msg.nextObject(String.class)             );
    assertEquals45  ,  msg.nextObject(Integer.class).intValue() );
    assertEqualsobj ,  msg.nextObject(SomeObject.class)         );
    assertEquals"a" ,  msg.nextObject(String.class)             );

    assertTrue(!msg.hasNext());
  }
View Full Code Here

    assertTrue(!msg.hasNext());
  }
 
  @Test(dependsOnMethods = {"connect"})
  public void callArrayArg() throws IOException, UnsupportedWampActionException, TimeoutException, CallException{
    WampArguments msg = wamp.simpleCall("arrayArgs");
   
    assertEquals( 10 , msg.nextObject(int.class).intValue() );
    assertEquals( 11 , msg.nextObject(int.class).intValue() );
    assertEquals( 12 , msg.nextObject(int.class).intValue() );
    assertEquals( 13 , msg.nextObject(int.class).intValue() );
    assertTrue(!msg.hasNext());
  }
View Full Code Here

    try{
      wamp.simpleCall("CallException");
      fail("No CallException thrown");
    } catch(CallException ce){
      assertEquals( "Test error" , ce.getErrorDescription() );
      WampArguments args = (WampArguments)ce.getErrorDetails();
      assertEquals( "details" , args.nextObject().asString() );
    }
   
  }
View Full Code Here

    if(arg != null){
      if(arg instanceof Collection)
        argList = (Collection<?>)arg;
      //TODO not use this, keep raw data and send them or convert them is need (msgPack => JSON or JSON => msgPack)
      else if(arg instanceof WampArguments){
        WampArguments wampArg = (WampArguments)arg;
        List<Object> list = new ArrayList<Object>();
        while(wampArg.hasNext())
          list.add(wampArg.nextObject(Object.class));
       
        argList = list;
      }
      else
        this.arg = arg;
View Full Code Here

TOP

Related Classes of com.github.ghetolay.jwamp.message.WampArguments

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.