[
http://jira.jboss.com/jira/browse/JBAS-5497?page=all ]
Shelly McGowan updated JBAS-5497:
---------------------------------
Summary: JDK6: org.jboss.test.cmp2.commerce.QueryTest#testEJBQL (was: JDK6:
org.jboss.test.cmp2.commerce.)
Description:
This tests has several assertions verifying the compilation of EJB-QL to SQL using
org.jboss.ejb.plugins.cmp.jdbc.compileEJBQL() t. With JavaSE6 there are two EJB-QL
queries that use the conditional AND expression in the WHERE clause. The expected result
does not match the generated SQL causing the assertion failures. The generated SQL, after
review, has been determined to generate the same query result. Therefore, the tests were
adjusted to pass on either condition. This issue has been seen before as one of the
cases has already been conditionlized but tests for javaVersion "1.4".
1)
JDK 5:
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB t0_l
" +
"WHERE ((t1_c.id = 1)) AND t1_c.id=t3_o.customer AND
t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o,
IN(o.lineItems) l WHERE c.id=1"));
else {
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB t0_l
" +
"WHERE ((t1_c.id = 1)) AND t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER AND
t1_c.id=t3_o.customer",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o,
IN(o.lineItems) l WHERE c.id=1"));
}
2)
- String expected = "1.4".equals(javaVersion) ?
+ String expected = "1.5".equals(javaVersion) ?
"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";
JDK6: org.jboss.test.cmp2.commerce.QueryTest#testEJBQL
------------------------------------------------------
Key: JBAS-5497
URL:
http://jira.jboss.com/jira/browse/JBAS-5497
Project: JBoss Application Server
Issue Type: Sub-task
Security Level: Public(Everyone can see)
Reporter: Shelly McGowan
Assigned To: Shelly McGowan
This tests has several assertions verifying the compilation of EJB-QL to SQL using
org.jboss.ejb.plugins.cmp.jdbc.compileEJBQL() t. With JavaSE6 there are two EJB-QL
queries that use the conditional AND expression in the WHERE clause. The expected result
does not match the generated SQL causing the assertion failures. The generated SQL, after
review, has been determined to generate the same query result. Therefore, the tests were
adjusted to pass on either condition. This issue has been seen before as one of the
cases has already been conditionlized but tests for javaVersion "1.4".
1)
JDK 5:
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB
t0_l " +
"WHERE ((t1_c.id = 1)) AND t1_c.id=t3_o.customer AND
t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o,
IN(o.lineItems) l WHERE c.id=1"));
else {
assertEquals("SELECT t0_l.id FROM CUSTOMEREJB t1_c, ORDER_DATA t3_o, LINEITEMEJB
t0_l " +
"WHERE ((t1_c.id = 1)) AND t3_o.ORDER_NUMBER=t0_l.ORDER_NUMBER AND
t1_c.id=t3_o.customer",
compileEJBQL("SELECT OBJECT(l) FROM Customer c, IN(c.orders) o,
IN(o.lineItems) l WHERE c.id=1"));
}
2)
- String expected = "1.4".equals(javaVersion) ?
+ String expected = "1.5".equals(javaVersion) ?
"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";
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira