-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed unit tests and fixed a bug in rejection of quarantined commands…
- Loading branch information
Showing
4 changed files
with
116 additions
and
15 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
48 changes: 48 additions & 0 deletions
48
cards_framework/src/main/java/test/gent/timdemey/cards/test/mock/MockLogManager.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,48 @@ | ||
package gent.timdemey.cards.test.mock; | ||
|
||
import gent.timdemey.cards.logging.ILogManager; | ||
import gent.timdemey.cards.logging.LogLevel; | ||
|
||
public class MockLogManager implements ILogManager | ||
{ | ||
|
||
@Override | ||
public void log(LogLevel lvl, Object msg) | ||
{ | ||
log(lvl, msg.toString()); | ||
} | ||
|
||
@Override | ||
public void log(LogLevel lvl, String msg, Object... params) | ||
{ | ||
String msgstr = String.format(msg, params); | ||
log(lvl, msgstr); | ||
} | ||
|
||
@Override | ||
public void log(Throwable ex) | ||
{ | ||
ex.printStackTrace(System.err); | ||
} | ||
|
||
@Override | ||
public void log(String msg, Throwable ex) | ||
{ | ||
log(LogLevel.ERROR, msg); | ||
log(ex); | ||
} | ||
|
||
@Override | ||
public void setLogLevel(LogLevel lvl) | ||
{ | ||
// we log everything in the mocks | ||
} | ||
|
||
private void log(LogLevel lvl, String msg) | ||
{ | ||
String format = "MockLogManager :: %10s :: %s"; | ||
String msgstr = String.format(format, lvl, msg); | ||
System.out.println(msgstr); | ||
} | ||
|
||
} |
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