IPValidator { protected static boolean validatePropertyEvaluators(InformationProcessor ip, TypeProcessor tp, IPValidationListener l) { boolean ret=true; for (PropertyEvaluator pe : tp.getProperties()) { if (pe.getName() == null) { l.error(ip, ip, MessageFormat.format(java.util.PropertyResourceBundle.getBundle( "activity.Messages").getString("ACTIVITY-14"), "Property Evaluator", "name")); ret = false; } if (pe.getEvaluator() == null) { l.error(ip, pe, java.util.PropertyResourceBundle.getBundle( "activity.Messages").getString("ACTIVITY-17")); ret = false; } } return (ret); } private  IPValidator(); static boolean validate(InformationProcessor ip, IPValidationListener l);  }
@Test public void testValidatePropertyEvaluator() { InformationProcessor ip=new InformationProcessor(); ip.setName("network"); ip.setVersion("version"); TypeProcessor tp=new TypeProcessor(); ip.getTypeProcessors().put("tp", tp); PropertyEvaluator pe=new PropertyEvaluator(); tp.getProperties().add(pe); TestListener l=new TestListener(); if (IPValidator.validatePropertyEvaluators(ip, tp, l)) { fail("Should be invalid"); } String[] expected=new String[] { MessageFormat.format(java.util.PropertyResourceBundle.getBundle( "activity.Messages").getString("ACTIVITY-14"), "Property Evaluator", "name"), java.util.PropertyResourceBundle.getBundle( "activity.Messages").getString("ACTIVITY-17") }; validateIssues(expected, l.getIssues()); }