@Test public void testThrowFileExceptionWhenFeatureServiceNotSet() throws JspException { BaseFlipTag t = new BaseFlipTag(FeatureState.ENABLED) { @Override protected FeatureService getFeatureService() { return null; } }; try { t.doStartTag(); fail("Expected a FlipException to be thrown."); } catch (FlipException e) { } }
@Override public int doStartTag() throws JspException { FeatureService service = getFeatureService(); if (service == null) { throw new FlipException("The FeatureService has not been instantiated."); } return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY; }
BaseFlipTag extends TagSupport { @Override public int doStartTag() throws JspException { FeatureService service = getFeatureService(); if (service == null) { throw new FlipException("The FeatureService has not been instantiated."); } return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY; } }
BaseFlipTag extends TagSupport { @Override public int doStartTag() throws JspException { FeatureService service = getFeatureService(); if (service == null) { throw new FlipException("The FeatureService has not been instantiated."); } return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY; } BaseFlipTag(final FeatureState myState); }
BaseFlipTag extends TagSupport { @Override public int doStartTag() throws JspException { FeatureService service = getFeatureService(); if (service == null) { throw new FlipException("The FeatureService has not been instantiated."); } return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY; } BaseFlipTag(final FeatureState myState); @Override int doStartTag(); String getFeature(); void setFeature(final String feature); }
BaseFlipTag extends TagSupport { @Override public int doStartTag() throws JspException { FeatureService service = getFeatureService(); if (service == null) { throw new FlipException("The FeatureService has not been instantiated."); } return service.getFeatureState(feature) == myState ? Tag.EVAL_BODY_INCLUDE : Tag.SKIP_BODY; } BaseFlipTag(final FeatureState myState); @Override int doStartTag(); String getFeature(); void setFeature(final String feature);  }