use of uk.co.automatictester.lightning.tests.PassedTransactionsTest in project lightning by automatictester.
the class TeamCityReporterTest method testPrintTeamCityVerifyStatistics.
@Test
public void testPrintTeamCityVerifyStatistics() {
final PassedTransactionsTest clientTest = mock(PassedTransactionsTest.class);
when(clientTest.getName()).thenReturn("Failed transactions");
when(clientTest.getActualResult()).thenReturn(1);
final ServerSideTest serverTest = mock(ServerSideTest.class);
when(serverTest.getName()).thenReturn("Memory utilization");
when(serverTest.getActualResult()).thenReturn(45);
TestSet testSet = mock(TestSet.class);
when(testSet.getClientSideTests()).thenReturn(new ArrayList<ClientSideTest>() {
{
add(clientTest);
}
});
when(testSet.getServerSideTests()).thenReturn(new ArrayList<ServerSideTest>() {
{
add(serverTest);
}
});
String output = new TeamCityReporter(testSet).getTeamCityVerifyStatistics();
assertThat(output, containsString("##teamcity[buildStatisticValue key='Failed transactions' value='1']"));
assertThat(output, containsString("##teamcity[buildStatisticValue key='Memory utilization' value='45']"));
}
use of uk.co.automatictester.lightning.tests.PassedTransactionsTest in project lightning by automatictester.
the class TestSetTest method verifyExecuteClientMethod_2_0_0.
@Test
public void verifyExecuteClientMethod_2_0_0() {
PassedTransactionsTest passedTransactionsTestA = new PassedTransactionsTest("Test #1", "passedTransactionsTest", "Verify number of passed tests", "Login", 0);
PassedTransactionsTest passedTransactionsTestB = new PassedTransactionsTest("Test #2", "passedTransactionsTest", "Verify number of passed tests", null, 0);
JMeterTransactions transactions = new JMeterTransactions();
transactions.add(TestData.LOGIN_3514_SUCCESS);
transactions.add(TestData.SEARCH_11221_SUCCESS);
List<ClientSideTest> tests = new ArrayList<>();
tests.add(passedTransactionsTestA);
tests.add(passedTransactionsTestB);
TestSet testSet = new TestSet(tests, null);
configureStream();
testSet.executeClientSideTests(transactions);
revertStream();
assertThat(testSet.getTestCount(), is(2));
assertThat(testSet.getPassCount(), is(2));
assertThat(testSet.getFailCount(), is(0));
assertThat(testSet.getErrorCount(), is(0));
}
Aggregations