Skip to content

Commit

Permalink
style: spotless apply for test
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr committed Oct 31, 2024
1 parent 2aac0f2 commit c81ad92
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/org/omegat/core/segmentation/SRX.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public static SRX loadFromDir(File configDir) {
* is older than that of the current OmegaT, and tries to merge the two sets
* of rules.
*/
static SRX loadConfFile(File configFile, File configDir) {
static SRX loadConfFile(File configFile, File configDir) {
SRX res;
try {
SRX.MyExceptionListener myel = new SRX.MyExceptionListener();
Expand All @@ -233,7 +233,8 @@ static SRX loadConfFile(File configFile, File configDir) {
} else {
// checking the version
if (CURRENT_VERSION.compareTo(res.getVersion()) > 0) {
// yeap, the segmentation config file is of the older version
// yeap, the segmentation config file is of the older
// version

// initing defaults
SRX defaults = SRX.getDefault();
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/org/omegat/util/LocaleRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected void before() throws Throwable {

@Override
protected void after() {
Locale.setDefault(orginalLocale);
Locale.setDefault(orginalLocale);
};

}
24 changes: 10 additions & 14 deletions test/src/org/omegat/core/segmentation/SRXTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,9 @@ public static void testSrxComparison() {
/**
* Test SRX#loadFromDir produce SRX object properly.
* <p>
* MapRule#getLanguageCode should return Language Code
* defined in LanguageCode class.
* MapRule#getLanguage should return a localized name of language.
* The test here check both values.
* OmegaT 6.0 and before,
* MapRule#getLanguageCode should return Language Code defined in
* LanguageCode class. MapRule#getLanguage should return a localized name of
* language. The test here check both values. OmegaT 6.0 and before,
*/
public static void testSrxReaderDefault() {
assertTrue(segmentDefault.exists());
Expand All @@ -181,14 +179,12 @@ public static void testSrxReaderDefault() {
/**
* Test SRX writer/reader.
* <p>
* Previous versions have a bug when saving segmentation.conf file.
* It is better to save language property using language code
* defined in LanguageCode class.
* Unfortunately, OmegaT 6.0 and before produce a localized
* language name for the property.
* The test case here trys reading a segmentation.conf file
* that is produced by OmegaT in English environment
* and Japanese environment.
* Previous versions have a bug when saving segmentation.conf file. It is
* better to save language property using language code defined in
* LanguageCode class. Unfortunately, OmegaT 6.0 and before produce a
* localized language name for the property. The test case here trys reading
* a segmentation.conf file that is produced by OmegaT in English
* environment and Japanese environment.
*/
public static void testSrxMigration(File segmentConf, File configDir) throws IOException {
File segmentSrx = new File(configDir, "segmentation.srx");
Expand All @@ -205,7 +201,7 @@ public static void testSrxMigration(File segmentConf, File configDir) throws IOE
mapRuleList = srx1.getMappingRules();
assertNotNull(mapRuleList);
assertEquals(18, mapRuleList.size());
for (MapRule mapRule: mapRuleList) {
for (MapRule mapRule : mapRuleList) {
if (mapRule.getPattern().equals("JA.*")) {
assertEquals(LanguageCodes.JAPANESE_CODE, mapRule.getLanguage());
assertEquals(OStrings.getString(LanguageCodes.JAPANESE_KEY), mapRule.getLanguageName());
Expand Down

0 comments on commit c81ad92

Please sign in to comment.