svn commit: r1763453 - /ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1763453 - /ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java

jacopoc
Author: jacopoc
Date: Wed Oct  5 14:00:46 2016
New Revision: 1763453

URL: http://svn.apache.org/viewvc?rev=1763453&view=rev
Log:
Improved: made the entity delegator test less noisy by disabling the error log
level during the execution of these tests.

Thanks: Jacques Le Roux for requesting the improvement.

Modified:
    ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java

Modified: ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java?rev=1763453&r1=1763452&r2=1763453&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java (original)
+++ ofbiz/trunk/framework/entity/src/test/java/org/apache/ofbiz/entity/DelegatorUnitTests.java Wed Oct  5 14:00:46 2016
@@ -18,6 +18,8 @@
  *******************************************************************************/
 package org.apache.ofbiz.entity;
 
+import org.apache.ofbiz.base.util.Debug;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -26,6 +28,7 @@ import org.junit.rules.ExpectedException
 import static org.junit.Assert.*;
 
 public class DelegatorUnitTests {
+    private boolean logErrorOn;
 
     @Rule
     public ExpectedException expectedException = ExpectedException.none();
@@ -34,6 +37,13 @@ public class DelegatorUnitTests {
     public void initialize() {
         System.setProperty("ofbiz.home", System.getProperty("user.dir"));
         System.setProperty("derby.system.home", "./runtime/data/derby");
+        logErrorOn = Debug.isOn(Debug.ERROR); // save the current setting (to be restored after the tests)
+        Debug.set(Debug.ERROR, false); // disable error logging
+    }
+
+    @After
+    public void restore() {
+        Debug.set(Debug.ERROR, logErrorOn); // restore the error log setting
     }
 
     @Test