private static void assertPoFileCorrect(String poFileContents) {
MessageStreamParser messageParser =
new MessageStreamParser(new StringReader(poFileContents));
while (messageParser.hasNext()) {
Message message = messageParser.next();
if (message.isHeader()) {
// assert that expected headers are present (with values if
// needed)
assertThat(message.getMsgstr(), containsString("MIME-Version:"));
assertThat(message.getMsgstr(), containsString("Content-Type:"));
assertThat(message.getMsgstr(),
containsString("Content-Transfer-Encoding:"));
assertThat(message.getMsgstr(),
containsString("Last-Translator:"));
assertThat(message.getMsgstr(),
containsString("PO-Revision-Date:"));
assertThat(message.getMsgstr(),
containsString("Language-Team:"));
assertThat(message.getMsgstr(),
containsString("X-Generator: Zanata")); // Generator is
// Zanata
assertThat(message.getMsgstr(), containsString("Plural-Forms:"));
}
}
}