Skip to content

Commit 0aa5ce0

Browse files
yoshito-umaokayumaoka
authored andcommitted
Fixing maven integraion test issues
- When MT configuraton for English is not available, returns empty target language set, instead of null - download-basic test to specify target languages explicitly instead of default MT languages that can be changed depending on GP deployments.
1 parent e8118b2 commit 0aa5ce0

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

gp-maven-plugin/src/it/download-basic/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
</includes>
3535
</sourceFiles>
3636
<type>JSON</type>
37+
<sourceLanguage>en</sourceLanguage>
38+
<targetLanguages>
39+
<param>de</param>
40+
<param>fr</param>
41+
</targetLanguages>
3742
</bundleSet>
3843
</bundleSets>
3944
</configuration>

gp-maven-plugin/src/it/download-basic/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ try {
3636
}
3737
}
3838
}
39-
assert filecount == 20
39+
assert filecount == 6
4040

4141
def dir2 = new File(targetLocation2)
4242
dir2.traverse { file ->

gp-maven-plugin/src/main/java/com/ibm/g11n/pipeline/maven/GPBaseMojo.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,13 @@ protected Set<String> resolveTargetLanguages(BundleSet bundleSet) throws MojoFai
263263
Map<String, Set<String>> activeMTLangs = client.getConfiguredMTLanguages();
264264
targetLanguages = activeMTLangs.get(srcLang);
265265
} catch (ServiceException e) {
266-
targetLanguages = Collections.emptySet();
267266
throw new MojoFailureException("Globalization Pipeline service error", e);
268267
}
269268

269+
if (targetLanguages == null) {
270+
targetLanguages = Collections.emptySet();
271+
}
272+
270273
getLog().info("The configuration parameter 'targetLanguages' is not specified."
271274
+ " Using currently active target languages: " + targetLanguages);
272275
}

0 commit comments

Comments
 (0)