use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class RespTimeAvgTestTest method testPrintTestExecutionReport.
@Test
public void testPrintTestExecutionReport() {
RespTimeAvgTest test = new RespTimeAvgTest("my name", "my type", "my description", "Search", 800);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.SEARCH_800_SUCCESS);
String expectedOutput = String.format("Test name: my name%n" + "Test type: my type%n" + "Test description: my description%n" + "Transaction name: Search%n" + "Expected result: Average response time <= 800%n" + "Actual result: Average response time = 800%n" + "Transaction count: 1%n" + "Longest transactions: [800]%n" + "Test result: Pass");
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 RespTimeAvgTestTest method verifyExecuteAllTransactionsPass.
@Test
public void verifyExecuteAllTransactionsPass() {
RespTimeAvgTest test = new RespTimeAvgTest("Test #1", "avgRespTimeTest", "Verify response times", null, 900);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.SEARCH_800_SUCCESS);
jmeterTransactions.add(TestData.LOGIN_1000_SUCCESS);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.PASS)));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class RespTimeAvgTestTest method verifyExecuteError.
@Test
public void verifyExecuteError() {
RespTimeAvgTest test = new RespTimeAvgTest("Test #1", "avgRespTimeTest", "Verify response times", "nonexistent", 800);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.SEARCH_11221_SUCCESS);
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 RespTimeAvgTestTest method verifyExecuteFail.
@Test
public void verifyExecuteFail() {
RespTimeAvgTest test = new RespTimeAvgTest("Test #1", "avgRespTimeTest", "Verify response times", "Search", 11220);
JMeterTransactions jmeterTransactions = new JMeterTransactions();
jmeterTransactions.add(TestData.SEARCH_11221_SUCCESS);
test.execute(jmeterTransactions);
assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
}
use of uk.co.automatictester.lightning.data.JMeterTransactions in project lightning by automatictester.
the class ThroughputTest method execute.
@Override
public void execute(ArrayList<String[]> originalJMeterTransactions) {
try {
JMeterTransactions transactions = filterTransactions((JMeterTransactions) originalJMeterTransactions);
transactionCount = transactions.getTransactionCount();
actualResult = transactions.getThroughput();
actualResultDescription = String.format(ACTUAL_RESULT_MESSAGE, actualResult);
if (actualResult < minThroughput) {
result = TestResult.FAIL;
} else {
result = TestResult.PASS;
}
} catch (Exception e) {
result = TestResult.ERROR;
actualResultDescription = e.getMessage();
}
}
Aggregations