use of org.drools.core.test.model.Address 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]);
}
Aggregations