Search in sources :

Example 96 with Test

use of org.testng.annotations.Test in project che by eclipse.

the class JsonRpcParamsTest method shouldToJsonForCreatedListDtoParams.

@Test
public void shouldToJsonForCreatedListDtoParams() throws Exception {
    List<Dto> list = singletonList(dto);
    JsonArray expected = new JsonArray();
    JsonElement element = jsonParser.parse(dto.toString());
    expected.add(element);
    JsonRpcParams jsonRpcParams = new JsonRpcParams(list, jsonParser);
    JsonElement actual = jsonRpcParams.toJsonElement();
    assertEquals(expected, actual);
}
Also used : JsonArray(com.google.gson.JsonArray) JsonElement(com.google.gson.JsonElement) Test(org.testng.annotations.Test)

Example 97 with Test

use of org.testng.annotations.Test in project che by eclipse.

the class JsonRpcParamsTest method shouldToStringForParsedListDtoParams.

@Test
public void shouldToStringForParsedListDtoParams() throws Exception {
    JsonArray array = new JsonArray();
    JsonObject jsonObject = jsonParser.parse(DTO_JSON).getAsJsonObject();
    array.add(jsonObject);
    String expected = array.toString();
    JsonRpcParams jsonRpcParams = new JsonRpcParams("[" + DTO_JSON + "]", jsonParser);
    String actual = jsonRpcParams.toString();
    assertEquals(expected, actual);
}
Also used : JsonArray(com.google.gson.JsonArray) JsonObject(com.google.gson.JsonObject) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.testng.annotations.Test)

Example 98 with Test

use of org.testng.annotations.Test in project che by eclipse.

the class JsonRpcParamsTest method shouldGetAsListForParsedListStringParams.

@Test
public void shouldGetAsListForParsedListStringParams() throws Exception {
    String expected = "value";
    JsonRpcParams jsonRpcParams = new JsonRpcParams("[\"" + expected + "\"]", jsonParser);
    List<String> actual = jsonRpcParams.getAsListOf(String.class);
    assertEquals(singletonList(expected), actual);
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) Test(org.testng.annotations.Test)

Example 99 with Test

use of org.testng.annotations.Test in project che by eclipse.

the class JsonRpcParamsTest method shouldToStringCreatedListStringParams.

@Test
public void shouldToStringCreatedListStringParams() throws Exception {
    String value = "value";
    JsonArray array = new JsonArray();
    array.add(new JsonPrimitive(value));
    String expected = array.toString();
    JsonRpcParams jsonRpcParams = new JsonRpcParams(singletonList(value), jsonParser);
    String actual = jsonRpcParams.toString();
    assertEquals(expected, actual);
}
Also used : JsonArray(com.google.gson.JsonArray) JsonPrimitive(com.google.gson.JsonPrimitive) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.testng.annotations.Test)

Example 100 with Test

use of org.testng.annotations.Test in project che by eclipse.

the class JsonRpcParamsTest method shouldToJsonValueForParsedListDoubleParams.

@Test
public void shouldToJsonValueForParsedListDoubleParams() throws Exception {
    Double expected = 0D;
    JsonArray array = new JsonArray();
    array.add(new JsonPrimitive(expected));
    JsonRpcParams jsonRpcParams = new JsonRpcParams("[" + expected + "]", jsonParser);
    JsonElement jsonValue = jsonRpcParams.toJsonElement();
    assertEquals(array, jsonValue);
}
Also used : JsonArray(com.google.gson.JsonArray) JsonPrimitive(com.google.gson.JsonPrimitive) JsonElement(com.google.gson.JsonElement) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)24007 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2438 Task (com.evolveum.midpoint.task.api.Task)2069 File (java.io.File)1433 ArrayList (java.util.ArrayList)1237 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1188 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)1078 HashMap (java.util.HashMap)965 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)814 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)692 BeforeTest (org.testng.annotations.BeforeTest)692 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)690 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)651 Parameters (org.testng.annotations.Parameters)610 BaseTest (org.xdi.oxauth.BaseTest)582 BigDecimal (java.math.BigDecimal)574 List (java.util.List)558 LocalDate (org.joda.time.LocalDate)553 HashSet (java.util.HashSet)548 BaseTest (util.BaseTest)537