Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-02-21 11:41:57 +0000
committerEike Stepper2011-02-21 11:41:57 +0000
commit7361e5311262c26f41a323a2825d20c40fe9b614 (patch)
treeef46344139ff56aa50395c37fc2331fbab192278 /plugins/org.eclipse.net4j.tests
parent1f5e6793b74b8265fad95fa5bf7d0dda09fe100d (diff)
downloadcdo-7361e5311262c26f41a323a2825d20c40fe9b614.tar.gz
cdo-7361e5311262c26f41a323a2825d20c40fe9b614.tar.xz
cdo-7361e5311262c26f41a323a2825d20c40fe9b614.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins/org.eclipse.net4j.tests')
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
index a899f11da6..e8a41888c9 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/util/tests/AbstractOMTest.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.log.FileLogHandler;
import org.eclipse.net4j.util.om.log.OMLogger;
+import org.eclipse.net4j.util.om.log.OMLogger.Level;
import org.eclipse.net4j.util.om.log.PrintLogHandler;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.om.trace.PrintTraceHandler;
@@ -61,6 +62,8 @@ public abstract class AbstractOMTest extends TestCase
private static boolean consoleEnabled;
+ private static String testName;
+
private transient List<File> filesToDelete = new ArrayList<File>();
private transient String codeLink;
@@ -74,7 +77,16 @@ public abstract class AbstractOMTest extends TestCase
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
String prefix = AbstractOMTest.class.getName() + "-" + formatter.format(new Date()) + "-";
File logFile = TMPUtil.createTempFile(prefix, ".log");
- OMPlatform.INSTANCE.addLogHandler(new FileLogHandler(logFile, OMLogger.Level.WARN));
+
+ OMPlatform.INSTANCE.addLogHandler(new FileLogHandler(logFile, OMLogger.Level.WARN)
+ {
+ @Override
+ protected void writeLog(OMLogger logger, Level level, String msg, Throwable t) throws Throwable
+ {
+ super.writeLog(logger, level, "--> " + testName + "\n" + msg, t);
+ }
+ });
+
IOUtil.ERR().println("Logging errors and warnings to " + logFile);
IOUtil.ERR().println();
}
@@ -128,7 +140,9 @@ public abstract class AbstractOMTest extends TestCase
@Override
public void setUp() throws Exception
{
+ testName = getClass().getName() + "." + getName() + "()";
codeLink = null;
+
enableConsole();
if (!SUPPRESS_OUTPUT)
{

Back to the top