for (Map.Entry<String, Integer> entry : COMPLEX_POLICIES.entrySet()) {
String compactResourceName = entry.getKey() + COMPACT_MODEL_SUFFIX;
String normalizedResouceName = entry.getKey() + NORMALIZED_MODEL_SUFFIX;
int expectedNumberOfAlternatives = entry.getValue();
PolicySourceModel compactModel = PolicyResourceLoader.unmarshallModel(compactResourceName);
PolicySourceModel normalizedModel = PolicyResourceLoader.unmarshallModel(normalizedResouceName);
Policy compactModelPolicy = translator.translate(compactModel);
Policy normalizedModelPolicy = translator.translate(normalizedModel);
PolicySourceModel generatedCompactModel = generator.translate(compactModelPolicy);
PolicySourceModel generatedNormalizedModel = generator.translate(normalizedModelPolicy);
Policy generatedCompactModelPolicy = translator.translate(generatedCompactModel);
Policy generatedNormalizedModelPolicy = translator.translate(generatedNormalizedModel);
assertEquals("Generated compact policy should contain '" + expectedNumberOfAlternatives + "' alternatives", expectedNumberOfAlternatives,generatedCompactModelPolicy.getNumberOfAssertionSets());
assertEquals("Generated and translated compact model policy instances should contain equal number of alternatives", compactModelPolicy.getNumberOfAssertionSets(), generatedCompactModelPolicy.getNumberOfAssertionSets());
assertEquals("Generated and translated compact policy expression should form equal Policy instances", compactModelPolicy, generatedCompactModelPolicy);
assertEquals("Generated normalized policy should contain '" + expectedNumberOfAlternatives + "' alternatives", expectedNumberOfAlternatives, generatedNormalizedModelPolicy.getNumberOfAssertionSets());
assertEquals("Generated and translated normalized model policy instances should contain equal number of alternatives", normalizedModelPolicy.getNumberOfAssertionSets(), generatedNormalizedModelPolicy.getNumberOfAssertionSets());
assertEquals("Generated and translated normalized policy expression should form equal Policy instances", normalizedModelPolicy, generatedNormalizedModelPolicy);
// TODO: somehow compare models, because now the test only checks if the translation does not end in some exception...
}