use of uk.co.automatictester.lightning.tests.ServerSideTest in project lightning by automatictester.
the class TestSetTest method verifyExecuteServerMethod_1_1_1.
@Test
public void verifyExecuteServerMethod_1_1_1() {
ServerSideTest testA = new ServerSideTest("Test #1", "serverSideTest", ServerSideTestType.LESS_THAN, "Verify CPU utilisation", "192.168.0.12 CPU", 10001);
ServerSideTest testB = new ServerSideTest("Test #2", "serverSideTest", ServerSideTestType.GREATER_THAN, "Verify CPU utilisation", "192.168.0.12 CPU", 10001);
ServerSideTest testC = new ServerSideTest("Test #3", "serverSideTest", ServerSideTestType.GREATER_THAN, "Verify CPU utilisation", "192.168.0.240 CPU", 10001);
PerfMonDataEntries dataEntries = new PerfMonDataEntries();
dataEntries.add(TestData.CPU_ENTRY_10000);
dataEntries.add(TestData.CPU_ENTRY_10001);
List<ServerSideTest> tests = new ArrayList<>();
tests.add(testA);
tests.add(testB);
tests.add(testC);
TestSet testSet = new TestSet(null, tests);
configureStream();
testSet.executeServerSideTests(dataEntries);
revertStream();
assertThat(testSet.getTestCount(), is(3));
assertThat(testSet.getPassCount(), is(1));
assertThat(testSet.getFailCount(), is(1));
assertThat(testSet.getErrorCount(), is(1));
}
use of uk.co.automatictester.lightning.tests.ServerSideTest in project lightning by automatictester.
the class CliTestRunner method runTests.
private static void runTests() {
long testSetExecStart = System.currentTimeMillis();
File xmlFile = params.verify.getXmlFile();
File jmeterCsvFile = params.verify.getJmeterCsvFile();
File perfmonCsvFile = params.verify.getPerfmonCsvFile();
LightningXMLFileReader xmlFileReader = new LightningXMLFileReader();
xmlFileReader.readTests(xmlFile);
List<ClientSideTest> clientSideTests = xmlFileReader.getClientSideTests();
List<ServerSideTest> serverSideTests = xmlFileReader.getServerSideTests();
testSet = new TestSet(clientSideTests, serverSideTests);
jmeterTransactions = new JMeterCSVFileReader().getTransactions(jmeterCsvFile);
if (params.verify.isPerfmonCsvFileProvided()) {
perfMonDataEntries = new PerfMonDataReader().getDataEntires(perfmonCsvFile);
testSet.executeServerSideTests(perfMonDataEntries);
}
testSet.executeClientSideTests(jmeterTransactions);
testSet.printTestExecutionReport();
new TestSetReporter(testSet).printTestSetExecutionSummaryReport();
long testSetExecEnd = System.currentTimeMillis();
long testExecTime = testSetExecEnd - testSetExecStart;
logger.info("Total execution time: {}ms", testExecTime);
if (testSet.getFailCount() + testSet.getErrorCount() != 0) {
exitCode = 1;
}
}
Aggregations