Esempio n. 1
0
 public <E extends IEntity> E wGetAdapter(EntityDescriptor<E> ed) {
   //    	if (ed.isAssignableFrom(wGetEntityDescriptor()))
   //    		return (E) this;
   //    	else
   return CommonsEntityAdapterFactory.create(ed, this);
   // throw new IllegalStateException(WholeMessages.null_model);
 }
Esempio n. 2
0
 private static IEntity createPattern(IEntity child) {
   IEntity pattern = EntityUtils.clone(child);
   EntityDescriptor<?> ed = pattern.wGetEntityDescriptor();
   for (FeatureDescriptor fd : ed.getEntityFeatureDescriptors()) {
     if (!name.equals(fd))
       pattern.wSet(
           fd, CommonsEntityAdapterFactory.createVariable(fd.getEntityDescriptor(), fd.getName()));
   }
   return pattern;
 }
  protected void addMissingVariables(IEntity contextModel, MissingVariableException e) {
    String[] varNames = e.getVariableNames();
    EnvironmentEntityFactory ef = EnvironmentEntityFactory.instance;

    for (String varName : varNames) {
      Name var = ef.createName(varName);
      IEntity find = Matcher.find(var, contextModel, false);
      if (find == null)
        contextModel.wAdd(
            ef.createBinding(
                var,
                CommonsEntityAdapterFactory.createResolver(EnvironmentEntityDescriptorEnum.Value)));
    }
  }
  protected FilterFamily getFilterFamily(TestSuite suite) {
    FilterFamilies filterFamilies = suite.getFilterFamilies();
    FilterFamily filterFamily = null;
    for (int i = 0; i < filterFamilies.wSize(); i++) {
      FilterFamily child = (FilterFamily) filterFamilies.wGet(i);
      if (EntityUtils.isNotResolver(child)
          && GENERATED_FAMILY_NAME.equals(child.getName().getValue())) {
        filterFamily = child;
        break;
      }
    }

    TestsEntityFactory tef = TestsEntityFactory.instance;
    if (filterFamily == null) {
      filterFamily =
          tef.createFilterFamily(
              CommonsEntityAdapterFactory.createResolver(TestsEntityDescriptorEnum.PackageName),
              tef.createDescription("Auto-generated filter family"),
              tef.createName(GENERATED_FAMILY_NAME),
              tef.createFilterRules(0));
    }
    return filterFamily;
  }