/** Read all employees with scrollable cursor. */ public void addReadAllScrollableCursorTest() { PerformanceComparisonTestCase test = new PerformanceComparisonTestCase() { public void test() { ReadAllQuery query = new ReadAllQuery(Employee.class); query.useScrollableCursor(); Cursor cursor = (Cursor) getSession().executeQuery(query); cursor.close(); } }; test.setName("ReadAllScrollableCursorTest"); test.setAllowableDecrease(50); addTest(test); }
/** Read all employees in-memory. */ public void addReadAllInMemoryTest() { PerformanceComparisonTestCase test = new PerformanceComparisonTestCase() { public void test() { ReadAllQuery query = new ReadAllQuery(Employee.class); ExpressionBuilder builder = new ExpressionBuilder(); query.setSelectionCriteria(builder.get("salary").greaterThan(0)); query.checkCacheOnly(); List results = (List) getSession().executeQuery(query); } }; test.setName("ReadAllInMemoryTest"); test.setAllowableDecrease(2000); addTest(test); }
/** * Load the last test result from the test result database. Find only the results run on the same * machine and database. Compare the current test run result with the previous results do * determine if the test passes or fails. */ public void verify() { super.verify(); verify(this); }