Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-04-06 18:11:16 -0400
committerRyan D. Brooks2011-04-06 18:11:16 -0400
commitbcfa3fc82450d4adebd20b64543e7876ec543974 (patch)
tree1a3dd4205ef79c2d2e54d31a83ba5a9724928628 /plugins/org.eclipse.osee.framework.logging.test/src
parentc945a0c871ca0e233f6a91123f486c6cddba1040 (diff)
downloadorg.eclipse.osee-bcfa3fc82450d4adebd20b64543e7876ec543974.tar.gz
org.eclipse.osee-bcfa3fc82450d4adebd20b64543e7876ec543974.tar.xz
org.eclipse.osee-bcfa3fc82450d4adebd20b64543e7876ec543974.zip
refactor[bgz_342089]: Move SevereLogMonitorTest to osee.framework.logging.test
Diffstat (limited to 'plugins/org.eclipse.osee.framework.logging.test/src')
-rw-r--r--plugins/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/SevereLogMonitorTest.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/SevereLogMonitorTest.java b/plugins/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/SevereLogMonitorTest.java
new file mode 100644
index 00000000000..44f0cef9fc7
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/SevereLogMonitorTest.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.logging;
+
+import static org.junit.Assert.assertTrue;
+import java.util.logging.Level;
+
+/**
+ * @author Andrew M. Finkbeiner
+ */
+public class SevereLogMonitorTest {
+
+ /*
+ * @Before public void setup() throws Exception { assertTrue("Should be run on test or demo datbase.",
+ * TestUtil.isDemoDb() || TestUtil.isTestDb()); }
+ */
+
+ @org.junit.Test
+ public void testCatchingOfException() {
+
+ boolean madeItInException = false;
+ SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
+ OseeLog.registerLoggerListener(monitorLog);
+ try {
+ throw new Exception("this is my test exception");
+ } catch (Exception ex) {
+ madeItInException = true;
+ OseeLog.log(SevereLogMonitorTest.class, Level.SEVERE, "caught our exception in a junit", ex);
+ }
+ assertTrue(madeItInException);
+ assertTrue(String.format("%d SevereLogs during test.", monitorLog.getAllLogs().size()),
+ monitorLog.getAllLogs().size() == 1);
+ }
+
+}

Back to the top