Search in sources :

Example 1 with JavaScriptModel

use of org.whole.lang.models.codebase.JavaScriptModel in project whole by wholeplatform.

the class FactoriesTest method testDynamicMatch.

@Test
public void testDynamicMatch() {
    ReflectionFactory.deploy(new ModelsLanguageDynamicTestDeployer());
    IEntity model = new JavaScriptModel().create();
    ModelBuilderOperation op = new ModelBuilderOperation(RegistryConfigurations.CUSTOM);
    new JavaScriptModel().apply(op);
    IEntity dynamicModel = op.wGetResult();
    Assert.assertTrue(Matcher.match(model, dynamicModel));
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) IEntity(org.whole.lang.model.IEntity) JavaScriptModel(org.whole.lang.models.codebase.JavaScriptModel) Test(org.junit.Test)

Example 2 with JavaScriptModel

use of org.whole.lang.models.codebase.JavaScriptModel in project whole by wholeplatform.

the class FactoriesTest method testStrictMatch.

@Test
public void testStrictMatch() {
    IEntity model = new JavaScriptModel().create();
    ModelBuilderOperation op = new ModelBuilderOperation(RegistryConfigurations.STRICT);
    new JavaScriptModel().apply(op);
    IEntity strictModel = op.wGetResult();
    Assert.assertTrue(Matcher.match(model, strictModel));
    op = new ModelBuilderOperation(RegistryConfigurations.RESOLVER);
    new JavaScriptModel().apply(op);
    IEntity resolverModel = op.wGetResult();
    Assert.assertTrue(Matcher.match(model, resolverModel));
    Assert.assertTrue(Matcher.match(strictModel, resolverModel));
}
Also used : ModelBuilderOperation(org.whole.lang.builders.ModelBuilderOperation) IEntity(org.whole.lang.model.IEntity) JavaScriptModel(org.whole.lang.models.codebase.JavaScriptModel) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ModelBuilderOperation (org.whole.lang.builders.ModelBuilderOperation)2 IEntity (org.whole.lang.model.IEntity)2 JavaScriptModel (org.whole.lang.models.codebase.JavaScriptModel)2