use of org.drools.compiler.Primitives in project drools by kiegroup.
the class ArrayTest method testContainsDoubleArray.
@Test
public void testContainsDoubleArray() throws Exception {
final KieSession kieSession = createKieSessionFromDrl(getDrl("Double", false, "10"));
final List list = new ArrayList();
addGlobalsToSession(kieSession, list, 10.0d, new Double[] { 5d, 10d, 20d });
final Primitives p1 = new Primitives();
p1.setPrimitiveDoubleArray(new double[] { 5, 10, 20 });
p1.setDoublePrimitive(5);
final Primitives p2 = new Primitives();
p2.setDoublePrimitive(10);
p2.setPrimitiveDoubleArray(new double[] { 5, 10, 20 });
testArrayContains(kieSession, p1, p2, list);
}
use of org.drools.compiler.Primitives in project drools by kiegroup.
the class ArrayTest method testContainsLongArray.
@Test
public void testContainsLongArray() throws Exception {
final KieSession kieSession = createKieSessionFromDrl(getDrl("Long", false, "10"));
final List list = new ArrayList();
addGlobalsToSession(kieSession, list, 10L, new Long[] { 5L, 10L, 20L });
final Primitives p1 = new Primitives();
p1.setPrimitiveLongArray(new long[] { 5, 10, 20 });
p1.setLongPrimitive(5);
final Primitives p2 = new Primitives();
p2.setLongPrimitive(10);
p2.setPrimitiveLongArray(new long[] { 5, 10, 20 });
testArrayContains(kieSession, p1, p2, list);
}
use of org.drools.compiler.Primitives in project drools by kiegroup.
the class ArrayTest method testNotContainsIntArray.
@Test
public void testNotContainsIntArray() throws Exception {
final KieSession kieSession = createKieSessionFromDrl(getDrl("Integer", true, "10"));
final List list = new ArrayList();
addGlobalsToSession(kieSession, list, 10, new Integer[] { 40, 50, 60 });
final Primitives p1 = new Primitives();
p1.setPrimitiveIntArray(new int[] { 40, 50, 60 });
p1.setIntPrimitive(5);
final Primitives p2 = new Primitives();
p2.setPrimitiveIntArray(new int[] { 40, 50, 60 });
p2.setIntPrimitive(10);
testArrayContains(kieSession, p1, p2, list);
}
use of org.drools.compiler.Primitives in project drools by kiegroup.
the class ArrayTest method testNotContainsShortArray.
@Test
public void testNotContainsShortArray() throws Exception {
final KieSession kieSession = createKieSessionFromDrl(getDrl("Short", true, "1"));
final List list = new ArrayList();
addGlobalsToSession(kieSession, list, (short) 1, new Short[] { 4, 5, 6 });
final Primitives p1 = new Primitives();
p1.setPrimitiveShortArray(new short[] { 4, 5, 6 });
p1.setShortPrimitive((short) 2);
final Primitives p2 = new Primitives();
p2.setPrimitiveShortArray(new short[] { 4, 5, 6 });
p2.setShortPrimitive((short) 1);
testArrayContains(kieSession, p1, p2, list);
}
use of org.drools.compiler.Primitives in project drools by kiegroup.
the class ArrayTest method testNotContainsByteArray.
@Test
public void testNotContainsByteArray() throws Exception {
final KieSession kieSession = createKieSessionFromDrl(getDrl("Byte", true, "1"));
final List list = new ArrayList();
addGlobalsToSession(kieSession, list, (byte) 1, new Byte[] { 4, 5, 6 });
final Primitives p1 = new Primitives();
p1.setPrimitiveByteArray(new byte[] { 4, 5, 6 });
p1.setBytePrimitive((byte) 2);
final Primitives p2 = new Primitives();
p2.setPrimitiveByteArray(new byte[] { 4, 5, 6 });
p2.setBytePrimitive((byte) 1);
testArrayContains(kieSession, p1, p2, list);
}
Aggregations