コード例 #1
0
  boolean defineAllTestcases(String root, String server) {
    ClientTest.root = root;
    ClientTest.server = server;
    File testpath = new File(root + "/" + TESTINPUTDIR);
    File basepath = new File(root + "/" + BASELINEDIR);
    if (!basepath.exists() || !basepath.isDirectory() || !basepath.canRead())
      return report("Base directory not readable: " + basepath.toString());
    if (!testpath.exists() || !testpath.isDirectory() || !testpath.canRead())
      return report("Test directory not readable: " + testpath.toString());
    // Generate the testcases from the located .dmr files
    // This assumes that the set of files and the set of
    // files thru the sourceurl are the same
    File[] filelist = testpath.listFiles(new TestFilter(DEBUG));
    for (int i = 0; i < filelist.length; i++) {
      File file = filelist[i];
      // remove the extension
      String name = file.getName();
      if (name == null) continue;
      int index = name.lastIndexOf("." + TESTEXTENSION);
      assert (index > 0);
      name = name.substring(0, index);
      if (!isDisabledTest(name)) {
        ClientTest ct = new ClientTest(name, true, isXfailTest(name));
        this.alltestcases.add(ct);
      }
    }

    return true;
  }
コード例 #2
0
 public boolean accept(File file) {
   boolean ok = false;
   if (file.isFile() && file.canRead()) {
     // Check for proper extension
     String name = file.getName();
     if (name != null && name.endsWith(TESTEXTENSION)) ok = true;
   }
   if (!ok && debug) {
     report("Ignoring: " + file.toString());
   }
   return ok;
 }