use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class PassedTransactionsTestTest method verifyExecuteMethodAllTransactionsPass.
@Test
public void verifyExecuteMethodAllTransactionsPass() {
PassedTransactionsTest test = new PassedTransactionsTest("Test #1", "passedTransactionsTest", "Verify number of passed tests", null, 0);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.LOGIN_1000_SUCCESS);
jmeterTransactions.add(TestData.SEARCH_800_SUCCESS);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.PASS)));
assertThat(test.getActualResultDescription(), containsString("Number of failed transactions = 0"));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class PassedTransactionsTestTest method verifyExecuteMethodAllTransactionsFail.
@Test
public void verifyExecuteMethodAllTransactionsFail() {
PassedTransactionsTest test = new PassedTransactionsTest("Test #1", "passedTransactionsTest", "Verify number of passed tests", null, 0);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.LOGIN_1200_SUCCESS);
jmeterTransactions.add(TestData.SEARCH_800_FAILURE);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
assertThat(test.getActualResultDescription(), containsString("Number of failed transactions = 1"));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class PassedTransactionsTestTest method verifyExecuteMethodFail.
@Test
public void verifyExecuteMethodFail() {
PassedTransactionsTest test = new PassedTransactionsTest("Test #1", "passedTransactionsTest", "Verify number of passed tests", "Login", 0);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.LOGIN_1200_FAILURE);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
assertThat(test.getActualResultDescription(), containsString("Number of failed transactions = 1"));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class PassedTransactionsTestTest method testPrintTestExecutionReportPass.
@Test
public void testPrintTestExecutionReportPass() {
String expectedOutput = String.format("Test name: Test #1%n" + "Test type: passedTransactionsTest%n" + "Test description: Verify number of passed tests%n" + "Transaction name: Login%n" + "Expected result: Number of failed transactions <= 0%n" + "Actual result: Number of failed transactions = 0%n" + "Transaction count: 1%n" + "Test result: Pass");
PassedTransactionsTest test = new PassedTransactionsTest("Test #1", "passedTransactionsTest", "Verify number of passed tests", "Login", 0);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.LOGIN_1000_SUCCESS);
test.execute(jmeterTransactions);
String output = test.getTestExecutionReport();
assertThat(output, containsString(expectedOutput));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class RespTimeNthPercentileTestTest method testExecuteAllTransactionsFail.
@Test
public void testExecuteAllTransactionsFail() {
RespTimeNthPercentileTest test = new RespTimeNthPercentileTest("Test #1", "nthPercRespTimeTest", "Verify 90th percentile", null, 90, 220);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(LOGIN_121_SUCCESS);
jmeterTransactions.add(LOGIN_125_SUCCESS);
jmeterTransactions.add(SEARCH_129_SUCCESS);
jmeterTransactions.add(SEARCH_135_SUCCESS);
jmeterTransactions.add(SEARCH_143_SUCCESS);
jmeterTransactions.add(SEARCH_148_SUCCESS);
jmeterTransactions.add(SEARCH_178_SUCCESS);
jmeterTransactions.add(SEARCH_198_SUCCESS);
jmeterTransactions.add(SEARCH_221_SUCCESS);
jmeterTransactions.add(SEARCH_249_SUCCESS);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
}
Aggregations