use of org.drools.core.base.ClassFieldAccessorStore 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.ClassFieldAccessorStore 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.ClassFieldAccessorStore 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.ClassFieldAccessorStore 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));
}
use of org.drools.core.base.ClassFieldAccessorStore in project drools by kiegroup.
the class ClassBuilderTest method build.
private Class build(ClassBuilder builder, ClassDefinition classDef) throws Exception {
classLoader = new PackageClassLoader(data, ProjectClassLoader.createProjectClassLoader());
byte[] d = builder.buildClass(classDef, classLoader);
data.write(convertClassToResourcePath(classDef.getClassName()), d);
this.store = new ClassFieldAccessorStore();
store.setClassFieldAccessorCache(new ClassFieldAccessorCache(classLoader));
store.setEagerWire(true);
Class clazz = classLoader.loadClass(classDef.getClassName());
classDef.setDefinedClass(clazz);
return clazz;
}
Aggregations