[jboss-cvs] JBossAS SVN: r67378 - branches/Branch_4_4/testsuite/src/main/org/jboss/test/cmp2/commerce.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 22 06:58:58 EST 2007


Author: alex.loubyansky at jboss.com
Date: 2007-11-22 06:58:58 -0500 (Thu, 22 Nov 2007)
New Revision: 67378

Modified:
   branches/Branch_4_4/testsuite/src/main/org/jboss/test/cmp2/commerce/QueryTest.java
Log:
JBAS-3423

Modified: branches/Branch_4_4/testsuite/src/main/org/jboss/test/cmp2/commerce/QueryTest.java
===================================================================
--- branches/Branch_4_4/testsuite/src/main/org/jboss/test/cmp2/commerce/QueryTest.java	2007-11-22 11:51:43 UTC (rev 67377)
+++ branches/Branch_4_4/testsuite/src/main/org/jboss/test/cmp2/commerce/QueryTest.java	2007-11-22 11:58:58 UTC (rev 67378)
@@ -1,28 +1,29 @@
 /*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
 package org.jboss.test.cmp2.commerce;
 
 import java.util.Collection;
 import java.util.Set;
+import java.util.Properties;
 import java.lang.reflect.Method;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
@@ -38,13 +39,13 @@
 import org.jboss.mx.server.registry.MBeanEntry;
 import org.jboss.mx.server.registry.MBeanRegistry;
 import org.jboss.test.JBossTestCase;
+import org.jboss.test.util.ejb.EJBTestCase;
 import org.jboss.mx.util.MBeanProxyExt;
 import org.jboss.util.UnreachableStatementException;
 
-public class QueryTest extends org.jboss.test.util.ejb.EJBTestCase
+public class QueryTest extends EJBTestCase
 {
    private JDBCEJBQLCompiler compiler;
-   private static final String javaVersion = System.getProperty("java.specification.version");
    private static final Class[] NO_PARAMS = new Class[]{};
 
    public static Test suite() throws Exception
@@ -57,7 +58,7 @@
       super(name);
    }
 
-   public void setUpEJB() throws Exception
+   public void setUpEJB(Properties props) throws Exception
    {
       MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
       ObjectName name = new ObjectName("jboss.j2ee:jndiName=commerce/Order,service=EJB");
@@ -164,17 +165,11 @@
                    compileJBossQL("SELECT OBJECT(u) FROM user u WHERE LCASE(u.userName) = ?1",
                                   Collection.class, new Class[]{String.class}));
 
-      String expected = "1.4".equals(javaVersion) ?
-            "SELECT t0_o1.ORDER_NUMBER FROM ORDER_DATA t0_o1, ORDER_DATA t3_o2, CUSTOMEREJB t2_o2_customer, CUSTOMEREJB t1_o1_customer WHERE (( NOT (t1_o1_customer.id=t2_o2_customer.id)) AND (t0_o1.CC_TYPE=t3_o2.CC_TYPE AND t0_o1.CC_FIRST_NAME=t3_o2.CC_FIRST_NAME AND t0_o1.CC_MI=t3_o2.CC_MI AND t0_o1.CC_LAST_NAME=t3_o2.CC_LAST_NAME AND t0_o1.CC_BILLING_ZIP=t3_o2.CC_BILLING_ZIP AND t0_o1.CC_CARD_NUMBER=t3_o2.CC_CARD_NUMBER) AND t3_o2.customer=t2_o2_customer.id AND t0_o1.customer=t1_o1_customer.id)" :
-            "SELECT t0_o1.ORDER_NUMBER FROM ORDER_DATA t0_o1, ORDER_DATA t3_o2, CUSTOMEREJB t1_o1_customer, CUSTOMEREJB t2_o2_customer WHERE (( NOT (t1_o1_customer.id=t2_o2_customer.id)) AND (t0_o1.CC_TYPE=t3_o2.CC_TYPE AND t0_o1.CC_FIRST_NAME=t3_o2.CC_FIRST_NAME AND t0_o1.CC_MI=t3_o2.CC_MI AND t0_o1.CC_LAST_NAME=t3_o2.CC_LAST_NAME AND t0_o1.CC_BILLING_ZIP=t3_o2.CC_BILLING_ZIP AND t0_o1.CC_CARD_NUMBER=t3_o2.CC_CARD_NUMBER) AND t0_o1.customer=t1_o1_customer.id AND t3_o2.customer=t2_o2_customer.id)";
+      String expected = "SELECT t0_o1.ORDER_NUMBER FROM ORDER_DATA t0_o1, ORDER_DATA t3_o2, CUSTOMEREJB t2_o2_customer, CUSTOMEREJB t1_o1_customer WHERE (( NOT (t1_o1_customer.id=t2_o2_customer.id)) AND (t0_o1.CC_TYPE=t3_o2.CC_TYPE AND t0_o1.CC_FIRST_NAME=t3_o2.CC_FIRST_NAME AND t0_o1.CC_MI=t3_o2.CC_MI AND t0_o1.CC_LAST_NAME=t3_o2.CC_LAST_NAME AND t0_o1.CC_BILLING_ZIP=t3_o2.CC_BILLING_ZIP AND t0_o1.CC_CARD_NUMBER=t3_o2.CC_CARD_NUMBER) AND t3_o2.customer=t2_o2_customer.id AND t0_o1.customer=t1_o1_customer.id)";
       String compiled = compileJBossQL(
          "SELECT OBJECT(o1) FROM OrderX o1, OrderX o2 WHERE o1.customer <> o2.customer AND o1.creditCard = o2.creditCard",
          Collection.class, NO_PARAMS);
-      /*
       assertTrue("Expected: " + expected + " but got: " + compiled, expected.equals(compiled));
-      */
-      if( expected.equals(compiled) == false )
-         System.err.println("Expected: " + expected + " but got: " + compiled);
 
       assertEquals("SELECT t0_o.ORDER_NUMBER " +
                    "FROM ORDER_DATA t0_o " +
@@ -307,33 +302,21 @@
          )
       );
 
