Search in sources :

Example 1 with KieBuilderSetImpl

use of org.drools.compiler.kie.builder.impl.KieBuilderSetImpl in project drools by kiegroup.

the class KieBuilderSetImplTest method testBuild.

@Test
public void testBuild() throws Exception {
    final KieServices ks = KieServices.Factory.get();
    final KieFileSystem kfs = ks.newKieFileSystem();
    kfs.write("src/main/resources/rule%201.drl", ruleContent());
    final KieBuilderSetImpl kieBuilderSet = new KieBuilderSetImpl(kieBuilder(ks, kfs));
    kieBuilderSet.setFiles(new String[] { "src/main/resources/rule%201.drl" });
    final IncrementalResults build = kieBuilderSet.build();
    assertEquals(0, build.getAddedMessages().size());
    assertEquals(0, build.getRemovedMessages().size());
}
Also used : KieFileSystem(org.kie.api.builder.KieFileSystem) KieBuilderSetImpl(org.drools.compiler.kie.builder.impl.KieBuilderSetImpl) KieServices(org.kie.api.KieServices) IncrementalResults(org.kie.internal.builder.IncrementalResults) Test(org.junit.Test)

Example 2 with KieBuilderSetImpl

use of org.drools.compiler.kie.builder.impl.KieBuilderSetImpl in project drools by kiegroup.

the class KieBuilderSetImplTest method testBuildPercentageAndWhiteSpaceInName.

@Test
@Ignore("RHPAM-1184, RHDM-601")
public void testBuildPercentageAndWhiteSpaceInName() throws Exception {
    final KieServices ks = KieServices.Factory.get();
    final KieFileSystem kfs = ks.newKieFileSystem();
    kfs.write("src/main/resources/my rule 100% okay.rdrl", ResourceFactory.newInputStreamResource(this.getClass().getResourceAsStream("my rule 100% okay.rdrl")));
    final KieBuilderSetImpl kieBuilderSet = new KieBuilderSetImpl(kieBuilder(ks, kfs));
    kieBuilderSet.setFiles(new String[] { "src/main/resources/my rule 100% okay.rdrl" });
    final IncrementalResults build = kieBuilderSet.build();
    assertEquals(0, build.getAddedMessages().size());
    assertEquals(0, build.getRemovedMessages().size());
}
Also used : KieFileSystem(org.kie.api.builder.KieFileSystem) KieBuilderSetImpl(org.drools.compiler.kie.builder.impl.KieBuilderSetImpl) KieServices(org.kie.api.KieServices) IncrementalResults(org.kie.internal.builder.IncrementalResults) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

KieBuilderSetImpl (org.drools.compiler.kie.builder.impl.KieBuilderSetImpl)2 Test (org.junit.Test)2 KieServices (org.kie.api.KieServices)2 KieFileSystem (org.kie.api.builder.KieFileSystem)2 IncrementalResults (org.kie.internal.builder.IncrementalResults)2 Ignore (org.junit.Ignore)1