project junit-upgrade:Some changes in classes src-test.
authorInigo Sanchez <inigo.sanchez@openbravo.com>
Wed, 06 Aug 2014 12:44:16 +0200
changeset 24233 6ced7b4eac48
parent 24232 1cdd36708614
child 24234 175d5fa16caa
project junit-upgrade:Some changes in classes src-test.
.classpath.template
lib/build/hamcrest-all-1.3.jar
lib/build/hamcrest-core-1.3.jar
src-test/org/openbravo/erpCommon/info/ClassicSelectorTest.java
src-test/org/openbravo/test/accounting/RecordID2Test.java
src-test/org/openbravo/test/base/BaseTest.java
src-test/org/openbravo/test/base/OBBaseTest.java
src-test/org/openbravo/test/dal/ADCachedMultiThreadTest.java
src-test/org/openbravo/test/dal/AdminContextTest.java
src-test/org/openbravo/test/dal/ComputedColumnsTest.java
src-test/org/openbravo/test/dal/DalComplexQueryRequisitionTest.java
src-test/org/openbravo/test/dal/DalCopyTest.java
src-test/org/openbravo/test/dal/DalFilterTest.java
src-test/org/openbravo/test/dal/DalPerformanceInventoryLineTest.java
src-test/org/openbravo/test/dal/DalQueryTest.java
src-test/org/openbravo/test/dal/DalStoredProcedureTest.java
src-test/org/openbravo/test/dal/DalTest.java
src-test/org/openbravo/test/dal/DalUtilTest.java
src-test/org/openbravo/test/dal/DoOrgClientAccessCheckTest.java
src-test/org/openbravo/test/dal/DynamicEntityTest.java
src-test/org/openbravo/test/dal/HiddenUpdateTest.java
src-test/org/openbravo/test/dal/IssuesTest.java
src-test/org/openbravo/test/dal/OBContextTest.java
src-test/org/openbravo/test/dal/ReadByNameTest.java
src-test/org/openbravo/test/dal/ValidationTest.java
src-test/org/openbravo/test/dal/ViewTest.java
src-test/org/openbravo/test/datasource/TestCSVEncoding.java
src-test/org/openbravo/test/expression/EvaluationTest.java
src-test/org/openbravo/test/model/ClassLoaderTest.java
src-test/org/openbravo/test/model/FieldProviderTest.java
src-test/org/openbravo/test/model/IndexesTest.java
src-test/org/openbravo/test/model/OneToManyTest.java
src-test/org/openbravo/test/model/RuntimeModelTest.java
src-test/org/openbravo/test/model/TrlColumnsOraTypeTest.java
src-test/org/openbravo/test/model/UniqueConstraintTest.java
src-test/org/openbravo/test/modularity/DBPrefixTest.java
src-test/org/openbravo/test/modularity/MergePropertiesTest.java
src-test/org/openbravo/test/modularity/TableNameTest.java
src-test/org/openbravo/test/preference/PreferenceTest.java
src-test/org/openbravo/test/security/AccessLevelTest.java
src-test/org/openbravo/test/security/AllowedOrganizationsTest.java
src-test/org/openbravo/test/security/EntityAccessTest.java
src-test/org/openbravo/test/security/WritableReadableOrganizationClientTest.java
src-test/org/openbravo/test/system/ErrorTextParserTest.java
src-test/org/openbravo/test/system/OBPropertiesProviderTest.java
src-test/org/openbravo/test/system/SystemServiceTest.java
src-test/org/openbravo/test/system/SystemValidatorTest.java
src-test/org/openbravo/test/webservice/BaseWSTest.java
src-test/org/openbravo/test/webservice/WSAddRecordWithComputedColumns.java
src-test/org/openbravo/test/webservice/WSReadTest.java
src-test/org/openbravo/test/webservice/WSUpdateTest.java
src-test/org/openbravo/test/xml/ClientExportImportTest.java
src-test/org/openbravo/test/xml/DatasetExportTest.java
src-test/org/openbravo/test/xml/EntityXMLImportTestBusinessObject.java
src-test/org/openbravo/test/xml/EntityXMLImportTestReference.java
src-test/org/openbravo/test/xml/EntityXMLImportTestSingle.java
src-test/org/openbravo/test/xml/EntityXMLImportTestWarning.java
src-test/org/openbravo/test/xml/EntityXMLIssues.java
src-test/org/openbravo/test/xml/UniqueConstraintImportTest.java
src-test/org/openbravo/test/xml/XMLBaseTest.java
--- a/.classpath.template	Tue Jul 29 12:19:10 2014 +0200
+++ b/.classpath.template	Wed Aug 06 12:44:16 2014 +0200
@@ -30,5 +30,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="lib/build/junit.jar"/>
 	<classpathentry kind="lib" path="lib/build/js.jar"/>
