JMXLocationResolver implements LocationResolver<JMXNodeLocation> { @Override public JMXNodeLocation absolutize(JMXNodeLocation base, JMXNodeLocation location) { return (location != null && location.getObjectName() != null) ? location : base; }  @Override JMXNodeLocation buildLocation(String path); @Override String findWildcardMatch(JMXNodeLocation multiTargetLocation, JMXNodeLocation singleLocation); @Override boolean isMultiTarget(JMXNodeLocation location); @Override JMXNodeLocation absolutize(JMXNodeLocation base, JMXNodeLocation location); @Override boolean isParent(JMXNodeLocation parent, JMXNodeLocation child); @Override boolean matches(JMXNodeLocation query, JMXNodeLocation location); @Override String applyTemplate(String nameTemplate, JMXNodeLocation location, String endpointName);  }
@Test public void testAbsolutize() throws Exception { JMXLocationResolver resolver = new JMXLocationResolver(); JMXNodeLocation abs; abs = resolver.absolutize(null, new JMXNodeLocation("domain:one=1,two=2")); Assert.assertEquals("domain:one=1,two=2", abs.toString()); abs = resolver.absolutize(new JMXNodeLocation("domain:one=1,two=2"), (JMXNodeLocation) null); Assert.assertEquals("domain:one=1,two=2", abs.toString()); abs = resolver.absolutize(new JMXNodeLocation("domain:foo=bar"), new JMXNodeLocation("domain:one=1,two=2")); Assert.assertEquals("domain:one=1,two=2", abs.toString()); }