resource = new MockFile(POLICY_FILE);
// set up a number of paths for the test
XPath root = new XPath("/");
XPath aPath1 = new XPath("/aone");
XPath aPath2 = new XPath("/aone/atwo");
XPath bPath1 = new XPath("/bone");
XPath bPath2 = new XPath("/bone/btwo");
XPath bPath3 = new XPath("/bone/bthree");
XPath cPath1 = new XPath("/cone");
mger = new MarkerGeneratingErrorReporter(resource,
new Element("aone"), null);
// create PROBLEM markers from the paths
IMarker marker1 = resource.createMarker(IMarker.PROBLEM);
marker1.setAttribute(XPath.class.getName(), aPath2.getExternalForm());
marker1.setAttribute(NAMESPACES_ATTRIBUTE, ":aPath2Test");
IMarker marker2 = resource.createMarker(IMarker.PROBLEM);
marker2.setAttribute(XPath.class.getName(), aPath1.getExternalForm());
marker2.setAttribute(NAMESPACES_ATTRIBUTE, ":aPath1Test");
IMarker marker3 = resource.createMarker(IMarker.PROBLEM);
marker3.setAttribute(XPath.class.getName(), bPath2.getExternalForm());
marker3.setAttribute(NAMESPACES_ATTRIBUTE, ":bPath2Test");
// create some MESSAGE markers
IMarker marker4 = resource.createMarker(IMarker.MESSAGE);
marker4.setAttribute(XPath.class.getName(), bPath1.getExternalForm());
marker4.setAttribute(NAMESPACES_ATTRIBUTE, ":bPath2Test");
IMarker marker5= resource.createMarker(IMarker.MESSAGE);
marker5.setAttribute(XPath.class.getName(), bPath3.getExternalForm());
marker5.setAttribute(NAMESPACES_ATTRIBUTE, ":cPath1Test");
IMarker markerc = resource.createMarker(IMarker.MESSAGE);
markerc.setAttribute(XPath.class.getName(), cPath1.getExternalForm());
markerc.setAttribute(NAMESPACES_ATTRIBUTE, ":cPathTest");
// test to ensure that XPath is NOT returned for the correct path string but incorrect namespace
Assert.assertEquals("try to obtain xPath using correct namespace",
bPath2.getExternalForm(),