This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://morphia.googlecode.com/svn/trunk@1692 7223e496-fac8-11de-aa3c-59de0406b4f5
- Loading branch information
us@thomas-daily.de
committed
Mar 1, 2011
1 parent
49472e3
commit ac1170c
Showing
5 changed files
with
140 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 0 additions & 57 deletions
57
morphia/src/main/java/com/google/code/morphia/logging/MorphiaLogrFactory.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
morphia/src/main/java/com/google/code/morphia/logging/SilentLogr.java
This file was deleted.
Oops, something went wrong.
133 changes: 133 additions & 0 deletions
133
morphia/src/test/java/com/google/code/morphia/logging/MorphiaLogrFactoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
/** | ||
* | ||
*/ | ||
package com.google.code.morphia.logging; | ||
|
||
import junit.framework.Assert; | ||
|
||
import org.junit.Test; | ||
|
||
import com.google.code.morphia.TestBase; | ||
|
||
/** | ||
* @author us@thomas-daily.de | ||
* | ||
*/ | ||
public class MorphiaLogrFactoryTest extends TestBase { | ||
|
||
static { | ||
|
||
MorphiaLoggerFactory.reset(); | ||
MorphiaLoggerFactory.registerLogger(TestLoggerFactory.class); | ||
} | ||
|
||
public MorphiaLogrFactoryTest() { | ||
|
||
} | ||
|
||
@Test | ||
public void testChoice() throws Exception { | ||
Logr logr = MorphiaLoggerFactory.get(Object.class); | ||
String className = logr.getClass().getName(); | ||
Assert.assertTrue(className.startsWith(TestLoggerFactory.class.getName() + "$")); | ||
} | ||
|
||
@Override | ||
public void tearDown() { | ||
MorphiaLoggerFactory.reset(); | ||
super.tearDown(); | ||
} | ||
|
||
static class TestLoggerFactory implements LogrFactory { | ||
public Logr get(Class<?> c) { | ||
return new Logr() { | ||
|
||
public void warning(String msg, Throwable t) { | ||
|
||
} | ||
|
||
public void warning(String format, Object... arg) { | ||
|
||
} | ||
|
||
public void warning(String msg) { | ||
|
||
} | ||
|
||
public void trace(String msg, Throwable t) { | ||
|
||
} | ||
|
||
public void trace(String format, Object... arg) { | ||
|
||
} | ||
|
||
public void trace(String msg) { | ||
|
||
} | ||
|
||
public boolean isWarningEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
public boolean isTraceEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
public boolean isInfoEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
public boolean isErrorEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
public boolean isDebugEnabled() { | ||
|
||
return false; | ||
} | ||
|
||
public void info(String msg, Throwable t) { | ||
|
||
} | ||
|
||
public void info(String format, Object... arg) { | ||
|
||
} | ||
|
||
public void info(String msg) { | ||
|
||
} | ||
|
||
public void error(String msg, Throwable t) { | ||
|
||
} | ||
|
||
public void error(String format, Object... arg) { | ||
|
||
} | ||
|
||
public void error(String msg) { | ||
|
||
} | ||
|
||
public void debug(String msg, Throwable t) { | ||
|
||
} | ||
|
||
public void debug(String format, Object... arg) { | ||
|
||
} | ||
|
||
public void debug(String msg) { | ||
|
||
} | ||
}; | ||
} | ||
|
||
} | ||
} |