String[] errorMessages = new String[] {
"Destroy-method 'notExisting' not found in bean class 'org.springframework.Base'",
"Init-method 'notExisting' not found in bean class 'org.springframework.Base'",
"Static factory method 'notExisting' with 0 arguments not found in factory bean class 'org.springframework.Base'" };
IBean bean = BeansModelUtils.getBean("incorrect", beansConfig);
assertNotNull(bean);
int severity = MarkerUtils.getHighestSeverityFromMarkersInRange(resource, bean
.getElementStartLine(), bean.getElementEndLine());
assertTrue(severity == IMarker.SEVERITY_ERROR);
Set<IMarker> markers = MarkerUtils.getAllMarkersInRange(resource, bean
.getElementStartLine(), bean.getElementEndLine());
assertTrue(markers.size() == 3);
for (IMarker marker : markers) {
String msg = (String) marker.getAttribute(IMarker.MESSAGE);
assertTrue("Error message not expected '" + msg + "'", Arrays.asList(errorMessages)
.contains(msg));