use of org.whole.lang.models.model.SimpleEntity in project whole by wholeplatform.
the class ModelInvariantsTest method testParentedFailures.
@Test
public void testParentedFailures() {
SimpleName name = model.getName();
SimpleEntity simpleEntity = ModelsEntityFactory.instance.createSimpleEntity();
try {
simpleEntity.setName(name);
Assert.fail();
} catch (IllegalArgumentException e) {
simpleEntity.wUnset(name);
}
try {
simpleEntity.getTypes().wAdd(name);
Assert.fail();
} catch (IllegalArgumentException e) {
simpleEntity.getTypes().wRemove(name);
}
try {
simpleEntity.getTypes().wSet(0, name);
Assert.fail();
} catch (IllegalArgumentException e) {
simpleEntity.getTypes().wRemove(0);
}
try {
simpleEntity.getTypes().wAdd(0, name);
Assert.fail();
} catch (IllegalArgumentException e) {
simpleEntity.getTypes().wRemove(0);
}
}
use of org.whole.lang.models.model.SimpleEntity in project whole by wholeplatform.
the class MatcherTest method testSubstitute.
@Test
public void testSubstitute() {
SimpleEntity entityPattern = new SimpleEntityPattern().create();
IBindingManager bindings = BindingManagerFactory.instance.createBindingManager();
bindings.wDef("entityName", ModelsEntityFactory.instance.createSimpleName("SE"));
Matcher.substitute(entityPattern, bindings, false);
assertEquals("SE", entityPattern.getName().wStringValue());
}
use of org.whole.lang.models.model.SimpleEntity in project whole by wholeplatform.
the class MatcherTest method testSubstituteValue.
@Test
public void testSubstituteValue() {
SimpleEntity entityPattern = new SimpleEntityPattern().create();
IBindingScope args = BindingManagerFactory.instance.createSimpleScope();
args.wDefValue("entityName", "SE");
Matcher.substitute(entityPattern, args, false);
assertEquals("SE", entityPattern.getName().wStringValue());
assertEquals(ModelsEntityDescriptorEnum.SimpleName, entityPattern.getName().wGetEntityDescriptor());
}
use of org.whole.lang.models.model.SimpleEntity in project whole by wholeplatform.
the class SimpleEntityTablePart method getModelSpecificChildren.
protected List<IEntity> getModelSpecificChildren() {
SimpleEntity entity = getModelEntity();
List<IEntity> list = new ArrayList<IEntity>(4);
list.add(entity.getModifiers());
list.add(entity.getName());
list.add(entity.getTypes());
list.add(entity.getFeatures());
return list;
}
Aggregations