Test of translate method, of class com.sun.xml.ws.policy.PolicyModelTranslator.
int index = 0;
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);
// System.out.println(index + ". compact model: " + compactModel);
// System.out.println("===========================================================");
// System.out.println(index + ". normalized model: " + normalizedModel);
// System.out.println("===========================================================");
Policy compactModelPolicy = translator.translate(compactModel);
Policy normalizedModelPolicy = translator.translate(normalizedModel);
assertEquals("Normalized and compact model policy instances should contain equal number of alternatives", normalizedModelPolicy.getNumberOfAssertionSets(), compactModelPolicy.getNumberOfAssertionSets());
assertEquals("This policy should contain '" + expectedNumberOfAlternatives + "' alternatives", expectedNumberOfAlternatives, compactModelPolicy.getNumberOfAssertionSets());
assertEquals("Normalized and compact policy expression should form equal Policy instances", normalizedModelPolicy, compactModelPolicy);
// System.out.println(index + ". compact model policy: " + compactModelPolicy);
// System.out.println("===========================================================");
// System.out.println(index + ". normalized model policy: " + normalizedModelPolicy);
index++;
}