Search in sources :

Example 16 with PerfMonDataEntries

use of uk.co.automatictester.lightning.data.PerfMonDataEntries in project lightning by automatictester.

the class ServerSideTestTest method verifyExecute_LessThan_Error.

@Test
public void verifyExecute_LessThan_Error() {
    ServerSideTest test = new ServerSideTest("Test #1", "serverSideTest", ServerSideTestType.LESS_THAN, "Verify CPU utilisation", "192.168.0.13 CPU", 10001);
    PerfMonDataEntries dataEntries = new PerfMonDataEntries();
    dataEntries.add(TestData.CPU_ENTRY_10000);
    dataEntries.add(TestData.CPU_ENTRY_10001);
    test.execute(dataEntries);
    assertThat(test.getResult(), is(equalTo(TestResult.ERROR)));
}
Also used : PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) Test(org.testng.annotations.Test)

Example 17 with PerfMonDataEntries

use of uk.co.automatictester.lightning.data.PerfMonDataEntries 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)

Aggregations

PerfMonDataEntries (uk.co.automatictester.lightning.data.PerfMonDataEntries)17 Test (org.testng.annotations.Test)12 ClientSideTest (uk.co.automatictester.lightning.tests.ClientSideTest)4 ServerSideTest (uk.co.automatictester.lightning.tests.ServerSideTest)4 TestSet (uk.co.automatictester.lightning.TestSet)3 TestSetReporter (uk.co.automatictester.lightning.reporters.TestSetReporter)3 JMeterCSVFileReader (uk.co.automatictester.lightning.readers.JMeterCSVFileReader)2 LightningXMLFileReader (uk.co.automatictester.lightning.readers.LightningXMLFileReader)2 PerfMonDataReader (uk.co.automatictester.lightning.readers.PerfMonDataReader)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)1 CSVFileIOException (uk.co.automatictester.lightning.exceptions.CSVFileIOException)1 CSVFileNoTransactionsException (uk.co.automatictester.lightning.exceptions.CSVFileNoTransactionsException)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 PassedTransactionsTest (uk.co.automatictester.lightning.tests.PassedTransactionsTest)1