Search in sources :

Example 1 with CustomTestFramework

use of testframework.CustomTestFramework in project teamscale-jacoco-agent by cqse.

the class TiaClientTiaModeHttpSystemTest method systemTest.

@Test
public void systemTest() throws Exception {
    CustomTestFramework customTestFramework = new CustomTestFramework(AGENT_PORT);
    customTestFramework.runTestsWithTia();
    assertThat(customTestFramework.testInfos.stream().map(TiaClientTiaModeHttpSystemTest::getCoverageString)).containsExactlyInAnyOrder("SystemUnderTest.java:4,13", "SystemUnderTest.java:4,8");
}
Also used : CustomTestFramework(testframework.CustomTestFramework) Test(org.junit.jupiter.api.Test)

Example 2 with CustomTestFramework

use of testframework.CustomTestFramework in project teamscale-jacoco-agent by cqse.

the class TiaClientSystemTest method systemTest.

@Test
public void systemTest() throws Exception {
    TeamscaleMockServer teamscaleMockServer = new TeamscaleMockServer(FAKE_TEAMSCALE_PORT, "testFoo", "testBar");
    CustomTestFramework customTestFramework = new CustomTestFramework(AGENT_PORT);
    customTestFramework.runTestsWithTia();
    assertThat(teamscaleMockServer.uploadedReports).hasSize(1);
    TestwiseCoverageReport report = teamscaleMockServer.parseUploadedTestwiseCoverageReport(0);
    assertThat(report.tests).hasSize(2);
    assertAll(() -> {
        assertThat(report.tests).extracting(test -> test.uniformPath).containsExactlyInAnyOrder("testBar", "testFoo");
        assertThat(report.tests).extracting(test -> test.result).containsExactlyInAnyOrder(ETestExecutionResult.FAILURE, ETestExecutionResult.PASSED);
        assertThat(report.tests).extracting(TiaClientSystemTest::getCoverageString).containsExactlyInAnyOrder("SystemUnderTest.java:4,13", "SystemUnderTest.java:4,8");
    });
}
Also used : Test(org.junit.jupiter.api.Test) TestInfo(com.teamscale.report.testwise.model.TestInfo) TeamscaleMockServer(com.teamscale.test.commons.TeamscaleMockServer) TestwiseCoverageReport(com.teamscale.report.testwise.model.TestwiseCoverageReport) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Assertions.assertAll(org.junit.jupiter.api.Assertions.assertAll) CustomTestFramework(testframework.CustomTestFramework) Collectors(java.util.stream.Collectors) ETestExecutionResult(com.teamscale.report.testwise.model.ETestExecutionResult) TeamscaleMockServer(com.teamscale.test.commons.TeamscaleMockServer) TestwiseCoverageReport(com.teamscale.report.testwise.model.TestwiseCoverageReport) CustomTestFramework(testframework.CustomTestFramework) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 CustomTestFramework (testframework.CustomTestFramework)2 ETestExecutionResult (com.teamscale.report.testwise.model.ETestExecutionResult)1 TestInfo (com.teamscale.report.testwise.model.TestInfo)1 TestwiseCoverageReport (com.teamscale.report.testwise.model.TestwiseCoverageReport)1 TeamscaleMockServer (com.teamscale.test.commons.TeamscaleMockServer)1 Collectors (java.util.stream.Collectors)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Assertions.assertAll (org.junit.jupiter.api.Assertions.assertAll)1