Example #1
0
  private void checkLibrary(Library library) {
    File libFile = new File(getDestinationFolder(), library.getName());
    TestUtil.assertPersistableAST(
        QvtOperationalStdLibrary.INSTANCE.getStdLibModule(),
        URI.createURI(libFile.toURI().toString(), true)); // $NON-NLS-1$

    assertTrue(
        "library file " + libFile + " must have been saved", libFile.exists()); // $NON-NLS-1$	
  }
    static StringCounter getInstance(QvtOperationalEvaluationEnv env) {
      env.getThisOfType(QvtOperationalStdLibrary.INSTANCE.getStdLibModule());
      // FIXME - this way we have String counters in global only, should be done
      // per Stdlib instance (every aggregated transformation)
      StringCounter counters = (StringCounter) env.getContext().getSessionData().getValue(DATA_KEY);
      if (counters == null) {
        counters = new StringCounter();
        env.getContext().getSessionData().setValue(DATA_KEY, counters);
      }

      return counters;
    }
Example #3
0
  @Override
  public void runTest() throws Exception {
    super.runTest();

    checkLibrary((Library) QvtOperationalStdLibrary.INSTANCE.getStdLibModule());
    EList<ModuleImport> moduleImports =
        getCompiledResults()[0].getModules().get(0).getModuleImport();
    assertEquals(moduleImports.size(), 2);

    for (ModuleImport nextImport : moduleImports) {
      checkLibrary((Library) nextImport.getImportedModule());
    }
  }
  @Override
  public EObject create(EClass class_) {
    // return super.create(class_);

    if (myClassifierInitializations.get(class_) == null) {
      cacheClassifierInitExp(class_);
    }

    if (EmfUtil.isAssignableFrom(QvtOperationalStdLibrary.INSTANCE.getExceptionClass(), class_)) {
      return new ExceptionClassInstance(class_);
    } else {
      return new IntermediateClassInstance(class_);
    }
  }