use of org.javarosa.core.util.UnregisteredLocaleException in project javarosa by opendatakit.
the class LocalizerTest method testGetLocaleMapNotExist.
public void testGetLocaleMapNotExist() {
Localizer l = new Localizer();
final String TEST_LOCALE = "test";
try {
l.getLocaleMap(TEST_LOCALE);
fail("Did not throw exception when getting locale mapping for non-existent locale");
} catch (UnregisteredLocaleException nsee) {
// expected
}
}
use of org.javarosa.core.util.UnregisteredLocaleException in project javarosa by opendatakit.
the class LocalizerTest method testUnsetCurrentLocale.
public void testUnsetCurrentLocale() {
Localizer l = new Localizer();
final String TEST_LOCALE = "test";
l.addAvailableLocale(TEST_LOCALE);
l.setLocale(TEST_LOCALE);
try {
l.setLocale(null);
fail("Able to unset current locale");
} catch (UnregisteredLocaleException nsee) {
// expected
}
}
use of org.javarosa.core.util.UnregisteredLocaleException in project javarosa by opendatakit.
the class LocalizerTest method testSetCurrentLocaleNotExists.
public void testSetCurrentLocaleNotExists() {
Localizer l = new Localizer();
final String TEST_LOCALE = "test";
try {
l.setLocale(TEST_LOCALE);
fail("Set current locale to a non-existent locale");
} catch (UnregisteredLocaleException nsee) {
// expected
}
}
use of org.javarosa.core.util.UnregisteredLocaleException in project javarosa by opendatakit.
the class LocalizerTest method testSetDefaultLocaleNotExists.
public void testSetDefaultLocaleNotExists() {
Localizer l = new Localizer();
final String TEST_LOCALE = "test";
try {
l.setDefaultLocale(TEST_LOCALE);
fail("Set current locale to a non-existent locale");
} catch (UnregisteredLocaleException nsee) {
// expected
}
}
use of org.javarosa.core.util.UnregisteredLocaleException in project javarosa by opendatakit.
the class LocalizerTest method testUnsetDefaultLocale.
public void testUnsetDefaultLocale() {
Localizer l = new Localizer();
final String TEST_LOCALE = "test";
l.addAvailableLocale(TEST_LOCALE);
l.setDefaultLocale(TEST_LOCALE);
try {
l.setDefaultLocale(null);
if (l.getDefaultLocale() != null) {
fail("Could not unset default locale");
}
} catch (UnregisteredLocaleException nsee) {
fail("Exception unsetting default locale");
}
}
Aggregations