use of org.drools.core.meta.org.test.KlassImpl in project drools by kiegroup.
the class MetadataTest method testNewInstance.
@Test
public void testNewInstance() {
Klass klass = Klass_.newKlass(URI.create("test")).call();
assertNotNull(klass);
assertTrue(klass instanceof KlassImpl);
SubKlass klass2 = SubKlass_.newSubKlass(URI.create("test2")).subProp(42).prop("hello").call();
assertEquals("hello", klass2.getProp());
assertEquals(42, (int) klass2.getSubProp());
}
use of org.drools.core.meta.org.test.KlassImpl 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());
}
Aggregations