Search in sources :

Example 11 with PerfMonDataEntries

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

the class PerfMonS3ObjectDataReader method getDataEntires.

public PerfMonDataEntries getDataEntires(String csvObject) {
    PerfMonDataEntries perfMonDataEntries = new PerfMonDataEntries();
    String csvObjectContent = s3Client.getS3ObjectContent(csvObject);
    try (InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(csvObjectContent.getBytes()))) {
        perfMonDataEntries.addAll(getParser().parseAll(isr));
    } catch (IOException e) {
        throw new CSVFileIOException(e);
    }
    if (perfMonDataEntries.isEmpty()) {
        throw new CSVFileNoTransactionsException();
    }
    return perfMonDataEntries;
}
Also used : InputStreamReader(java.io.InputStreamReader) ByteArrayInputStream(java.io.ByteArrayInputStream) PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) IOException(java.io.IOException) CSVFileIOException(uk.co.automatictester.lightning.exceptions.CSVFileIOException) CSVFileNoTransactionsException(uk.co.automatictester.lightning.exceptions.CSVFileNoTransactionsException) CSVFileIOException(uk.co.automatictester.lightning.exceptions.CSVFileIOException)

Example 12 with PerfMonDataEntries

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

the class ServerSideTestTest method verifyExecute_LessThan_Pass.

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

Example 13 with PerfMonDataEntries

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

the class ServerSideTestTest method verifyExecute_LessThan_Fail.

@Test
public void verifyExecute_LessThan_Fail() {
    ServerSideTest test = new ServerSideTest("Test #1", "serverSideTest", ServerSideTestType.LESS_THAN, "Verify CPU utilisation", "192.168.0.12 CPU", 27500);
    PerfMonDataEntries dataEntries = new PerfMonDataEntries();
    dataEntries.add(TestData.CPU_ENTRY_25000);
    dataEntries.add(TestData.CPU_ENTRY_30000);
    test.execute(dataEntries);
    assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
}
Also used : PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) Test(org.testng.annotations.Test)

Example 14 with PerfMonDataEntries

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

the class ServerSideTestTest method verifyExecute_GreaterThan_Fail.

@Test
public void verifyExecute_GreaterThan_Fail() {
    ServerSideTest test = new ServerSideTest("Test #1", "serverSideTest", ServerSideTestType.GREATER_THAN, "Verify CPU utilisation", "192.168.0.12 CPU", 12500);
    PerfMonDataEntries dataEntries = new PerfMonDataEntries();
    dataEntries.add(TestData.CPU_ENTRY_10000);
    dataEntries.add(TestData.CPU_ENTRY_15000);
    test.execute(dataEntries);
    assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
}
Also used : PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) Test(org.testng.annotations.Test)

Example 15 with PerfMonDataEntries

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

the class ServerSideTestTest method verifyExecute_Between_Fail.

@Test
public void verifyExecute_Between_Fail() {
    ServerSideTest test = new ServerSideTest("Test #1", "serverSideTest", ServerSideTestType.BETWEEN, "Verify CPU utilisation", "192.168.0.12 CPU", 10000, 12499);
    PerfMonDataEntries dataEntries = new PerfMonDataEntries();
    dataEntries.add(TestData.CPU_ENTRY_10000);
    dataEntries.add(TestData.CPU_ENTRY_15000);
    test.execute(dataEntries);
    assertThat(test.getResult(), is(equalTo(TestResult.FAIL)));
}
Also used : PerfMonDataEntries(uk.co.automatictester.lightning.data.PerfMonDataEntries) Test(org.testng.annotations.Test)

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