|
||||||||
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.opencms.i18n.TestCmsMessageBundles
public abstract class TestCmsMessageBundles
Tests for the CmsMessageBundles.
Constructor Summary | |
---|---|
TestCmsMessageBundles()
|
Method Summary | |
---|---|
protected String |
doPreTestBundle(String className,
String bundleName,
Locale locale,
boolean client)
Performs some key and language independent tests. |
protected String |
doTestBundle(Class<?> clazz,
String bundleName,
Locale locale)
Tests an individual message bundle. |
protected List<I_CmsMessageBundle> |
getExcludedLocalizedBundles(Locale locale)
Returns the resource bundles to be excluded from additional locales tests. |
protected CmsMessages |
getMessageBundle(String bundleName,
Locale locale)
Prepares the test for the given bundle and locale and returns a message bundle that DOES NOT include the default keys. |
protected String |
getMessageBundleSourceName(String bundleName,
Locale locale)
Returns the file name of the source message bundle. |
protected String |
getModuleMessagesBundleSourceName(String bundleName,
Locale locale)
Returns the file name of the source message bundle from the module. |
protected abstract List<I_CmsMessageBundle> |
getNotLocalizedBundles(Locale locale)
Returns a list of bundles not to be localized. |
protected abstract I_CmsClientMessageBundle[] |
getTestClientMessageBundles()
Template method that has to be overwritten to return the client class that will be tested. |
protected abstract I_CmsMessageBundle[] |
getTestMessageBundles()
Template method that has to be overwritten to return the I_CmsMessageBundle
instances that will be tested. |
protected void |
messagesBundleConstantTest(Locale locale)
Checks all OpenCms internal message bundles if the are correctly build. |
void |
testLocale_DE_MessagesBundles()
Checks all message bundles for the DE locale. |
void |
testLocale_EN_MessagesBundles()
Checks all message bundles for the EN locale. |
void |
testLocale_ES_MessagesBundles()
Checks all message bundles for the ES locale. |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TestCmsMessageBundles()
Method Detail |
---|
public void testLocale_DE_MessagesBundles() throws Exception
Exception
- if the test failspublic void testLocale_EN_MessagesBundles() throws Exception
Exception
- if the test failspublic void testLocale_ES_MessagesBundles() throws Exception
Exception
- if the test failsprotected String doPreTestBundle(String className, String bundleName, Locale locale, boolean client)
className
- the bundle implementing class namebundleName
- the bundle name to testlocale
- the locale to testclient
- if the bundle to test is a client bundle
protected String doTestBundle(Class<?> clazz, String bundleName, Locale locale) throws Exception
clazz
- the bundle classbundleName
- the bundle class namelocale
- the locale to test
Exception
- if the test failsprotected List<I_CmsMessageBundle> getExcludedLocalizedBundles(Locale locale)
locale
- the locale to get the excluded bundles for
protected CmsMessages getMessageBundle(String bundleName, Locale locale) throws IOException
bundleName
- the resource bundle to preparelocale
- the locale to prepare the resource bundle for
IOException
- if something goes wrongprotected String getMessageBundleSourceName(String bundleName, Locale locale)
bundleName
- the resource bundle to get the file name forlocale
- the locale to get the file name for
protected String getModuleMessagesBundleSourceName(String bundleName, Locale locale)
bundleName
- the resource bundle to get the file name forlocale
- the locale to get the file name for
protected abstract List<I_CmsMessageBundle> getNotLocalizedBundles(Locale locale)
locale
- the locale to get the not localized bundles for
protected abstract I_CmsClientMessageBundle[] getTestClientMessageBundles() throws Exception
Exception
- if the test failsprotected abstract I_CmsMessageBundle[] getTestMessageBundles()
I_CmsMessageBundle
instances that will be tested.
I_CmsMessageBundle
instances to test: these will be the
singleton instances of the Messages
classes residing in every localized package.protected void messagesBundleConstantTest(Locale locale) throws Exception
locale
- the locale to test
Exception
- if the test fails
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |