@Feature(summary = "A maintainer user may pull translations from a project",
tcmsTestPlanIds = 5316, tcmsTestCaseIds = 136564)
@Test(timeout = ZanataTestCase.MAX_SHORT_TEST_DURATION)
public void projectMaintainerPullTest() throws IOException {
ZanataRestCaller restCaller = new ZanataRestCaller("translator",
PropertiesHolder
.getProperty(Constants.zanataTranslatorKey.value()));
File workDir = Files.createTempDir();
String projectSlug = "pull-test";
String iterationSlug = "master";
String projectType = "properties";
restCaller.createProjectAndVersion(projectSlug, iterationSlug,
projectType);
// generate a properties source
makePropertiesFile(new File(workDir, "prop1.properties"), ImmutableMap
.<String, String> builder().put("hello", "hello world").build());
makePropertiesFile(new File(workDir, "prop2.properties"), ImmutableMap
.<String, String> builder().put("greeting", "hey buddy")
.build());
// copy a pom file
generateZanataXml(new File(workDir, "zanata.xml"), projectSlug,
iterationSlug, projectType, Lists.newArrayList("pl"));
client.callWithTimeout(workDir,
"mvn -B org.zanata:zanata-maven-plugin:push -Dzanata.userConfig="
+ translatorConfig);
// only message1 has translation
TranslationsResource translationsResource =
buildTranslationResource(buildTextFlowTarget("hello",
"translated"));
restCaller.postTargetDocResource(projectSlug, iterationSlug, "prop1",
new LocaleId("pl"), translationsResource, "auto");
// dryRun creates nothing
File transDir = Files.createTempDir();
client.callWithTimeout(workDir,