apia.findObjects(TypeUtility.convertStringtoAOS(resultFields), maxResults, query);
List<ObjectFields> fields = result.getResultList().getObjectFields();
for (ObjectFields objectFields : fields) {
String pid = objectFields.getPid().getValue();
System.out.println("Validating object '" + pid + "'");
Validation validation = apim.validate(pid, null);
if (!validation.isValid()) {
System.out.println("PID " + validation.getPid());
System.out.println("Valid " + validation.isValid());
System.out.println("Problems");
for (String problem : validation.getObjProblems().getProblem()) {
System.out.println(problem);
}
System.out.println("Datastream Problems");
for (DatastreamProblem datastreamProblem : validation
.getDatastreamProblems().getDatastream()) {
System.out.println("DS ID "
+ datastreamProblem.getDatastreamID());
for (String problem : datastreamProblem.getProblem()) {
System.out.println(problem);
}
}
}
assertTrue(validation.isValid());
}
}