Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-09-11 14:51:09 -0400
committerRoberto E. Escobar2012-09-11 14:51:50 -0400
commit77352752e91f2fc0aba301164803af10ea1fe3d4 (patch)
tree8572b05e0f1a2b91f36f474097990ac01b1b28c1 /plugins/org.eclipse.osee.support.test.util/src
parent4e2fc3d69aadf01d8bb2aca88a76fe580f397ae2 (diff)
downloadorg.eclipse.osee-77352752e91f2fc0aba301164803af10ea1fe3d4.tar.gz
org.eclipse.osee-77352752e91f2fc0aba301164803af10ea1fe3d4.tar.xz
org.eclipse.osee-77352752e91f2fc0aba301164803af10ea1fe3d4.zip
bug: Report SevereLogging exceptions in test results
Diffstat (limited to 'plugins/org.eclipse.osee.support.test.util/src')
-rw-r--r--plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java31
1 files changed, 9 insertions, 22 deletions
diff --git a/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java b/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java
index 954f96e4f6..1f2aec56ca 100644
--- a/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java
+++ b/plugins/org.eclipse.osee.support.test.util/src/org/eclipse/osee/support/test/util/TestUtil.java
@@ -90,23 +90,6 @@ public class TestUtil {
return monitorLog;
}
- public static int getNumberOfLogsAtLevel(SevereLoggingMonitor monitorLog, Level level) {
- int count = 0;
- for (IHealthStatus hStatus : monitorLog.getLogsAtLevel(level)) {
- // do not count the valid ignored logs
- for (String str : ignoreLogging) {
- if (hStatus.getMessage().startsWith(str) == false) {
- count++;
- }
- }
- }
- return count++;
- }
-
- public static void severeLoggingStop(SevereLoggingMonitor monitorLog) {
- OseeLog.unregisterLoggerListener(monitorLog);
- }
-
public static void severeLoggingEnd(SevereLoggingMonitor monitorLog) throws Exception {
severeLoggingEnd(monitorLog, ignoreLogging);
}
@@ -115,7 +98,8 @@ public class TestUtil {
OseeLog.unregisterLoggerListener(monitorLog);
Collection<IHealthStatus> healthStatuses = monitorLog.getAllLogs();
int numExceptions = 0;
- if (healthStatuses.size() > 0) {
+ StringBuilder builder = new StringBuilder();
+ if (!healthStatuses.isEmpty()) {
for (IHealthStatus status : healthStatuses) {
if (status.getLevel() != Level.INFO) {
boolean ignoreIt = false;
@@ -126,18 +110,21 @@ public class TestUtil {
}
}
if (!ignoreIt) {
+ builder.append("\nSevereLoggingException [");
+ builder.append(numExceptions);
+ builder.append("]: ");
if (status.getException() != null) {
- System.err.println("SevereLogging Exception: " + Lib.exceptionToString(status.getException()));
+ builder.append(Lib.exceptionToString(status.getException()));
} else {
- System.err.println("SevereLogging Exception: " + status.getMessage());
+ builder.append(status.getMessage());
}
numExceptions++;
}
}
}
if (numExceptions > 0) {
- throw new OseeStateException("SevereLoggingMonitor found [%d] exceptions (see console for details)!",
- numExceptions);
+ throw new OseeStateException("SevereLoggingMonitor found [%d] exceptions - [%s]", numExceptions,
+ builder.toString());
}
}
}

Back to the top