.setParameter("projectIteration", projectIteration)
.setParameter("docId", doc.getDocId())
.setParameter("resId", textFlow.getResId())
.getSingleResult();
// Id: 3L for Locale de
HTextFlowTarget target = targetTextFlow.getTargets().get(3L);
if (execution.isExpectUntranslated()) {
if (target != null && target.getState() != ContentState.New) {
throw new AssertionError(
"Expected untranslated text flow but got state "
+ target.getState());
}
} else if (execution.getExpectedTranslationState() != New) {
if (target == null) {
throw new AssertionError("Expected state "
+ execution.getExpectedTranslationState()
+ ", but got untranslated.");
} else if (execution.getExpectedTranslationState() != target
.getState()) {
throw new AssertionError("Expected state "
+ execution.getExpectedTranslationState()
+ ", but got " + target.getState());
}
}
// Contents
if (execution.getExpectedContents() != null) {
if (target == null) {
throw new AssertionError("Expected contents "
+ Arrays.toString(execution.getExpectedContents())
+ ", but got untranslated.");
} else if (!Arrays.equals(execution.getExpectedContents(), target
.getContents().toArray())) {
throw new AssertionError("Expected contents "
+ Arrays.toString(execution.getExpectedContents())
+ ", but got "
+ Arrays.toString(target.getContents().toArray()));
}
}
}