use of com.teamscale.test.commons.TeamscaleMockServer in project teamscale-jacoco-agent by cqse.
the class HttpRedirectSystemTest method systemTest.
@Test
public void systemTest() throws Exception {
System.setProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.StdErrLog");
System.setProperty("org.eclipse.jetty.LEVEL", "OFF");
RedirectMockServer redirectMockServer = new RedirectMockServer(FAKE_REDIRECT_PORT, FAKE_TEAMSCALE_PORT);
TeamscaleMockServer teamscaleMockServer = new TeamscaleMockServer(FAKE_TEAMSCALE_PORT);
new SystemUnderTest().foo();
dumpCoverage();
assertThat(teamscaleMockServer.uploadedReports).hasSize(1);
redirectMockServer.shutdown();
teamscaleMockServer.shutdown();
}
use of com.teamscale.test.commons.TeamscaleMockServer 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");
});
}
use of com.teamscale.test.commons.TeamscaleMockServer in project teamscale-jacoco-agent by cqse.
the class DefaultExcludesSystemTest method systemTest.
@Test
public void systemTest() throws Exception {
System.setProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.StdErrLog");
System.setProperty("org.eclipse.jetty.LEVEL", "OFF");
TeamscaleMockServer teamscaleMockServer = new TeamscaleMockServer(FAKE_TEAMSCALE_PORT);
new SystemUnderTest().foo();
dumpCoverage();
assertThat(teamscaleMockServer.uploadedReports).hasSize(1);
String report = teamscaleMockServer.uploadedReports.get(0);
assertThat(report).doesNotContain("shadow");
assertThat(report).doesNotContain("junit");
assertThat(report).doesNotContain("eclipse");
assertThat(report).doesNotContain("apache");
assertThat(report).doesNotContain("javax");
assertThat(report).doesNotContain("slf4j");
assertThat(report).doesNotContain("com/sun");
assertThat(report).contains("SystemUnderTest");
assertThat(report).contains("NotExcludedClass");
}
Aggregations