@Test public void ruleBookFactoryBeanShouldBeCreatedUsingOnlyPackageName() throws Exception { RuleBookFactoryBean factoryBean = new RuleBookFactoryBean("com.deliveredtechnologies.rulebook.spring"); RuleBook<String> ruleBook = (RuleBook<String>)factoryBean.getObject(); ruleBook.run(_facts); Assert.assertEquals("valueTwo", _facts.getValue("value2")); Assert.assertEquals("firstRule", ruleBook.getResult().get().getValue()); }
@Override public RuleBook getObject() throws Exception { if (_package != null) { if (_ruleBookType != null) { return new RuleBookRunner(_ruleBookType, _package); } return new RuleBookRunner(_package); } if (_ruleBookType != null) { return RuleBookBuilder.create(_ruleBookType).build(); } return new CoRRuleBook(); }
RuleBookFactoryBean implements FactoryBean<RuleBook> { @Override public RuleBook getObject() throws Exception { if (_package != null) { if (_ruleBookType != null) { return new RuleBookRunner(_ruleBookType, _package); } return new RuleBookRunner(_package); } if (_ruleBookType != null) { return RuleBookBuilder.create(_ruleBookType).build(); } return new CoRRuleBook(); } }
RuleBookFactoryBean implements FactoryBean<RuleBook> { @Override public RuleBook getObject() throws Exception { if (_package != null) { if (_ruleBookType != null) { return new RuleBookRunner(_ruleBookType, _package); } return new RuleBookRunner(_package); } if (_ruleBookType != null) { return RuleBookBuilder.create(_ruleBookType).build(); } return new CoRRuleBook(); } @Deprecated  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType, String pkg);  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType); @Deprecated  RuleBookFactoryBean(String pkg); }
RuleBookFactoryBean implements FactoryBean<RuleBook> { @Override public RuleBook getObject() throws Exception { if (_package != null) { if (_ruleBookType != null) { return new RuleBookRunner(_ruleBookType, _package); } return new RuleBookRunner(_package); } if (_ruleBookType != null) { return RuleBookBuilder.create(_ruleBookType).build(); } return new CoRRuleBook(); } @Deprecated  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType, String pkg);  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType); @Deprecated  RuleBookFactoryBean(String pkg); @Override RuleBook getObject(); @Override Class<?> getObjectType(); @Override boolean isSingleton(); }
RuleBookFactoryBean implements FactoryBean<RuleBook> { @Override public RuleBook getObject() throws Exception { if (_package != null) { if (_ruleBookType != null) { return new RuleBookRunner(_ruleBookType, _package); } return new RuleBookRunner(_package); } if (_ruleBookType != null) { return RuleBookBuilder.create(_ruleBookType).build(); } return new CoRRuleBook(); } @Deprecated  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType, String pkg);  RuleBookFactoryBean(Class<? extends RuleBook> ruleBookType); @Deprecated  RuleBookFactoryBean(String pkg); @Override RuleBook getObject(); @Override Class<?> getObjectType(); @Override boolean isSingleton();  }