@Test public void testSyntaxSpecificMacroExistsWhenMacroIsRegisteredForAllSyntaxes() throws Exception { Assert.assertFalse(getMockedComponent().exists(new MacroId("testsimplemacro", new Syntax(SyntaxType.XWIKI, "2.0")))); }
@Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; }
DefaultMacroManager implements MacroManager { @Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; } }
DefaultMacroManager implements MacroManager { @Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; }  }
DefaultMacroManager implements MacroManager { @Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; }  @Override Set<MacroId> getMacroIds(); @Override Set<MacroId> getMacroIds(Syntax syntax); @Override Macro<?> getMacro(MacroId macroId); @Override boolean exists(MacroId macroId); }
DefaultMacroManager implements MacroManager { @Override public boolean exists(MacroId macroId) { String macroHint = macroId.toString(); boolean hasMacro = true; try { this.componentManager.get().getInstance(Macro.class, macroHint); } catch (ComponentLookupException ex) { hasMacro = false; } return hasMacro; }  @Override Set<MacroId> getMacroIds(); @Override Set<MacroId> getMacroIds(Syntax syntax); @Override Macro<?> getMacro(MacroId macroId); @Override boolean exists(MacroId macroId);  }