private void verifyJavaExport(MWRelationalProject project) throws Exception {
   this.configureDeploymentLogin(project);
   project.setProjectSourceDirectoryName(this.tempDir.getPath());
   project.setProjectSourceClassName(this.className(project));
   project.exportProjectSource();
   this.compileAndCheckJavaExport(project);
 }
  private void verifyJavaExport(MWRelationalProject project) throws Exception {
    this.configureDeploymentLogin(project);
    // write the project first, so it can be read via the command-line
    project.setSaveDirectory(this.tempDir);
    new ProjectIOManager().write(project);

    project.setProjectSourceDirectoryName(this.tempDir.getPath());
    project.setProjectSourceClassName(this.className(project));

    List classpathEntries = new ArrayList();
    classpathEntries.add(this.tempDir.getAbsolutePath());
    classpathEntries.add(Classpath.locationFor(MWProject.class)); // elmwcore.jar
    classpathEntries.add(Classpath.locationFor(JavaSourceGenerator.class)); // eclipselinkmw.jar
    classpathEntries.add(Classpath.locationFor(ValueHolderInterface.class)); // ecilpselink.jar
    classpathEntries.add(Classpath.locationFor(XMLParserConfiguration.class)); // xercesImpl.jar
    classpathEntries.add(
        FileTools.resourceFile("/platforms.dpr").getParentFile().getAbsolutePath()); // config dir
    Classpath classpath = new Classpath(classpathEntries);

    String input = project.saveFile().getAbsolutePath();
    String output = project.projectSourceFile().getAbsolutePath();
    //		String log = new File(this.tempDir, "JavaSourceGenerator.log").getAbsolutePath();
    String[] args = new String[] {input, output};

    JavaTools.java(JavaSourceGenerator.class.getName(), classpath.path(), args);
    //		JavaSourceGenerator.main(args);

    this.compileAndCheckJavaExport(project);
  }
コード例 #3
0
 private MWRelationalProject buildProject() {
   MWRelationalProject result =
       new MWRelationalProject(
           this.getClass().getName(), MappingsModelTestTools.buildSPIManager(), null);
   Classpath cp = Classpath.javaClasspath();
   Classpath.Entry[] entries = cp.getEntries();
   for (int i = 0; i < entries.length; i++) {
     result.getRepository().addClasspathEntry(entries[i].fileName());
   }
   return result;
 }
コード例 #4
0
  public static MWRelationalProject emptyProject() {
    MWRelationalProject project =
        new MWRelationalProject("ComplexInheritance", spiManager(), oraclePlatform());

    // Defaults policy
    project.getDefaultsPolicy().getCachingPolicy().setCacheSize(100);
    project
        .getDefaultsPolicy()
        .getCachingPolicy()
        .setCacheType(MWCachingPolicy.CACHE_TYPE_WEAK_WITH_SOFT_SUBCACHE);
    project.getDefaultsPolicy().setMethodAccessing(false);

    return project;
  }