use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class ThroughputTestTest method testExecuteMethodError.
@Test
public void testExecuteMethodError() {
ThroughputTest test = new ThroughputTest("Test #1", "throughputTest", "", "nonexistent", 2);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TRANSACTION_0);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.ERROR)));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class TeamCityReporterTest method testPrintTeamCityReportStatistics.
@Test
public void testPrintTeamCityReportStatistics() {
JMeterTransactions jmeterTransactions = mock(JMeterTransactions.class);
when(jmeterTransactions.getTransactionCount()).thenReturn(1204);
when(jmeterTransactions.getFailCount()).thenReturn(25);
String output = new TeamCityReporter(jmeterTransactions).getTeamCityReportStatistics();
assertThat(output, containsString("##teamcity[buildStatisticValue key='Failed transactions' value='25']"));
assertThat(output, containsString("##teamcity[buildStatisticValue key='Total transactions' value='1204']"));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class TeamCityReporterTest method testSetTeamCityBuildStatusTextTest_report_passed.
@Test
public void testSetTeamCityBuildStatusTextTest_report_passed() {
String expectedOutput = String.format("##teamcity[buildStatus text='Transactions executed: 10, failed: 0']");
JMeterTransactions jmeterTransactions = mock(JMeterTransactions.class);
when(jmeterTransactions.getTransactionCount()).thenReturn(10);
when(jmeterTransactions.getFailCount()).thenReturn(0);
String output = new TeamCityReporter(jmeterTransactions).getTeamCityBuildStatusText();
assertThat(output, containsString(expectedOutput));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class TeamCityReporterTest method testSetTeamCityBuildStatusTextTest_report_failed.
@Test
public void testSetTeamCityBuildStatusTextTest_report_failed() {
String expectedOutput = String.format("##teamcity[buildProblem description='Transactions executed: 10, failed: 1']");
JMeterTransactions jmeterTransactions = mock(JMeterTransactions.class);
when(jmeterTransactions.getTransactionCount()).thenReturn(10);
when(jmeterTransactions.getFailCount()).thenReturn(1);
String output = new TeamCityReporter(jmeterTransactions).getTeamCityBuildStatusText();
assertThat(output, containsString(expectedOutput));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class LightningTestTest method testFilterTransactionsSome.
@Test
public void testFilterTransactionsSome() {
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.LOGIN_1000_SUCCESS);
jmeterTransactions.add(TestData.SEARCH_800_SUCCESS);
ClientSideTest test = Mockito.mock(ClientSideTest.class, Mockito.CALLS_REAL_METHODS);
when(test.getTransactionName()).thenReturn("Search");
JMeterTransactions filteredTransactions = test.filterTransactions(jmeterTransactions);
assertThat(filteredTransactions.getTransactionCount(), is(equalTo((1))));
}
Aggregations