diff options
author | afinkbein | 2008-12-01 16:57:19 +0000 |
---|---|---|
committer | afinkbein | 2008-12-01 16:57:19 +0000 |
commit | c1667bd6e3d131b3dc64c99465faf147de7b2719 (patch) | |
tree | bb0dcde90bc846b3a34f42938968dbd72cd89381 | |
parent | 0d702e2923f41d11be493123b51b41e18537988d (diff) | |
download | org.eclipse.osee-c1667bd6e3d131b3dc64c99465faf147de7b2719.tar.gz org.eclipse.osee-c1667bd6e3d131b3dc64c99465faf147de7b2719.tar.xz org.eclipse.osee-c1667bd6e3d131b3dc64c99465faf147de7b2719.zip |
7 files changed, 112 insertions, 0 deletions
diff --git a/org.eclipse.osee.framework.logging.test/.classpath b/org.eclipse.osee.framework.logging.test/.classpath new file mode 100644 index 00000000000..02159672985 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.osee.framework.logging.test/.project b/org.eclipse.osee.framework.logging.test/.project new file mode 100644 index 00000000000..9b45b79d729 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.framework.logging.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.osee.framework.logging.test/.settings/org.eclipse.pde.core.prefs b/org.eclipse.osee.framework.logging.test/.settings/org.eclipse.pde.core.prefs new file mode 100644 index 00000000000..7a3ece5add3 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/.settings/org.eclipse.pde.core.prefs @@ -0,0 +1,4 @@ +#Wed Jul 23 07:21:41 MST 2008
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/org.eclipse.osee.framework.logging.test/META-INF/MANIFEST.MF b/org.eclipse.osee.framework.logging.test/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..59b28088a11 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test Plug-in +Bundle-SymbolicName: org.eclipse.osee.framework.logging.test +Bundle-Version: 0.3.0.qualifier +Bundle-Activator: org.eclipse.osee.framework.logging.test.Activator +Bundle-Vendor: Boeing +Eclipse-LazyStart: true +Import-Package: org.eclipse.osee.framework.logging, + org.osgi.framework;version="1.3.0" +Require-Bundle: org.junit diff --git a/org.eclipse.osee.framework.logging.test/build.properties b/org.eclipse.osee.framework.logging.test/build.properties new file mode 100644 index 00000000000..41eb6ade2b4 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/build.properties @@ -0,0 +1,4 @@ +source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/Activator.java b/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/Activator.java new file mode 100644 index 00000000000..d186e585b66 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/Activator.java @@ -0,0 +1,22 @@ +package org.eclipse.osee.framework.logging.test;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
diff --git a/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/SevereLogMonitorTest.java b/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/SevereLogMonitorTest.java new file mode 100644 index 00000000000..b6a1f128962 --- /dev/null +++ b/org.eclipse.osee.framework.logging.test/src/org/eclipse/osee/framework/logging/test/SevereLogMonitorTest.java @@ -0,0 +1,36 @@ +/*
+ * Created on Jul 23, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.framework.logging.test;
+
+import java.util.logging.Level;
+
+import junit.framework.TestCase;
+
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+
+/**
+ * @author b1528444
+ *
+ */
+public class SevereLogMonitorTest extends TestCase {
+
+ 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.getSevereLogs().size()), monitorLog.getSevereLogs().size() == 1);
+ }
+
+}
|