Search in sources :

Example 1 with SystemUnderTest

use of systemundertest.SystemUnderTest 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();
}
Also used : TeamscaleMockServer(com.teamscale.test.commons.TeamscaleMockServer) SystemUnderTest(systemundertest.SystemUnderTest) Test(org.junit.jupiter.api.Test) SystemUnderTest(systemundertest.SystemUnderTest)

Example 2 with SystemUnderTest

use of systemundertest.SystemUnderTest in project teamscale-jacoco-agent by cqse.

the class JUnit4ExecutedWithJUnit5Test method testAdd.

@Test
public void testAdd() {
    int result = new SystemUnderTest().add(1, 2);
    Assertions.assertEquals(3, result);
}
Also used : SystemUnderTest(systemundertest.SystemUnderTest) Test(org.junit.Test) SystemUnderTest(systemundertest.SystemUnderTest)

Example 3 with SystemUnderTest

use of systemundertest.SystemUnderTest 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");
}
Also used : TeamscaleMockServer(com.teamscale.test.commons.TeamscaleMockServer) SystemUnderTest(systemundertest.SystemUnderTest) Test(org.junit.jupiter.api.Test) SystemUnderTest(systemundertest.SystemUnderTest)

Example 4 with SystemUnderTest

use of systemundertest.SystemUnderTest in project teamscale-jacoco-agent by cqse.

the class JUnit4Test method testAdd.

@Test
public void testAdd() {
    int result = new SystemUnderTest().add(1, 2);
    Assert.assertEquals(3, result);
}
Also used : SystemUnderTest(systemundertest.SystemUnderTest) Test(org.junit.Test) SystemUnderTest(systemundertest.SystemUnderTest)

Example 5 with SystemUnderTest

use of systemundertest.SystemUnderTest in project teamscale-jacoco-agent by cqse.

the class JUnit5Test method testAdd.

@Test
void testAdd() {
    int result = new SystemUnderTest().add(1, 2);
    Assertions.assertEquals(3, result);
}
Also used : SystemUnderTest(systemundertest.SystemUnderTest) Test(org.junit.jupiter.api.Test) SystemUnderTest(systemundertest.SystemUnderTest)

Aggregations

SystemUnderTest (systemundertest.SystemUnderTest)5 Test (org.junit.jupiter.api.Test)3 TeamscaleMockServer (com.teamscale.test.commons.TeamscaleMockServer)2 Test (org.junit.Test)2