Search in sources :

Example 1 with DslDynamicDefinitionRule

use of io.vertigo.dynamo.plugins.environment.loaders.kpr.rules.DslDynamicDefinitionRule in project vertigo by KleeGroup.

the class DslDefinitionRuleTest method test1.

@Test
public void test1() throws PegNoMatchFoundException {
    final DslDefinition dslDefinition = new DslDynamicDefinitionRule("create", dslDefinitionRepository.getGrammar()).parse("create Formatter FMT_TEST { args : \"UPPER\" }", 0).getValue();
    Assert.assertNotNull(dslDefinition);
}
Also used : DslDefinition(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition) DslDynamicDefinitionRule(io.vertigo.dynamo.plugins.environment.loaders.kpr.rules.DslDynamicDefinitionRule) Test(org.junit.Test)

Example 2 with DslDynamicDefinitionRule

use of io.vertigo.dynamo.plugins.environment.loaders.kpr.rules.DslDynamicDefinitionRule in project vertigo by KleeGroup.

the class DslDefinitionRuleTest method test2.

// Exemple de test sur la déclaration d'un Domain
// create Domain DO_CODE_POSTAL (
// dataType : String;
// formatter : FMT_DEFAULT;
// constraint : {CK_CODE_POSTAL}
// )
@Test
public void test2() throws PegNoMatchFoundException {
    final DslDefinition dslDefinition = new DslDynamicDefinitionRule("create", dslDefinitionRepository.getGrammar()).parse("create Domain DO_CODE_POSTAL { dataType : String ,  formatter:FMT_DEFAULT, constraint : [ CK_CODE_POSTAL ]   } ", 0).getValue();
    Assert.assertNotNull(dslDefinition);
}
Also used : DslDefinition(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition) DslDynamicDefinitionRule(io.vertigo.dynamo.plugins.environment.loaders.kpr.rules.DslDynamicDefinitionRule) Test(org.junit.Test)

Aggregations

DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)2 DslDynamicDefinitionRule (io.vertigo.dynamo.plugins.environment.loaders.kpr.rules.DslDynamicDefinitionRule)2 Test (org.junit.Test)2