+	<classpathentry kind="lib" path="lib/build/hamcrest-all-1.3.jar"/>
 	<classpathentry kind="output" path="build/classes"/>
 </classpath>
Binary file lib/build/hamcrest-all-1.3.jar has changed
Binary file lib/build/hamcrest-core-1.3.jar has changed
--- a/src-test/org/openbravo/erpCommon/info/ClassicSelectorTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/erpCommon/info/ClassicSelectorTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,10 +19,13 @@
 
 package org.openbravo.erpCommon.info;
 
+import static org.junit.Assert.assertEquals;
+
 import javax.servlet.ServletException;
 
+import org.junit.Test;
 import org.openbravo.erpCommon.utility.TableSQLData;
-import org.openbravo.test.base.BaseTest;
+import org.openbravo.test.base.OBBaseTest;
 
 /**
  * Tests consistency between select and countRows methods of the (old) selectors in erpCommon/info.
@@ -31,11 +34,12 @@
  * 
  * @author huehner
  */
-public class ClassicSelectorTest extends BaseTest {
+public class ClassicSelectorTest extends OBBaseTest {
 
   /**
    * Test BusinessPartnerMultiple selector.
    */
+  @Test
   public void testBpartnerMultiple() throws Exception {
 
     String client = "'" + TEST_CLIENT_ID + "'";
--- a/src-test/org/openbravo/test/accounting/RecordID2Test.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/accounting/RecordID2Test.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.accounting;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
--- a/src-test/org/openbravo/test/base/BaseTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/base/BaseTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -49,8 +49,10 @@
 import org.openbravo.model.ad.access.User;
 
 /**
- * Base test class which can/should be extended by most other test classes which want to make use of
- * the Openbravo test infrastructure.
+ * BaseTest class is deprecated. All test case that works with old notation, will be working
+ * normally.
+ * 
+ * @deprecated
  * 
  * @author mtaal
  * @author iperdomo
--- a/src-test/org/openbravo/test/base/OBBaseTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/base/OBBaseTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -26,8 +26,6 @@
 import java.util.Map;
 import java.util.Random;
 
-import junit.framework.TestCase;
-
 import org.apache.log4j.Logger;
 import org.apache.log4j.PropertyConfigurator;
 import org.hibernate.criterion.Restrictions;
@@ -50,14 +48,14 @@
 import org.openbravo.model.ad.access.User;
 
 /**
- * Base test class which can/should be extended by most other test classes which want to make use of
- * the Openbravo test infrastructure.
+ * OBBaseTest class which can/should be extended by most other test classes which want to make use
+ * of the Openbravo test infrastructure.
  * 
- * @author mtaal
- * @author iperdomo
+ * @author inigosanchez
+ * 
  */
 
-public class OBBaseTest extends TestCase {
+public class OBBaseTest {
 
   private static final Logger log = Logger.getLogger(OBBaseTest.class);
 
@@ -170,7 +168,7 @@
     initializeDalLayer();
     // clear the session otherwise it keeps the old model
     setTestUserContext();
-    super.setUp();
+    // super.setUp();
     // be negative is set back to false at the end of a successfull test.
     errorOccured = true;
   }
@@ -331,7 +329,7 @@
       SessionHandler.deleteSessionHandler();
       OBContext.setOBContext((OBContext) null);
     }
-    super.tearDown();
+    // super.tearDown();
   }
 
   /**
@@ -370,7 +368,7 @@
   }
 
   /**
-   * Deprecated, no need to call this method explicitly anymore. The BaseTest class overrides the
+   * Deprecated, no need to call this method explicitly anymore. The OBBaseTest class overrides the
    * runTest method which sets the internal flag, overriding any value passed in this method.
    * 
    * @param errorOccured
--- a/src-test/org/openbravo/test/dal/ADCachedMultiThreadTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/ADCachedMultiThreadTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
--- a/src-test/org/openbravo/test/dal/AdminContextTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/AdminContextTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.test.base.OBBaseTest;
--- a/src-test/org/openbravo/test/dal/ComputedColumnsTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/ComputedColumnsTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Set;
 
 import org.codehaus.jettison.json.JSONException;
--- a/src-test/org/openbravo/test/dal/DalComplexQueryRequisitionTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalComplexQueryRequisitionTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
@@ -35,7 +36,6 @@
  * 
  * @author mtaal
  */
-
 public class DalComplexQueryRequisitionTest extends OBBaseTest {
 
   private static final Logger log = Logger.getLogger(DalComplexQueryRequisitionTest.class);
@@ -207,6 +207,7 @@
     }
   }
 
+  @Ignore("This test has been temporarily disabled.")
   @Test
   public void _testComplexQueryOne() {
     setTestAdminContext();
--- a/src-test/org/openbravo/test/dal/DalCopyTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalCopyTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+
 import java.util.ArrayList;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/dal/DalFilterTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalFilterTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -20,6 +20,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBQuery;
--- a/src-test/org/openbravo/test/dal/DalPerformanceInventoryLineTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalPerformanceInventoryLineTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -57,10 +57,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void testACreateInventoryLine() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    // if (1 == 1)
-    // return;
     setTestUserContext();
 
     // make sure our user can do this addReadWriteAccess(InventoryCount.class);
@@ -106,10 +102,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void testBReadAndAddLine() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    // if (1 == 1)
-    // return;
     setTestUserContext(); // make sure our user can do this
     addReadWriteAccess(InventoryCount.class);
     addReadWriteAccess(InventoryCountLine.class);
--- a/src-test/org/openbravo/test/dal/DalQueryTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalQueryTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -22,6 +22,10 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.ArrayList;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/dal/DalStoredProcedureTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalStoredProcedureTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
--- a/src-test/org/openbravo/test/dal/DalTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -22,6 +22,11 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
--- a/src-test/org/openbravo/test/dal/DalUtilTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DalUtilTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
--- a/src-test/org/openbravo/test/dal/DoOrgClientAccessCheckTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DoOrgClientAccessCheckTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.fail;
+
 import org.junit.Test;
 import org.openbravo.base.exception.OBSecurityException;
 import org.openbravo.base.provider.OBProvider;
--- a/src-test/org/openbravo/test/dal/DynamicEntityTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/DynamicEntityTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
--- a/src-test/org/openbravo/test/dal/HiddenUpdateTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/HiddenUpdateTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.fail;
+
 import java.io.Serializable;
 import java.util.Iterator;
 
--- a/src-test/org/openbravo/test/dal/IssuesTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/IssuesTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,12 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -532,10 +538,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void test13281And13283() throws Exception {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    // if (1 == 1)
-    // return;
     OBContext.setOBContext(TEST_USER_ID, TEST_ROLE_ID, TEST_CLIENT_ID, "0");
 
     // use the same logic as in the DalWebService
@@ -549,7 +551,7 @@
     final SAXReader reader = new SAXReader();
     final Document document = reader.read(this.getClass().getResourceAsStream("test_13281.xml"));
     final List<BaseOBObject> result = xec.process(document);
-    assertTrue(result.size() == 1);
+    assertEquals(1, result.size());
     assertTrue(result.get(0) instanceof Order);
     final Order order = (Order) result.get(0);
     // The same Organization ID of the test_13281.xml
--- a/src-test/org/openbravo/test/dal/OBContextTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/OBContextTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.test.base.OBBaseTest;
--- a/src-test/org/openbravo/test/dal/ReadByNameTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/ReadByNameTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -18,6 +18,12 @@
  */
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.UUID;
 
 import org.hibernate.criterion.Restrictions;
@@ -154,5 +160,6 @@
 
     assertNull(OBDal.getInstance().get(BusinessPartner.class, bpId));
     assertNull(OBDal.getInstance().get(Location.class, locId));
+    OBDal.getInstance().commitAndClose();
   }
 }
--- a/src-test/org/openbravo/test/dal/ValidationTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/ValidationTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.math.BigDecimal;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/dal/ViewTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/dal/ViewTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.dal;
 
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
--- a/src-test/org/openbravo/test/datasource/TestCSVEncoding.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/datasource/TestCSVEncoding.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.datasource;
 
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -128,10 +130,10 @@
     String[] res2 = response2.split("\n");
 
     OBContext.restorePreviousMode();
+    OBDal.getInstance().commitAndClose();
 
     // Second assert
     assertTrue("On delete CSV Text Preference Arabic characters are still showing", res2[1]
         .substring(1, 4).equals("?.?"));
-
   }
 }
