Search in sources :

Example 1 with ExtendedModifiers

use of org.whole.lang.java.model.ExtendedModifiers in project whole by wholeplatform.

the class FactoriesTest method testUniqueConstraint.

// TODO replace test language with one having unique constraints
@Test
public void testUniqueConstraint() {
    JavaEntityFactory ef = JavaEntityFactory.instance;
    JavaEntityFactory sef = JavaEntityFactory.instance(RegistryConfigurations.STRICT);
    ExtendedModifiers e = ef.createExtendedModifiers(ef.createModifier(ModifierEnum._abstract), ef.createModifier(ModifierEnum._abstract));
    e.wAdd(ef.createModifier(ModifierEnum._abstract));
    Assert.assertEquals(3, e.wSize());
    ExtendedModifiers se = sef.createExtendedModifiers(sef.createModifier(ModifierEnum._abstract), sef.createModifier(ModifierEnum._abstract));
    se.wAdd(ef.createModifier(ModifierEnum._abstract));
    // TODO was 1
    Assert.assertEquals(3, se.wSize());
    // TODO was false
    Assert.assertTrue(Matcher.match(se, e));
    Assert.assertFalse(Matcher.match(se, ef.createExtendedModifiers(// TODO was true
    ef.createModifier(ModifierEnum._abstract))));
}
Also used : JavaEntityFactory(org.whole.lang.java.factories.JavaEntityFactory) ExtendedModifiers(org.whole.lang.java.model.ExtendedModifiers) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 JavaEntityFactory (org.whole.lang.java.factories.JavaEntityFactory)1 ExtendedModifiers (org.whole.lang.java.model.ExtendedModifiers)1