use of org.drools.core.meta.org.test.AnotherKlass_ in project drools by kiegroup.
the class MetadataTest method testMetadataInternals.
@Test
public void testMetadataInternals() {
SubKlass_<SubKlass> sk = new SubKlass_(new SubKlassImpl());
Klass_<Klass> k = new Klass_(new KlassImpl());
AnotherKlass_<AnotherKlass> ak = new AnotherKlass_(new AnotherKlassImpl());
assertEquals(4, ak.getMetaClassInfo().getProperties().length);
assertEquals(4, sk.getMetaClassInfo().getProperties().length);
assertEquals(4, k.getMetaClassInfo().getProperties().length);
assertEquals("subProp", sk.getMetaClassInfo().getProperties()[2].getName());
}
use of org.drools.core.meta.org.test.AnotherKlass_ in project drools by kiegroup.
the class MetadataTest method testMetaPropertiesWithManyKlasses.
@Test
public void testMetaPropertiesWithManyKlasses() {
SubKlass ski = new Foo();
ski.setSubProp(42);
ski.setProp("hello");
SubKlass_ sk = new SubKlass_(ski);
AnotherKlass aki = new AnotherKlassImpl();
aki.setNum(1);
AnotherKlass_ ak = new AnotherKlass_(aki);
sk.modify().subProp(-99).prop("bye").call();
ak.modify().num(-5).call();
assertEquals(-5, aki.getNum());
assertEquals(-99, (int) ski.getSubProp());
}
Aggregations