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;
}
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)));
}
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)));
}
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)));
}
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)));
}
Aggregations