use of jetbrains.buildServer.server.rest.model.problem.TypedValue in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testTestOccurrenceEntity_Metadata.
@Test
public void testTestOccurrenceEntity_Metadata() throws Exception {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final RunningBuildEx build = startBuild(buildType);
myFixture.doTestPassed(build, "testName");
myFixture.doTestMetadata(build, new TestMetadata("testName", "some key", "link", "value"));
myFixture.doTestMetadata(build, new TestMetadata("testName", "some key3", "number", new BigDecimal("44")));
STestRun testRun = finishBuild().getFullStatistics().getAllTests().get(0);
TestOccurrence testOccurrence = new TestOccurrence(testRun, getBeanContext(myServer), new Fields("metadata"));
assertEquals(Integer.valueOf(2), testOccurrence.getMetadata().count);
final List<TypedValue> items = testOccurrence.getMetadata().typedValues;
assertEquals(items.size(), 2);
System.out.println("items = " + StringUtil.join("\n", items));
assertTrue(items.contains(new TypedValue("some key", "link", "value", Fields.LONG)));
assertTrue(items.contains(new TypedValue("some key3", "number", String.valueOf(44f), Fields.LONG)));
}
Aggregations