use of org.whole.lang.builders.builder.ModelFeaturesBuilder in project whole by wholeplatform.
the class ModelFragmentsBuilderTest method testModelFeaturesBuilderWithFeatureEvents.
@Test
public void testModelFeaturesBuilderWithFeatureEvents() {
ITemplateFactory<Model> modelsModel = new ModelsModelWithFeatureEvents();
Features features = ModelsEntityFactory.instance.createFeatures(0);
modelsModel.apply(new SpecificBuilderAdapterOperation(new ModelFeaturesBuilder(features)));
int count = 0;
Model model = modelsModel.create();
AbstractPatternFilterIterator<Feature> i = IteratorFactory.<Feature>descendantOrSelfMatcherIterator().withPattern(ModelsEntityDescriptorEnum.Feature);
i.reset(model);
for (Feature feature : i) if (EntityUtils.isNotResolver(feature))
count++;
assertEquals(features.wSize(), count);
}
use of org.whole.lang.builders.builder.ModelFeaturesBuilder in project whole by wholeplatform.
the class ModelFragmentsBuilderTest method testModelFeaturesBuilder.
@Test
public void testModelFeaturesBuilder() {
ITemplateFactory<Model> modelsModel = new ModelsModel();
final Features features = ModelsEntityFactory.instance.createFeatures(0);
modelsModel.apply(new SpecificBuilderAdapterOperation(new ModelFeaturesBuilder(features)));
int count = 0;
Model model = modelsModel.create();
AbstractPatternFilterIterator<Feature> i = IteratorFactory.<Feature>descendantOrSelfMatcherIterator().withPattern(ModelsEntityDescriptorEnum.Feature);
i.reset(model);
for (Feature feature : i) if (EntityUtils.isNotResolver(feature))
count++;
assertEquals(features.wSize(), count);
}
Aggregations