Search in sources :

Example 1 with TestCounters

use of jetbrains.buildServer.server.rest.model.problem.TestCounters in project teamcity-rest by JetBrains.

the class TestScopes method getTestCounters.

@XmlElement(name = "testCounters")
public TestCounters getTestCounters() {
    return ValueWithDefault.decideDefault(myFields.isIncluded("testCounters"), () -> {
        Fields testCounters = myFields.getNestedField("testCounters");
        List<STestRun> runs = myTestScopes.stream().flatMap(scope -> scope.getTestRuns().stream()).collect(Collectors.toList());
        // Will just calculate all counters for simplicity
        TestCountersData data = new TestCountersData(runs);
        return new TestCounters(testCounters, data);
    });
}
Also used : XmlAttribute(javax.xml.bind.annotation.XmlAttribute) Fields(jetbrains.buildServer.server.rest.model.Fields) STestRun(jetbrains.buildServer.serverSide.STestRun) XmlRootElement(javax.xml.bind.annotation.XmlRootElement) ValueWithDefault(jetbrains.buildServer.server.rest.util.ValueWithDefault) Collectors(java.util.stream.Collectors) TestCounters(jetbrains.buildServer.server.rest.model.problem.TestCounters) TestCountersData(jetbrains.buildServer.server.rest.data.problem.TestCountersData) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) XmlType(javax.xml.bind.annotation.XmlType) UriInfo(javax.ws.rs.core.UriInfo) ModelBaseType(jetbrains.buildServer.server.rest.swagger.annotations.ModelBaseType) BeanContext(jetbrains.buildServer.server.rest.util.BeanContext) NotNull(org.jetbrains.annotations.NotNull) ObjectType(jetbrains.buildServer.server.rest.swagger.constants.ObjectType) XmlElement(javax.xml.bind.annotation.XmlElement) PagerData(jetbrains.buildServer.server.rest.model.PagerData) Fields(jetbrains.buildServer.server.rest.model.Fields) STestRun(jetbrains.buildServer.serverSide.STestRun) TestCountersData(jetbrains.buildServer.server.rest.data.problem.TestCountersData) TestCounters(jetbrains.buildServer.server.rest.model.problem.TestCounters) XmlElement(javax.xml.bind.annotation.XmlElement)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 UriInfo (javax.ws.rs.core.UriInfo)1 XmlAttribute (javax.xml.bind.annotation.XmlAttribute)1 XmlElement (javax.xml.bind.annotation.XmlElement)1 XmlRootElement (javax.xml.bind.annotation.XmlRootElement)1 XmlType (javax.xml.bind.annotation.XmlType)1 TestCountersData (jetbrains.buildServer.server.rest.data.problem.TestCountersData)1 Fields (jetbrains.buildServer.server.rest.model.Fields)1 PagerData (jetbrains.buildServer.server.rest.model.PagerData)1 TestCounters (jetbrains.buildServer.server.rest.model.problem.TestCounters)1 ModelBaseType (jetbrains.buildServer.server.rest.swagger.annotations.ModelBaseType)1 ObjectType (jetbrains.buildServer.server.rest.swagger.constants.ObjectType)1 BeanContext (jetbrains.buildServer.server.rest.util.BeanContext)1 ValueWithDefault (jetbrains.buildServer.server.rest.util.ValueWithDefault)1 STestRun (jetbrains.buildServer.serverSide.STestRun)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1