[jboss-cvs] JBossAS SVN: r63031 - trunk/testsuite/src/main/org/jboss/test/cmp2/ejbselect.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 14 07:08:32 EDT 2007
Author: alex.loubyansky at jboss.com
Date: 2007-05-14 07:08:32 -0400 (Mon, 14 May 2007)
New Revision: 63031
Modified:
trunk/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java
Log:
JBAS-4408 tests
Modified: trunk/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java 2007-05-14 10:59:01 UTC (rev 63030)
+++ trunk/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java 2007-05-14 11:08:32 UTC (rev 63031)
@@ -332,4 +332,38 @@
);
assertTrue("UCASE(SUBSTRING(CONCAT(b.id, b.name), 5, 7)) = ICE", "ICE".equals(result.iterator().next()));
}
+
+ public void testLimit() throws Exception
+ {
+ Collection col = BUtil.getLocalHome().selectDynamic("select object(b) from B b where b.id is not null order by b.id desc limit 1", null);
+ assertEquals(1, col.size());
+ BLocal b = (BLocal)col.iterator().next();
+ assertEquals("B4", b.getId());
+ }
+
+ public void testOffset() throws Exception
+ {
+ Collection col = BUtil.getLocalHome().selectDynamic("select object(b) from B b where b.id is not null order by b.id offset 1", null);
+ assertEquals(3, col.size());
+ Iterator iter = col.iterator();
+ int i = 2;
+ while(iter.hasNext())
+ {
+ BLocal b = (BLocal)iter.next();
+ assertEquals("B" + i++, b.getId());
+ }
+ }
+
+ public void testOffsetLimit() throws Exception
+ {
+ Collection col = BUtil.getLocalHome().selectDynamic("select object(b) from B b where b.id is not null order by b.id offset 1 limit 2", null);
+ assertEquals(2, col.size());
+ Iterator iter = col.iterator();
+ int i = 2;
+ while(iter.hasNext())
+ {
+ BLocal b = (BLocal)iter.next();
+ assertEquals("B" + i++, b.getId());
+ }
+ }
}
More information about the jboss-cvs-commits
mailing list