Search in sources :

Example 26 with ModelsModel

use of org.whole.lang.models.codebase.ModelsModel 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

ModelsModel (org.whole.lang.models.codebase.ModelsModel)26 Test (org.junit.Test)25 IEntity (org.whole.lang.model.IEntity)22 Model (org.whole.lang.models.model.Model)20 PathExpression (org.whole.lang.queries.model.PathExpression)18 ITemplateManager (org.whole.lang.templates.ITemplateManager)18 ModelDeclarations (org.whole.lang.models.model.ModelDeclarations)17 DataEntity (org.whole.lang.models.model.DataEntity)10 SimpleEntity (org.whole.lang.models.model.SimpleEntity)6 XmlModel (org.whole.lang.models.codebase.XmlModel)5 CompositeEntity (org.whole.lang.models.model.CompositeEntity)5 Features (org.whole.lang.models.model.Features)5 EnumEntity (org.whole.lang.models.model.EnumEntity)4 Feature (org.whole.lang.models.model.Feature)4 ArrayList (java.util.ArrayList)3 IBindingManager (org.whole.lang.bindings.IBindingManager)2 ModelBuilderOperation (org.whole.lang.builders.ModelBuilderOperation)2 ModelFeaturesBuilder (org.whole.lang.builders.builder.ModelFeaturesBuilder)2 EnumValues (org.whole.lang.models.model.EnumValues)2 ModelTemplate (org.whole.lang.templates.ModelTemplate)2