forked from danfickle/openhtmltopdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log message id format: use static final + add test
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 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
21 changes: 21 additions & 0 deletions
21
openhtmltopdf-core/src/test/java/com/openhtmltopdf/util/LogMessageIdFormatTest.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,21 @@ | ||
package com.openhtmltopdf.util; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class LogMessageIdFormatTest { | ||
|
||
@Test | ||
public void testFormats() { | ||
Assert.assertEquals("", new LogMessageIdFormat("").formatMessage(new Integer[]{1,2,3})); | ||
Assert.assertEquals("abcd", new LogMessageIdFormat("abcd").formatMessage(null)); | ||
Assert.assertEquals("1a2b3", new LogMessageIdFormat("1{}2{}3").formatMessage(new String[]{"a", "b"})); | ||
Assert.assertEquals("123", new LogMessageIdFormat("{}{}{}").formatMessage(new Integer[]{1,2,3})); | ||
Assert.assertEquals("A1a2b3B", new LogMessageIdFormat("{}1{}2{}3{}").formatMessage(new String[]{"A", "a", "b", "B"})); | ||
|
||
Assert.assertEquals("A123", new LogMessageIdFormat("{}1{}2{}3{}").formatMessage(new String[]{"A"})); | ||
|
||
Assert.assertEquals("", new LogMessageIdFormat("{}{}{}").formatMessage(new Integer[]{})); | ||
Assert.assertEquals("", new LogMessageIdFormat("{}{}{}").formatMessage(null)); | ||
} | ||
} |