Search in sources :

Example 1 with TypeRelations

use of org.whole.lang.models.model.TypeRelations in project whole by wholeplatform.

the class FactoriesTest method testDynamicFactory.

@Test
public void testDynamicFactory() {
    TypeRelations typeRelations = ModelsEntityFactory.instance.createTypeRelations();
    IEntityFactory ef = GenericEntityFactory.instance(RegistryConfigurations.CUSTOM);
    InterpreterOperation.interpret(new ModelsModel().create());
    ILanguageKit lk = ReflectionFactory.getLanguageKit("http://lang.whole.org/Models");
    EntityDescriptorEnum edEnum = lk.getEntityDescriptorEnum();
    typeRelations.wAdd(ef.create(edEnum.valueOf("TypeAliasOf")));
    // PrettyPrinterOperation.prettyPrint(typeRelations);
    Assert.assertFalse(typeRelations.wIsAdapter());
    ReflectionFactory.deploy(new ModelsLanguageDynamicTestDeployer());
    IEntity e1 = ef.create(ModelsEntityDescriptorEnum.TypeRelations, ef.create(ModelsEntityDescriptorEnum.TypeAliasOf), ef.create(ModelsEntityDescriptorEnum.SubtypesOf).wGetAdaptee(false));
    PrettyPrinterOperation.prettyPrint(e1);
    Assert.assertTrue(e1.wIsAdapter());
}
Also used : PropertiesEntityDescriptorEnum(org.whole.lang.properties.reflect.PropertiesEntityDescriptorEnum) ModelsEntityDescriptorEnum(org.whole.lang.models.reflect.ModelsEntityDescriptorEnum) TestEntitiesEntityDescriptorEnum(org.whole.lang.testentities.reflect.TestEntitiesEntityDescriptorEnum) JavaEntityDescriptorEnum(org.whole.lang.java.reflect.JavaEntityDescriptorEnum) EntityDescriptorEnum(org.whole.lang.reflect.EntityDescriptorEnum) IEntity(org.whole.lang.model.IEntity) TypeRelations(org.whole.lang.models.model.TypeRelations) ModelsModel(org.whole.lang.models.codebase.ModelsModel) ILanguageKit(org.whole.lang.reflect.ILanguageKit) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 JavaEntityDescriptorEnum (org.whole.lang.java.reflect.JavaEntityDescriptorEnum)1 IEntity (org.whole.lang.model.IEntity)1 ModelsModel (org.whole.lang.models.codebase.ModelsModel)1 TypeRelations (org.whole.lang.models.model.TypeRelations)1 ModelsEntityDescriptorEnum (org.whole.lang.models.reflect.ModelsEntityDescriptorEnum)1 PropertiesEntityDescriptorEnum (org.whole.lang.properties.reflect.PropertiesEntityDescriptorEnum)1 EntityDescriptorEnum (org.whole.lang.reflect.EntityDescriptorEnum)1 ILanguageKit (org.whole.lang.reflect.ILanguageKit)1 TestEntitiesEntityDescriptorEnum (org.whole.lang.testentities.reflect.TestEntitiesEntityDescriptorEnum)1