1 22 package org.jboss.test.cmp2.jbas1665; 23 24 import javax.naming.InitialContext ; 25 import javax.naming.NamingException ; 26 import org.jboss.test.JBossTestCase; 27 import org.jboss.test.util.ejb.EJBTestCase; 28 import junit.framework.Test; 29 30 34 public class JBAS1665UnitTestCase 35 extends EJBTestCase 36 { 37 public static Test suite() throws Exception 38 { 39 return JBossTestCase.getDeploySetup(JBAS1665UnitTestCase.class, "cmp2-jbas1665.jar"); 40 } 41 42 public JBAS1665UnitTestCase(String methodName) 43 { 44 super(methodName); 45 } 46 47 protected void setUp() throws Exception 48 { 49 getOrderLocalHome().create(new Integer (1), "order"); 50 } 51 52 protected void tearDown() throws Exception 53 { 54 getOrderLocalHome().remove(new Integer (1)); 55 } 56 57 59 public void testJBAS1665() throws Throwable 60 { 61 java.util.Collection all = getOrderLocalHome().findAll(); 62 assertEquals(1, all.size()); 63 } 64 65 public void testJBAS3095() throws Exception 66 { 67 OrderLocalHome oh = getOrderLocalHome(); 68 oh.select("select object(o) from Order o where o.id > 0 order \t\n by o.id", null); 69 oh.select("select object(o) from Order o order \n by o.id", null); 70 oh.select("select object(byy) from Order byy order \n by byy.id", null); 71 } 72 73 75 private OrderLocalHome getOrderLocalHome() 76 throws NamingException 77 { 78 return (OrderLocalHome)lookup(OrderLocalHome.JNDI_NAME); 79 } 80 81 private Object lookup(String name) throws NamingException 82 { 83 InitialContext ic = new InitialContext (); 84 return ic.lookup(name); 85 } 86 } 87 | Popular Tags |