Search in sources :

Example 1 with MbtUnitParameter

use of com.hp.octane.integrations.dto.general.MbtUnitParameter in project octane-ci-java-sdk by MicroFocus.

the class MbtTests method parseConfiguration.

@Test
public void parseConfiguration() {
    URL url = getClass().getResource("mbtExample1.json");
    MbtData mbtData = DTOFactory.getInstance().dtoFromJsonFile(new File(url.getFile()), MbtData.class);
    Assert.assertEquals(4, mbtData.getUnits().size());
    Assert.assertEquals(6, mbtData.getData().getParameters().size());
    Assert.assertEquals(2, mbtData.getData().getIterations().size());
    mbtData.getData().getIterations().forEach(strings -> Assert.assertEquals(6, strings.size()));
    mbtData.getUnits().forEach(mbtUnit -> System.out.println(mbtUnit.getName() + ", parameters: " + Optional.ofNullable(mbtUnit.getParameters()).orElse(Collections.emptyList()).stream().map(MbtUnitParameter::getParameterId).collect(Collectors.joining(", "))));
    mbtData.getData().getParameters().forEach(System.out::println);
    mbtData.getData().getIterations().forEach(strings -> strings.forEach(System.out::println));
}
Also used : MbtData(com.hp.octane.integrations.dto.general.MbtData) File(java.io.File) URL(java.net.URL) MbtUnitParameter(com.hp.octane.integrations.dto.general.MbtUnitParameter) Test(org.junit.Test)

Aggregations

MbtData (com.hp.octane.integrations.dto.general.MbtData)1 MbtUnitParameter (com.hp.octane.integrations.dto.general.MbtUnitParameter)1 File (java.io.File)1 URL (java.net.URL)1 Test (org.junit.Test)1