[jboss-cvs] JBossAS SVN: r63027 - branches/Branch_4_0/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 06:48:54 EDT 2007


Author: alex.loubyansky at jboss.com
Date: 2007-05-14 06:48:53 -0400 (Mon, 14 May 2007)
New Revision: 63027

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java
Log:
JBAS-4408 tests

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java	2007-05-13 16:42:32 UTC (rev 63026)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/cmp2/ejbselect/EJBSelectUnitTestCase.java	2007-05-14 10:48:53 UTC (rev 63027)
@@ -331,4 +331,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