Search in sources :

Example 6 with ServerSideTest

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));
}
Also used : ServerSideTest(uk.co.automatictester.lightning.tests.ServerSideTest) ArrayList(java.util.ArrayList) PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) RespTimeAvgTest(uk.co.automatictester.lightning.tests.RespTimeAvgTest) Test(org.testng.annotations.Test) PassedTransactionsTest(uk.co.automatictester.lightning.tests.PassedTransactionsTest) ServerSideTest(uk.co.automatictester.lightning.tests.ServerSideTest) ClientSideTest(uk.co.automatictester.lightning.tests.ClientSideTest)

Example 7 with ServerSideTest

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;
    }
}
Also used : ClientSideTest(uk.co.automatictester.lightning.tests.ClientSideTest) ServerSideTest(uk.co.automatictester.lightning.tests.ServerSideTest) TestSetReporter(uk.co.automatictester.lightning.reporters.TestSetReporter) JMeterCSVFileReader(uk.co.automatictester.lightning.readers.JMeterCSVFileReader) PerfMonDataReader(uk.co.automatictester.lightning.readers.PerfMonDataReader) LightningXMLFileReader(uk.co.automatictester.lightning.readers.LightningXMLFileReader) File(java.io.File) TestSet(uk.co.automatictester.lightning.TestSet)

Aggregations

ServerSideTest (uk.co.automatictester.lightning.tests.ServerSideTest)7 ClientSideTest (uk.co.automatictester.lightning.tests.ClientSideTest)6 TestSet (uk.co.automatictester.lightning.TestSet)5 PerfMonDataEntries (uk.co.automatictester.lightning.data.PerfMonDataEntries)4 TestSetReporter (uk.co.automatictester.lightning.reporters.TestSetReporter)4 JMeterCSVFileReader (uk.co.automatictester.lightning.readers.JMeterCSVFileReader)3 LightningXMLFileReader (uk.co.automatictester.lightning.readers.LightningXMLFileReader)3 PerfMonDataReader (uk.co.automatictester.lightning.readers.PerfMonDataReader)3 Test (org.testng.annotations.Test)2 PassedTransactionsTest (uk.co.automatictester.lightning.tests.PassedTransactionsTest)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 JMeterCSVS3ObjectReader (uk.co.automatictester.lightning.lambda.readers.JMeterCSVS3ObjectReader)1 LightningXMLS3ObjectReader (uk.co.automatictester.lightning.lambda.readers.LightningXMLS3ObjectReader)1 PerfMonS3ObjectDataReader (uk.co.automatictester.lightning.lambda.readers.PerfMonS3ObjectDataReader)1 RespTimeAvgTest (uk.co.automatictester.lightning.tests.RespTimeAvgTest)1