-      String expected = "1.4".equals(javaVersion) ?
+      String expected =
          "SELECT t0_o.ORDER_NUMBER " +
          "FROM ORDER_DATA t0_o, LINEITEMEJB t4_l, PRODUCTCATEGORYEJB t1_pc, PRODUCT_PRODUCT_CATEGORY t5_l_product_productCategories_R, PRODUCT t6_l_product " +
          "WHERE (((t0_o.ORDER_NUMBER = ? AND t1_pc.name = ?))) " +
          "AND t6_l_product.id=t5_l_product_productCategories_R.PRODUCT_ID " +
          "AND t1_pc.id=t5_l_product_productCategories_R.PRODUCT_CATEGORY_ID " +
          "AND t1_pc.subId=t5_l_product_productCategories_R.PRODUCT_CATEGORY_SUBID " +
-         "AND t4_l.product=t6_l_product.id AND t0_o.ORDER_NUMBER=t4_l.ORDER_NUMBER" :
-         "SELECT t0_o.ORDER_NUMBER " +
-         "FROM ORDER_DATA t0_o, LINEITEMEJB t4_l, PRODUCTCATEGORYEJB t1_pc, PRODUCT_PRODUCT_CATEGORY t5_l_product_productCategories_R, PRODUCT t6_l_product " +
-         "WHERE (((t0_o.ORDER_NUMBER = ? AND t1_pc.name = ?))) " +
-         "AND t0_o.ORDER_NUMBER=t4_l.ORDER_NUMBER " +
-         "AND t6_l_product.id=t5_l_product_productCategories_R.PRODUCT_ID " +
-         "AND t1_pc.id=t5_l_product_productCategories_R.PRODUCT_CATEGORY_ID " +
-         "AND t1_pc.subId=t5_l_product_productCategories_R.PRODUCT_CATEGORY_SUBID " +
-         "AND t4_l.product=t6_l_product.id";
+         "AND t4_l.product=t6_l_product.id AND t0_o.ORDER_NUMBER=t4_l.ORDER_NUMBER";
 
       String compiled = compileEJBQL("SELECT OBJECT(o) FROM OrderX o, " +
                                       "IN(o.lineItems) l, " +
                                       "IN(l.product.productCategories) pc " +
                                       "WHERE (o.ordernumber = ?1 and pc.name=?2)",
                                       Collection.class, new Class[]{Long.class, String.class});
-      /*
       assertEquals(expected, compiled);
-      */
-      if( expected.equals(compiled) == false )
-         System.err.println("Expected: " + expected + " but got: " + compiled);
 
       expected = "SELECT DISTINCT t0_o.ORDER_NUMBER " +
          "FROM ORDER_DATA t0_o, LINEITEMEJB t3_l " +




More information about the jboss-cvs-commits mailing list