@Test public void testUndefinedFeatureState() { assertNull(descriptor.process(contextManager)); }
@Override public FeatureState process(final ContextManager contextManager) { if (expirationDate != null) { Logger.getLogger(this.getClass().getName()).warning(String.format("The feature [%s] is expired. The expiration date is %t", name, expirationDate)); } if (state != null) { return state; } else { if (rules != null) { for (final FeatureRule rule : rules) { final FeatureState ruleResult = rule.process(contextManager); if (ruleResult != null) { return ruleResult; } } } } return null; }
FeatureDescriptor implements FeatureProcessor { @Override public FeatureState process(final ContextManager contextManager) { if (expirationDate != null) { Logger.getLogger(this.getClass().getName()).warning(String.format("The feature [%s] is expired. The expiration date is %t", name, expirationDate)); } if (state != null) { return state; } else { if (rules != null) { for (final FeatureRule rule : rules) { final FeatureState ruleResult = rule.process(contextManager); if (ruleResult != null) { return ruleResult; } } } } return null; } }
FeatureDescriptor implements FeatureProcessor { @Override public FeatureState process(final ContextManager contextManager) { if (expirationDate != null) { Logger.getLogger(this.getClass().getName()).warning(String.format("The feature [%s] is expired. The expiration date is %t", name, expirationDate)); } if (state != null) { return state; } else { if (rules != null) { for (final FeatureRule rule : rules) { final FeatureState ruleResult = rule.process(contextManager); if (ruleResult != null) { return ruleResult; } } } } return null; }  }
FeatureDescriptor implements FeatureProcessor { @Override public FeatureState process(final ContextManager contextManager) { if (expirationDate != null) { Logger.getLogger(this.getClass().getName()).warning(String.format("The feature [%s] is expired. The expiration date is %t", name, expirationDate)); } if (state != null) { return state; } else { if (rules != null) { for (final FeatureRule rule : rules) { final FeatureState ruleResult = rule.process(contextManager); if (ruleResult != null) { return ruleResult; } } } } return null; }  String getName(); void setName(String name); FeatureRule[] getRules(); void setRules(FeatureRule[] rules); FeatureState getState(); void setState(FeatureState state); Date getExpirationDate(); void setExpirationDate(Date expirationDate); @Override FeatureState process(final ContextManager contextManager); }
FeatureDescriptor implements FeatureProcessor { @Override public FeatureState process(final ContextManager contextManager) { if (expirationDate != null) { Logger.getLogger(this.getClass().getName()).warning(String.format("The feature [%s] is expired. The expiration date is %t", name, expirationDate)); } if (state != null) { return state; } else { if (rules != null) { for (final FeatureRule rule : rules) { final FeatureState ruleResult = rule.process(contextManager); if (ruleResult != null) { return ruleResult; } } } } return null; }  String getName(); void setName(String name); FeatureRule[] getRules(); void setRules(FeatureRule[] rules); FeatureState getState(); void setState(FeatureState state); Date getExpirationDate(); void setExpirationDate(Date expirationDate); @Override FeatureState process(final ContextManager contextManager);  }