use of org.drools.core.base.ClassFieldAccessorCache in project drools by kiegroup.
the class LongClassFieldExtractorTest method setUp.
@Before
public void setUp() throws Exception {
ClassFieldAccessorStore store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
store.setEagerWire(true);
extractor = store.getReader(TestBean.class, "longAttr");
}
use of org.drools.core.base.ClassFieldAccessorCache in project drools by kiegroup.
the class IntClassFieldExtractorTest method setUp.
@Before
public void setUp() throws Exception {
ClassFieldAccessorStore store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
store.setEagerWire(true);
this.reader = store.getReader(TestBean.class, "intAttr");
}
use of org.drools.core.base.ClassFieldAccessorCache in project drools by kiegroup.
the class MVELClassFieldExtractorTest method setUp.
@Before
public void setUp() throws Exception {
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
store.setEagerWire(true);
extractor = (MVELObjectClassFieldReader) store.getMVELReader(Person.class.getPackage().getName(), Person.class.getName(), "addresses['home'].street", true, String.class);
MVELDialectRuntimeData data = new MVELDialectRuntimeData();
data.addImport(Person.class.getSimpleName(), Person.class);
data.onAdd(null, ProjectClassLoader.createProjectClassLoader());
extractor.compile(data);
person[0] = new Person("bob", 30);
business[0] = new Address("Business Street", "999", null);
home[0] = new Address("Home Street", "555", "55555555");
person[0].getAddresses().put("business", business[0]);
person[0].getAddresses().put("home", home[0]);
person[1] = new Person("mark", 35);
business[1] = new Address("Another Business Street", "999", null);
home[1] = new Address("Another Home Street", "555", "55555555");
person[1].getAddresses().put("business", business[1]);
person[1].getAddresses().put("home", home[1]);
}
use of org.drools.core.base.ClassFieldAccessorCache in project drools by kiegroup.
the class ObjectClassFieldExtractorTest method setUp.
@Before
public void setUp() throws Exception {
ClassFieldAccessorStore store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
store.setEagerWire(true);
this.reader = store.getReader(TestBean.class, "listAttr");
}
use of org.drools.core.base.ClassFieldAccessorCache in project drools by kiegroup.
the class ObjectClassFieldExtractorTest method testIsNullValue.
@Test
public void testIsNullValue() {
assertFalse(this.reader.isNullValue(null, this.bean));
ClassFieldAccessorStore store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(Thread.currentThread().getContextClassLoader()));
store.setEagerWire(true);
InternalReadAccessor nullExtractor = store.getReader(TestBean.class, "nullAttr");
assertTrue(nullExtractor.isNullValue(null, this.bean));
}
Aggregations