Author: nmalin
Date: Mon Apr 13 20:14:10 2015 New Revision: 1673269 URL: http://svn.apache.org/r1673269 Log: Change performfind test sequence to escape a random error with dbcp, related to issue OFBIZ-6218 Unit tests throw exception in DBCP. Thanks Adrian for report it Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/test/PerformFindTests.java Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/test/PerformFindTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/test/PerformFindTests.java?rev=1673269&r1=1673268&r2=1673269&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/test/PerformFindTests.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/test/PerformFindTests.java Mon Apr 13 20:14:10 2015 @@ -103,7 +103,21 @@ public class PerformFindTests extends OF } } - public void testPerformFindConditionFieldEquals() throws Exception { + /** + * Main test function to call other test. + * If each function call by junit, it generate an random error with DBCP + * See the issue OFBIZ-6218 Unit tests throw exception in DBCP for more details + * @throws Exception + */ + public void testPerformFind() throws Exception { + performFindConditionFieldEquals(); + performFindConditionFieldLike(); + performFindConditionDistinct(); + performFindFilterByDate(); + performFindFilterByDateWithDedicateDateField(); + } + + private void performFindConditionFieldEquals() throws Exception { GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system"); prepareData(); @@ -140,7 +154,7 @@ public class PerformFindTests extends OF assertEquals("performFind search without condition with equals on testingId", 1, foundElements.size()); } - public void testPerformFindConditionFieldLike() throws Exception { + private void performFindConditionFieldLike() throws Exception { GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system"); prepareData(); @@ -177,7 +191,7 @@ public class PerformFindTests extends OF assertEquals("performFind search with not like %name% condition", 1, foundElements.size()); } - public void testPerformFindConditionDistinct() throws Exception { + private void performFindConditionDistinct() throws Exception { GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system"); prepareData(); @@ -198,7 +212,7 @@ public class PerformFindTests extends OF assertEquals("performFind search with distinct Y", 5, foundElements.size()); } - public void testPerformFindFilterByDate() throws Exception { + private void performFindFilterByDate() throws Exception { GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system"); prepareData(); @@ -218,7 +232,7 @@ public class PerformFindTests extends OF assertEquals("performFind search with filterDate Y", 3, foundElements.size()); } - public void testPerformFindFilterByDateWithDedicateDateField() throws Exception { + private void performFindFilterByDateWithDedicateDateField() throws Exception { GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system"); prepareData(); |
Free forum by Nabble | Edit this page |