|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.apache.commons.i18n.MessageProviderTestBase
public abstract class MessageProviderTestBase
This class tests that the behaviour of a MessageProvider implementation is correct.
If creating new implementations, consider subclassing this class to test the behaviour of that implementation.
The tests assume the provided MessageProvider
contains the following entries:
Language/Locale |
ID | Entry | Message |
|---|---|---|---|
| English (en) | helloWorld | title | Hello World |
| English (en) | helloWorld | text | Hello World, we are in {0}. |
| German (de) | helloWorld | title | Hallo Welt |
| German (de) | helloWorld | text | Hallo Welt, wir sind in {0}. |
The entry below is used only if possible. If not possible, set
hasNonTranslatedEntry to false. |
|||
| English (en) | helloWorld | helloWorld | This entry is not translated to any other languages |
nonExistentId and the entry nonExistentEntry of ID
helloWorld must NOT be existent.
| Constructor Summary | |
|---|---|
protected |
MessageProviderTestBase()
|
protected |
MessageProviderTestBase(java.lang.String testName)
|
| Method Summary | |
|---|---|
void |
setUp()
Set English as default Locale. |
void |
tearDown()
|
protected void |
testGetEntries(org.apache.commons.i18n.MessageProvider messageProvider,
boolean hasNonTranslatedEntry)
|
protected void |
testGetText(org.apache.commons.i18n.MessageProvider messageProvider)
Test functionality of getText() method, which should be common for all implementations of the MessageProvider interface. |
| Methods inherited from class junit.framework.TestCase |
|---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString |
| Methods inherited from class junit.framework.Assert |
|---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected MessageProviderTestBase()
protected MessageProviderTestBase(java.lang.String testName)
| Method Detail |
|---|
public void setUp()
throws java.lang.Exception
super.setUp()
setUp in class junit.framework.TestCasejava.lang.Exception - No exception is thrown, but allow for overriding methods
to throw exceptions.
public void tearDown()
throws java.lang.Exception
tearDown in class junit.framework.TestCasejava.lang.Exceptionprotected void testGetText(org.apache.commons.i18n.MessageProvider messageProvider)
MessageProvider interface.
messageProvider -
protected void testGetEntries(org.apache.commons.i18n.MessageProvider messageProvider,
boolean hasNonTranslatedEntry)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||