\ No newline at end of file
--- a/src-test/org/openbravo/test/expression/EvaluationTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/expression/EvaluationTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.expression;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import javax.script.ScriptEngineFactory;
--- a/src-test/org/openbravo/test/model/ClassLoaderTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/ClassLoaderTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -18,6 +18,8 @@
  */
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+
 import java.util.ArrayList;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/model/FieldProviderTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/FieldProviderTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
--- a/src-test/org/openbravo/test/model/IndexesTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/IndexesTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.ArrayList;
--- a/src-test/org/openbravo/test/model/OneToManyTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/OneToManyTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import org.apache.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
 import org.junit.FixMethodOrder;
@@ -72,10 +75,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void testBAddOrderLine() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     setTestUserContext();
     addReadWriteAccess(Order.class);
     addReadWriteAccess(OrderLine.class);
@@ -115,10 +114,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void testCDeleteChild() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     setTestUserContext();
     addReadWriteAccess(Order.class);
     addReadWriteAccess(OrderLine.class);
--- a/src-test/org/openbravo/test/model/RuntimeModelTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/RuntimeModelTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,12 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.ArrayList;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/model/TrlColumnsOraTypeTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/TrlColumnsOraTypeTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.util.ArrayList;
--- a/src-test/org/openbravo/test/model/UniqueConstraintTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/model/UniqueConstraintTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.model;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
--- a/src-test/org/openbravo/test/modularity/DBPrefixTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/modularity/DBPrefixTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.modularity;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
@@ -43,8 +47,7 @@
   /**
    * Creates a new module to test with
    */
