Package com.kurento.tool.rom.test.model.client

Examples of com.kurento.tool.rom.test.model.client.ComplexParam


      assertEquals(obj.getAtt4(), 22);

      assertEquals(SampleEnum.CONSTANT_1,
          obj.echoEnum(SampleEnum.CONSTANT_1));

      ComplexParam returnValue = obj.echoRegister(new ComplexParam(
          "prop1", 33));

      assertEquals(returnValue.getProp1(), "prop1");
      assertEquals(returnValue.getProp2(), 33);

      List<SampleEnum> result = obj.echoListEnum(Arrays.asList(
          SampleEnum.CONSTANT_1, SampleEnum.CONSTANT_2));

      assertEquals(SampleEnum.CONSTANT_1, result.get(0));
      assertEquals(SampleEnum.CONSTANT_2, result.get(1));

      List<ComplexParam> params = new ArrayList<>();
      params.add(new ComplexParam("prop1_1", 33));
      params.add(new ComplexParam("prop1_2", 44));

      List<ComplexParam> returnParams = obj.echoListRegister(params);

      ComplexParam value1 = returnParams.get(0);
      ComplexParam value2 = returnParams.get(1);

      assertEquals(value1.getProp1(), "prop1_1");
      assertEquals(value1.getProp2(), 33);

      assertEquals(value2.getProp1(), "prop1_2");
      assertEquals(value2.getProp2(), 44);

    }
  }
View Full Code Here


    jsonObject.addProperty("prop1", "XXX");
    jsonObject.addProperty("prop2", 33);
    jsonObject.addProperty("prop3", "YYY");
    jsonObject.addProperty("prop4", 5.5f);

    ComplexParam param = JsonUtils.fromJson(jsonObject, ComplexParam.class);

    assertEquals(param.getProp1(), "XXX");
    assertEquals(param.getProp2(), 33);
    assertEquals(param.getProp3(), "YYY");
    assertEquals(param.getProp4(), 5.5f, 0.01);
  }
View Full Code Here

  }

  @Test
  public void jsonToObjectConversion() {

    ComplexParam param = new ComplexParam("XXX", 33);
    param.setProp3("YYY");
    param.setProp4(5.5f);

    JsonObject jsonObject = JsonUtils.toJsonObject(param);

    assertEquals(jsonObject.get("prop1").getAsString(), "XXX");
    assertEquals(jsonObject.get("prop2").getAsInt(), 33);
View Full Code Here

  @Test
  public void jsonToObjectListConversion() {

    List<ComplexParam> params = new ArrayList<ComplexParam>();

    ComplexParam param = new ComplexParam("XXX", 33);
    param.setProp3("YYY");
    param.setProp4(5.5f);

    ComplexParam param2 = new ComplexParam("XXX2", 66);
    param2.setProp3("YYY2");
    param2.setProp4(11.5f);

    params.add(param);
    params.add(param2);

    JsonArray jsonArray = (JsonArray) JsonUtils.toJsonElement(params);
View Full Code Here

  }

  @Test
  public void echoRegisterTest() {

    ComplexParam returnValue = obj.echoRegister(new ComplexParam("prop1",
        33));

    assertEquals(returnValue.getProp1(), "prop1");
    assertEquals(returnValue.getProp2(), 33);
  }
View Full Code Here

  @Test
  public void echoRegisterListTest() {

    List<ComplexParam> params = new ArrayList<>();
    params.add(new ComplexParam("prop1_1", 33));
    params.add(new ComplexParam("prop1_2", 44));

    List<ComplexParam> returnParams = obj.echoListRegister(params);

    ComplexParam value1 = returnParams.get(0);
    ComplexParam value2 = returnParams.get(1);

    assertEquals(value1.getProp1(), "prop1_1");
    assertEquals(value1.getProp2(), 33);

    assertEquals(value2.getProp1(), "prop1_2");
    assertEquals(value2.getProp2(), 44);
  }
View Full Code Here

TOP

Related Classes of com.kurento.tool.rom.test.model.client.ComplexParam

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.