@Test public void doStartConvertsValidJexlToCsel() throws Exception { SelectorConfiguration jexlSelector = createSelector("valid", JexlSelector.TYPE); when(selectorManager.browseJexl()).thenReturn(asList(jexlSelector)); manager.doStart(); verify(selectorManager).browseJexl(); assertThat(jexlSelector.getType(), is(CselSelector.TYPE)); verify(selectorManager).update(jexlSelector); verifyNoMoreInteractions(selectorManager); }
@Override protected void doStart() throws Exception { selectorManager.browseJexl().forEach(config -> { String expression = config.getAttributes().get("expression"); String name = config.getName(); log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression); try { selectorFactory.validateSelector(CselSelector.TYPE, expression); config.setType(CselSelector.TYPE); selectorManager.update(config); } catch (Exception e) { log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}", name, expression, log.isDebugEnabled() ? e : null); } }); }
ContentSelectorUpgradeManager extends StateGuardLifecycleSupport { @Override protected void doStart() throws Exception { selectorManager.browseJexl().forEach(config -> { String expression = config.getAttributes().get("expression"); String name = config.getName(); log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression); try { selectorFactory.validateSelector(CselSelector.TYPE, expression); config.setType(CselSelector.TYPE); selectorManager.update(config); } catch (Exception e) { log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}", name, expression, log.isDebugEnabled() ? e : null); } }); } }
ContentSelectorUpgradeManager extends StateGuardLifecycleSupport { @Override protected void doStart() throws Exception { selectorManager.browseJexl().forEach(config -> { String expression = config.getAttributes().get("expression"); String name = config.getName(); log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression); try { selectorFactory.validateSelector(CselSelector.TYPE, expression); config.setType(CselSelector.TYPE); selectorManager.update(config); } catch (Exception e) { log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}", name, expression, log.isDebugEnabled() ? e : null); } }); } @Inject  ContentSelectorUpgradeManager(final SelectorFactory selectorFactory, final SelectorManager selectorManager); }
ContentSelectorUpgradeManager extends StateGuardLifecycleSupport { @Override protected void doStart() throws Exception { selectorManager.browseJexl().forEach(config -> { String expression = config.getAttributes().get("expression"); String name = config.getName(); log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression); try { selectorFactory.validateSelector(CselSelector.TYPE, expression); config.setType(CselSelector.TYPE); selectorManager.update(config); } catch (Exception e) { log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}", name, expression, log.isDebugEnabled() ? e : null); } }); } @Inject  ContentSelectorUpgradeManager(final SelectorFactory selectorFactory, final SelectorManager selectorManager);  }
ContentSelectorUpgradeManager extends StateGuardLifecycleSupport { @Override protected void doStart() throws Exception { selectorManager.browseJexl().forEach(config -> { String expression = config.getAttributes().get("expression"); String name = config.getName(); log.debug("Attempting to upgrade JEXL content selector {} to CSEL, expression={}", name, expression); try { selectorFactory.validateSelector(CselSelector.TYPE, expression); config.setType(CselSelector.TYPE); selectorManager.update(config); } catch (Exception e) { log.warn("Could not upgrade JEXL content selector {} to CSEL, expression={}", name, expression, log.isDebugEnabled() ? e : null); } }); } @Inject  ContentSelectorUpgradeManager(final SelectorFactory selectorFactory, final SelectorManager selectorManager);   }