-  @Test
-  public void testACreateModule() {
+  private void createModule() {
     setSystemAdministratorContext();
     Module module = OBProvider.getInstance().get(Module.class);
     module.setName("Test-dbprefixes-names");
@@ -53,14 +56,16 @@
     module.setDescription("Testing dbprefixes");
     module.setInDevelopment(true);
     OBDal.getInstance().save(module);
-    OBDal.getInstance().commitAndClose();
+    OBDal.getInstance().flush();
   }
 
   /**
-   * Add a valid dbprefixes, everything should go ok only alphabetic upper chars
+   * Add a valid dbprefixes, everything should go ok only alphabetic upper chars. First call to
+   * createModule().
    */
   @Test
-  public void testBAddDBPrefixValid1() {
+  public void testAAddDBPrefixValid1() {
+    createModule();
     insertDBPrefix("OK", true);
   }
 
@@ -68,7 +73,7 @@
    * alpha numeric chars not starting with a numeric one
    */
   @Test
-  public void testCAddDBPrefixValid2() {
+  public void testBAddDBPrefixValid2() {
     insertDBPrefix("OK12", true);
   }
 
@@ -76,7 +81,7 @@
    * Add not valid db prefixes starts with number
    */
   @Test
-  public void testDAddDBPrefixNotValid1() {
+  public void testCAddDBPrefixNotValid1() {
     insertDBPrefix("1FAIL", false);
   }
 
@@ -84,7 +89,7 @@
    * contains lower case letters
    */
   @Test
-  public void testEAddDBPrefixNotValid2() {
+  public void testDAddDBPrefixNotValid2() {
     insertDBPrefix("Fail", false);
   }
 
@@ -92,23 +97,23 @@
    * contains underscore
    */
   @Test
-  public void testFAddDBPrefixNotValid3() {
+  public void testEAddDBPrefixNotValid3() {
     insertDBPrefix("FAIL_1", false);
   }
 
   /**
-   * contains other non-alphabetic chars
+   * contains other non-alphabetic chars. In the end, call to deleteModule
    */
   @Test
-  public void testGAddDBPrefixNotValid4() {
+  public void testFAddDBPrefixNotValid4() {
     insertDBPrefix("FAIL&/1", false);
+    deleteModule();
   }
 
   /**
    * Deletes all the modules matching the name for the testing one
    */
-  @Test
-  public void testHDeleteModule() {
+  public void deleteModule() {
     setSystemAdministratorContext();
     final OBCriteria<Module> obCriteria = OBDal.getInstance().createCriteria(Module.class);
     obCriteria.add(Restrictions.eq(Module.PROPERTY_JAVAPACKAGE, "org.openbravo.test.dbprefix"));
@@ -117,6 +122,7 @@
       System.out.println("Removing module: " + mod.getName());
       OBDal.getInstance().remove(mod);
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   // Obtains the module iserted for testing purposes
@@ -160,5 +166,6 @@
       assertFalse("Not inserted a valid prefix:" + name, exception);
     else
       assertTrue("Inserted a non-valid prefix:" + name, exception);
+    OBDal.getInstance().flush();
   }
 }
--- a/src-test/org/openbravo/test/modularity/MergePropertiesTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/modularity/MergePropertiesTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -45,8 +45,7 @@
    * @throws FileNotFoundException
    * @throws IOException
    */
-  @Test
-  public void testCreateOriginalFile1() throws FileNotFoundException, IOException {
+  private void createOriginalFile1() throws FileNotFoundException, IOException {
     Properties prop = new Properties();
     prop.setProperty("test1", "value1.custom");
     prop.setProperty("test2", "value2.custom");
@@ -59,8 +58,7 @@
    * @throws FileNotFoundException
    * @throws IOException
    */
-  @Test
-  public void testCreateNewFile1() throws FileNotFoundException, IOException {
+  private void createNewFile1() throws FileNotFoundException, IOException {
     Properties prop = new Properties();
     prop.setProperty("test1", "value1.default");
     prop.setProperty("test2", "value2.default");
@@ -76,6 +74,9 @@
    */
   @Test
   public void testMerge() throws FileNotFoundException, IOException {
+    createOriginalFile1();
+    createNewFile1();
+
     boolean modified = Utility.mergeOpenbravoProperties(ORIGINAL_FILE, NEW_FILE);
     assertTrue("File has not been modified while it should be", modified);
 
@@ -87,13 +88,14 @@
         prop.getProperty("test2").equals("value2.custom"));
     assertTrue("Not correctly merged test3 property",
         prop.getProperty("test3").equals("value3.default"));
+
+    testDeleteFiles1();
   }
 
   /**
    * deletes testing files
    */
-  @Test
-  public void testDeleteFiles1() {
+  private void testDeleteFiles1() {
     assertTrue("couldn't delete " + ORIGINAL_FILE, new File(ORIGINAL_FILE).delete());
     assertTrue("couldn't delete " + ORIGINAL_FILE, new File(NEW_FILE).delete());
   }
@@ -104,8 +106,7 @@
    * @throws FileNotFoundException
    * @throws IOException
    */
-  @Test
-  public void testCreateOriginalFile2() throws FileNotFoundException, IOException {
+  private void createOriginalFile2() throws FileNotFoundException, IOException {
     Properties prop = new Properties();
     prop.setProperty("test1", "value1.custom");
     prop.setProperty("test2", "value2.custom");
@@ -118,8 +119,7 @@
    * @throws FileNotFoundException
    * @throws IOException
    */
-  @Test
-  public void testCreateNewFile2() throws FileNotFoundException, IOException {
+  private void createNewFile2() throws FileNotFoundException, IOException {
     Properties prop = new Properties();
     prop.setProperty("test1", "value1.default");
     prop.setProperty("test2", "value2.default");
@@ -135,6 +135,9 @@
    */
   @Test
   public void testMerge2() throws FileNotFoundException, IOException {
+    createOriginalFile2();
+    createNewFile2();
+
     boolean modified = Utility.mergeOpenbravoProperties(ORIGINAL_FILE, NEW_FILE);
     assertFalse("File has been modified while it shouldn't be", modified);
 
@@ -145,13 +148,13 @@
     assertTrue("Not correctly merged test2 property",
         prop.getProperty("test2").equals("value2.custom"));
 
+    deleteFiles2();
   }
 
   /**
    * deletes testing files
    */
-  @Test
-  public void testDeleteFiles2() {
+  private void deleteFiles2() {
     assertTrue("couldn't delete " + ORIGINAL_FILE, new File(ORIGINAL_FILE).delete());
     assertTrue("couldn't delete " + ORIGINAL_FILE, new File(NEW_FILE).delete());
   }
--- a/src-test/org/openbravo/test/modularity/TableNameTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/modularity/TableNameTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.modularity;
 
+import static org.junit.Assert.fail;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
--- a/src-test/org/openbravo/test/preference/PreferenceTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/preference/PreferenceTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -18,6 +18,11 @@
  */
 package org.openbravo.test.preference;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
--- a/src-test/org/openbravo/test/security/AccessLevelTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/security/AccessLevelTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.security;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.ArrayList;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/security/AllowedOrganizationsTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/security/AllowedOrganizationsTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.security;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.Set;
 
 import org.junit.Test;
--- a/src-test/org/openbravo/test/security/EntityAccessTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/security/EntityAccessTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.security;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
@@ -73,7 +77,7 @@
       c.setCostingPrecision((long) 4);
       OBDal.getInstance().save(c);
     }
-    OBDal.getInstance().commitAndClose();
+
   }
 
   /**
@@ -85,8 +89,6 @@
   @Ignore("This test is currently disabled because after fixing issue #0010139, all entities are deletable.")
   @Test
   public void testBDoNotExecutetestNonDeletable() {
-    if (1 == 1)
-      return;
     setTestUserContext();
     addReadWriteAccess(Currency.class);
     final OBCriteria<Currency> obc = OBDal.getInstance().createCriteria(Currency.class);
@@ -149,7 +151,6 @@
         }
       }
     }
-    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -174,7 +175,6 @@
       assertTrue("Wrong exception thrown:  " + e.getMessage(),
           e.getMessage().indexOf("is not writable by this user") != -1);
     }
-    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -211,6 +211,5 @@
     final List<Currency> cs = obc.list();
     assertEquals(1, cs.size());
     OBDal.getInstance().remove(cs.get(0));
-    OBDal.getInstance().commitAndClose();
   }
 }
\ No newline at end of file
--- a/src-test/org/openbravo/test/security/WritableReadableOrganizationClientTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/security/WritableReadableOrganizationClientTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.security;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.Set;
--- a/src-test/org/openbravo/test/system/ErrorTextParserTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/system/ErrorTextParserTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.system;
 
+import static org.junit.Assert.assertEquals;
+
 import java.sql.Connection;
 
 import javax.servlet.ServletException;
--- a/src-test/org/openbravo/test/system/OBPropertiesProviderTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/system/OBPropertiesProviderTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.system;
 
+import static org.junit.Assert.assertEquals;
+
 import org.dom4j.Document;
 import org.dom4j.Element;
 import org.junit.Test;
--- a/src-test/org/openbravo/test/system/SystemServiceTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/system/SystemServiceTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.system;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.Date;
 import java.util.List;
 
--- a/src-test/org/openbravo/test/system/SystemValidatorTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/system/SystemValidatorTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.system;
 
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.util.List;
 import java.util.Properties;
--- a/src-test/org/openbravo/test/webservice/BaseWSTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/webservice/BaseWSTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.webservice;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
--- a/src-test/org/openbravo/test/webservice/WSAddRecordWithComputedColumns.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/webservice/WSAddRecordWithComputedColumns.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.webservice;
 
+import static org.junit.Assert.assertEquals;
+
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.junit.Test;
--- a/src-test/org/openbravo/test/webservice/WSReadTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/webservice/WSReadTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.webservice;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.net.URLEncoder;
 
 import org.junit.Test;
--- a/src-test/org/openbravo/test/webservice/WSUpdateTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/webservice/WSUpdateTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,11 +19,16 @@
 
 package org.openbravo.test.webservice;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.FileNotFoundException;
 import java.net.HttpURLConnection;
 
 import org.apache.log4j.Logger;
 import org.junit.FixMethodOrder;
+import org.junit.Test;
 import org.junit.runners.MethodSorters;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.dal.core.OBContext;
@@ -54,6 +59,7 @@
    * Creates a city through a webservice calls. This test must be run before the others because it
    * sets the cityId member in this class.
    */
+  @Test
   public void testACreateCity() {
     // do not replace this with a call to setUserContext,
     // the city must be stored using the client/org of the 100 user
@@ -96,6 +102,7 @@
    * 
    * @throws Exception
    */
+  @Test
   public void testBReadUpdateCity() throws Exception {
     initializeCreateCity();
 
@@ -122,6 +129,7 @@
    * 
    * @throws Exception
    */
+  @Test
   public void testCIncorrectRootTag() throws Exception {
     initializeCreateCity();
 
@@ -139,12 +147,14 @@
    * 
    * @throws Exception
    */
+  @Test
   public void testDReadAddDeleteCity() throws Exception {
     initializeCreateCity();
 
     doTestReadAddDeleteCity(false);
   }
 
+  @Test
   public void testEReadAddDeleteQueryCity() throws Exception {
     initializeCreateCity();
 
@@ -222,6 +232,7 @@
    * Tests issue 14973 https://issues.openbravo.com/view.php?id=14973 DalWebServiceServlet does not
    * report errors which occur at commit time
    */
+  @Test
   public void testFDoTest14973() throws Exception {
     final HttpURLConnection hc = createConnection("/ws/dal/Product/1000004", "DELETE");
     hc.connect();
@@ -233,6 +244,7 @@
    * 
    * @throws Exception
    */
+  @Test
   public void testGReadAddCityWrongMethodError() throws Exception {
     initializeCreateCity();
     final String city = doTestGetRequest("/ws/dal/City/" + cityId, null, 200);
@@ -254,6 +266,7 @@
    * 
    * @throws Exception
    */
+  @Test
   public void testHRemoveCity() throws Exception {
     initializeCreateCity();
     doDirectDeleteRequest("/ws/dal/City/" + cityId, 200);
--- a/src-test/org/openbravo/test/xml/ClientExportImportTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/ClientExportImportTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,11 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.File;
 import java.io.FileReader;
 import java.io.FileWriter;
@@ -33,6 +38,7 @@
 import org.apache.ddlutils.model.Table;
 import org.apache.ddlutils.platform.ExcludeFilter;
 import org.hibernate.criterion.Restrictions;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.model.Entity;
@@ -65,6 +71,7 @@
  * 
  * @author mtaal
  */
+// @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class ClientExportImportTest extends XMLBaseTest {
 
   // public void _testImportReferenceData() throws Exception {
@@ -101,6 +108,7 @@
    * 
    * Also tests mantis 9000: https://issues.openbravo.com/view.php?id=9000
    */
+  @Ignore("This test has been temporarily disabled until the following issue related to the export client functionality is fixed: https://issues.openbravo.com/view.php?id=14848")
   @Test
   public void testExportImportClient1000000() {
 
@@ -115,7 +123,6 @@
     // SystemService.getInstance().removeAllClientData(newClientId);
   }
 
-  @Test
   private void testTreeNodesMantis9000(String newClientID) {
     final OBQuery<TreeNode> nodes = OBDal.getInstance().createQuery(TreeNode.class,
         "client.id='" + newClientID + "'");
@@ -167,10 +174,8 @@
       }
     }
     assertTrue(testDoneAtLeastOnce);
-
   }
 
-  @Test
   private void testAccountingFactMantis9000(String newClientID) {
     final OBQuery<AccountingFact> facts = OBDal.getInstance().createQuery(AccountingFact.class,
         "client.id='" + newClientID + "'");
@@ -211,6 +216,7 @@
    * Exports the "QA Testing" client and then imports as a new client. Has as side effect that a
    * completely new client is added in the database.
    */
+  @Ignore("This test has been temporarily disabled.")
   @Test
   public void _testExportImportClient1000001() {
     exportImport(QA_TEST_CLIENT_ID);
@@ -222,7 +228,7 @@
    * activated
    */
   @Test
-  public void testDeleteClient() {
+  public void testZDeleteClient() {
     Platform platform = SystemService.getInstance().getPlatform();
     ExcludeFilter excludeFilter = DBSMOBUtil.getInstance().getExcludeFilter(
         new File(OBPropertiesProvider.getInstance().getOpenbravoProperties()
@@ -328,6 +334,8 @@
     }
   }
 
+  @Ignore("This test has been temporarily disabled.")
+  @Test
   public void _testImportAccountingTest() {
     doImport("Accounting_Test.xml");
   }
@@ -354,5 +362,4 @@
       throw new OBException(e);
     }
   }
-
 }
\ No newline at end of file
--- a/src-test/org/openbravo/test/xml/DatasetExportTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/DatasetExportTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
--- a/src-test/org/openbravo/test/xml/EntityXMLImportTestBusinessObject.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLImportTestBusinessObject.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collection;
--- a/src-test/org/openbravo/test/xml/EntityXMLImportTestReference.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLImportTestReference.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,10 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -93,10 +97,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void test1Warehouse() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     cleanRefDataLoaded();
     setTestUserContext();
     addReadWriteAccess(Warehouse.class);
@@ -129,10 +129,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void test2Warehouse() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     setUserContext(QA_TEST_ADMIN_USER_ID);
     // a warehouse is not deletable, but as we are cleaning up, they should be
     // deleted, force this by being admin
@@ -153,10 +149,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void test3Warehouse() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     setTestUserContext();
     addReadWriteAccess(Warehouse.class);
     final String xml = getXML(Warehouse.class,
@@ -188,10 +180,7 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void test4Warehouse() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
+
     setUserContext(QA_TEST_ADMIN_USER_ID);
     // a warehouse is not deletable, but as we are cleaning up, they should be
     // deleted, force this by being admin
--- a/src-test/org/openbravo/test/xml/EntityXMLImportTestSingle.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLImportTestSingle.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,13 +19,18 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import static org.openbravo.model.ad.system.Client.PROPERTY_ORGANIZATION;
 
 import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.hibernate.criterion.Restrictions;
+import org.junit.FixMethodOrder;
 import org.junit.Test;
+import org.junit.runners.MethodSorters;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.core.OBContext;
@@ -46,6 +51,7 @@
  * @author mtaal
  */
 
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class EntityXMLImportTestSingle extends XMLBaseTest {
 
   private static final Logger log = Logger.getLogger(EntityXMLImportTestSingle.class);
@@ -58,7 +64,7 @@
    * insert.
    */
   @Test
-  public void testImportNoUpdate() {
+  public void test0ImportNoUpdate() {
     setTestAdminContext();
 
     final String xml = exportTax();
@@ -73,6 +79,7 @@
     if (ir.hasErrorOccured()) {
       fail(ir.getErrorMessages());
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   private String exportTax() {
@@ -114,6 +121,7 @@
     if (ir.hasErrorOccured()) {
       fail(ir.getErrorMessages());
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -136,6 +144,7 @@
     if (ir.hasErrorOccured()) {
       fail(ir.getErrorMessages());
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -158,6 +167,7 @@
     if (ir.hasErrorOccured()) {
       fail(ir.getErrorMessages());
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -178,6 +188,7 @@
     for (final Greeting g : obc.list()) {
       OBDal.getInstance().remove(g);
     }
+    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -195,6 +206,7 @@
     obc.setFilterOnReadableOrganization(false);
     obc.add(Restrictions.eq(PROPERTY_ORGANIZATION, org));
     assertEquals(0, obc.list().size());
+    OBDal.getInstance().commitAndClose();
   }
 
   /**
@@ -218,6 +230,7 @@
         OBContext.getOBContext().getCurrentOrganization(), xml);
     assertTrue(ir.getInsertedObjects().size() == 0);
     assertTrue(ir.getUpdatedObjects().size() == 0);
+    OBDal.getInstance().commitAndClose();
   }
 
   private void createTestData() {
@@ -236,6 +249,5 @@
       OBDal.getInstance().save(greeting);
     }
     OBDal.getInstance().commitAndClose();
-
   }
 }
\ No newline at end of file
--- a/src-test/org/openbravo/test/xml/EntityXMLImportTestWarning.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLImportTestWarning.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.List;
 
 import org.junit.Ignore;
@@ -127,10 +130,6 @@
   @Ignore("This test is currently disabled because it didn't work with the new Openbravo demo data. More info: https://issues.openbravo.com/view.php?id=20264")
   @Test
   public void testUpdatingOtherOrganizationWarning() {
-    // This test is currently disabled because it didn't work with the new Openbravo demo data
-    // More info can be found here: https://issues.openbravo.com/view.php?id=20264
-    if (1 == 1)
-      return;
     cleanRefDataLoaded();
     setTestUserContext();
     addReadWriteAccess(Warehouse.class);
--- a/src-test/org/openbravo/test/xml/EntityXMLIssues.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/EntityXMLIssues.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,12 +19,19 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import org.junit.Test;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.core.DalUtil;
@@ -51,6 +58,7 @@
    * Checks mantis issue 6212, issue text: When inserting reference data using DAL into ad_client 0
    * it should not generate new uuids but maintain the current ids but it is doing so.
    */
+  @Test
   public void testMantis6212() {
     cleanRefDataLoaded();
     final Client c = OBDal.getInstance().get(Client.class, TEST_CLIENT_ID);
@@ -89,6 +97,7 @@
    * dal trims the blank spaces so in case the column contains only blank spaces it is treated as
    * null.
    */
+  @Test
   public void testMantis6213() {
     cleanRefDataLoaded();
     final Client c = OBDal.getInstance().get(Client.class, TEST_CLIENT_ID);
@@ -144,6 +153,7 @@
   /**
    * Test mantis issue 12633: XML Conversion from integer numbers should be more robust
    */
+  @Test
   public void testMantis12633() {
     setTestAdminContext();
     // read the column
@@ -172,6 +182,7 @@
    * 20357: There should be a way to define with properties i want to export in a EntityXMLConverter
    * call
    */
+  @Test
   public void testIssue20357() {
 
     final OBCriteria<BaseOBObject> obc = OBDal.getInstance().createCriteria("Product");
--- a/src-test/org/openbravo/test/xml/UniqueConstraintImportTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/UniqueConstraintImportTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,9 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.List;
 
 import org.apache.log4j.Logger;
--- a/src-test/org/openbravo/test/xml/XMLBaseTest.java	Tue Jul 29 12:19:10 2014 +0200
+++ b/src-test/org/openbravo/test/xml/XMLBaseTest.java	Wed Aug 06 12:44:16 2014 +0200
@@ -19,6 +19,8 @@
 
 package org.openbravo.test.xml;
 
+import static org.junit.Assert.assertTrue;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;