use of org.activityinfo.legacy.shared.command.GetReports in project activityinfo by bedatadriven.
the class GetReportsTest method performanceTest.
@OnDataSet("/dbunit/get-report-performance-tests.db.xml")
// AI-1223
@Test
public void performanceTest() {
// initial performance: 1838ms - sql fetch, 1962ms - time for client (+serialization/deserialization)
// after performance tuning: 229ms - sql fetch, 273 ms - time for client (+serialization/deserialization)
setUser(1);
Stopwatch started = Stopwatch.createStarted();
ReportsResult result = execute(new GetReports());
assertNotNull(result);
assertEquals(1, result.getData().get(0).getId());
assertEquals("Report 1", result.getData().get(0).getTitle());
assertEquals("Alex", result.getData().get(0).getOwnerName());
long elapsed = started.elapsed(TimeUnit.MILLISECONDS);
// must be less then one second
assertTrue("GetReports takes " + elapsed + "ms.", elapsed < 1000);
}
use of org.activityinfo.legacy.shared.command.GetReports in project activityinfo by bedatadriven.
the class GetReportsTest method selectByUser2.
@Test
public void selectByUser2() {
setUser(2);
ReportsResult result = execute(new GetReports());
assertNotNull(result);
assertThat(result.getData().size(), equalTo(1));
assertEquals(2, result.getData().get(0).getId());
assertEquals("Report 1", result.getData().get(0).getTitle());
assertEquals("Bavon", result.getData().get(0).getOwnerName());
}
use of org.activityinfo.legacy.shared.command.GetReports in project activityinfo by bedatadriven.
the class GetReportsTest method selectByUser1.
@Test
public void selectByUser1() {
setUser(1);
ReportsResult result = execute(new GetReports());
assertNotNull(result);
assertTrue(result.getData().size() == 2);
assertEquals(1, result.getData().get(0).getId());
assertEquals("Report 1", result.getData().get(0).getTitle());
assertEquals("Alex", result.getData().get(0).getOwnerName());
assertEquals(3, result.getData().get(1).getId());
assertEquals("Report 3", result.getData().get(1).getTitle());
assertEquals("Alex", result.getData().get(1).getOwnerName());
assertEquals(Integer.valueOf(1), result.getData().get(1).getDay());
assertEquals(EmailDelivery.NONE, result.getData().get(1).getEmailDelivery());
}
Aggregations