You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/04/14 15:16:34 UTC
svn commit: r1467774 - in /ofbiz/branches/2013_RemoveJavolution: ./
framework/base/src/org/ofbiz/base/test/BaseUnitTests.java
framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java
Author: adrianc
Date: Sun Apr 14 13:16:33 2013
New Revision: 1467774
URL: http://svn.apache.org/r1467774
Log:
Merged revisions 1463856 and 1464001 from the trunk. Those changes are required to get profiling results to match with the trunk (we need the ability to turn off logging).
Modified:
ofbiz/branches/2013_RemoveJavolution/ (props changed)
ofbiz/branches/2013_RemoveJavolution/framework/base/src/org/ofbiz/base/test/BaseUnitTests.java
ofbiz/branches/2013_RemoveJavolution/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java
Propchange: ofbiz/branches/2013_RemoveJavolution/
------------------------------------------------------------------------------
Merged /ofbiz/trunk:r1463856,1464001
Modified: ofbiz/branches/2013_RemoveJavolution/framework/base/src/org/ofbiz/base/test/BaseUnitTests.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/2013_RemoveJavolution/framework/base/src/org/ofbiz/base/test/BaseUnitTests.java?rev=1467774&r1=1467773&r2=1467774&view=diff
==============================================================================
--- ofbiz/branches/2013_RemoveJavolution/framework/base/src/org/ofbiz/base/test/BaseUnitTests.java (original)
+++ ofbiz/branches/2013_RemoveJavolution/framework/base/src/org/ofbiz/base/test/BaseUnitTests.java Sun Apr 14 13:16:33 2013
@@ -32,14 +32,19 @@ public class BaseUnitTests extends TestC
}
public void testDebug() {
- Debug.set(Debug.VERBOSE, true);
- assertTrue(Debug.verboseOn());
-
- Debug.set(Debug.VERBOSE, false);
- assertFalse(Debug.verboseOn());
-
- Debug.set(Debug.INFO, true);
- assertTrue(Debug.infoOn());
+ boolean debugVerbose = Debug.get(Debug.VERBOSE);
+ boolean debugInfo = Debug.get(Debug.INFO);
+ try {
+ Debug.set(Debug.VERBOSE, true);
+ assertTrue(Debug.verboseOn());
+ Debug.set(Debug.VERBOSE, false);
+ assertFalse(Debug.verboseOn());
+ Debug.set(Debug.INFO, true);
+ assertTrue(Debug.infoOn());
+ } finally {
+ Debug.set(Debug.VERBOSE, debugVerbose);
+ Debug.set(Debug.INFO, debugInfo);
+ }
}
public void testFormatPrintableCreditCard_1() {
Modified: ofbiz/branches/2013_RemoveJavolution/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/2013_RemoveJavolution/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java?rev=1467774&r1=1467773&r2=1467774&view=diff
==============================================================================
--- ofbiz/branches/2013_RemoveJavolution/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java (original)
+++ ofbiz/branches/2013_RemoveJavolution/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java Sun Apr 14 13:16:33 2013
@@ -144,7 +144,7 @@ public class ServiceEcaCondition impleme
Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(lhsMapName));
lhsValue = envMap.get(lhsValueName);
} else {
- Debug.logWarning("From Map (" + lhsMapName + ") not found in context, defaulting to null.", module);
+ Debug.logInfo("From Map (" + lhsMapName + ") not found in context, defaulting to null.", module);
}
} catch (ClassCastException e) {
throw new GenericServiceException("From Map field [" + lhsMapName + "] is not a Map.", e);
@@ -153,7 +153,7 @@ public class ServiceEcaCondition impleme
if (context.containsKey(lhsValueName)) {
lhsValue = context.get(lhsValueName);
} else {
- Debug.logWarning("From Field (" + lhsValueName + ") is not found in context for " + serviceName + ", defaulting to null.", module);
+ Debug.logInfo("From Field (" + lhsValueName + ") is not found in context for " + serviceName + ", defaulting to null.", module);
}
}
@@ -165,7 +165,7 @@ public class ServiceEcaCondition impleme
Map<String, ? extends Object> envMap = UtilGenerics.checkMap(context.get(rhsMapName));
rhsValue = envMap.get(rhsValueName);
} else {
- Debug.logWarning("To Map (" + rhsMapName + ") not found in context for " + serviceName + ", defaulting to null.", module);
+ Debug.logInfo("To Map (" + rhsMapName + ") not found in context for " + serviceName + ", defaulting to null.", module);
}
} catch (ClassCastException e) {
throw new GenericServiceException("To Map field [" + rhsMapName + "] is not a Map.", e);
@@ -185,7 +185,7 @@ public class ServiceEcaCondition impleme
Boolean cond = ObjectType.doRealCompare(lhsValue, rhsValue, operator, compareType, format, messages, null, dctx.getClassLoader(), isConstant);
// if any messages were returned send them out
- if (messages.size() > 0) {
+ if (messages.size() > 0 && Debug.warningOn()) {
for (Object message: messages) {
Debug.logWarning(message.toString(), module);
}