Package net.firstpartners.drools

Source Code of net.firstpartners.drools.FileRuleLoaderTest

package net.firstpartners.drools;

import static org.junit.Assert.assertNotNull;

import java.io.IOException;
import java.util.logging.Logger;

import net.firstpartners.drools.data.RuleSource;

import org.drools.KnowledgeBase;
import org.drools.runtime.StatefulKnowledgeSession;
import org.junit.Test;

public class FileRuleLoaderTest {

  //Class Under Test
  FileRuleLoader ruleLoader = new FileRuleLoader();

  private static final Logger log = Logger.getLogger(FileRuleLoaderTest.class
      .getName());

  @Test
  public final void testLoadCachedRules() throws IOException, ClassNotFoundException {

    //Set the rule source
    RuleSource ruleSource = new RuleSource();
    ruleSource.setKnowledgeBaseLocation("war/sampleresources/SpreadSheetServlet/log-then-modify-rules.KnowledgeBase");

    //do the call
    KnowledgeBase kb = ruleLoader.loadKnowledgeBase(ruleSource);
    assertNotNull(kb);
    StatefulKnowledgeSession sks = kb.newStatefulKnowledgeSession();

  }

}
TOP

Related Classes of net.firstpartners.drools.FileRuleLoaderTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.