Package qat.gui

Examples of qat.gui.TestSpecification


    }
 
    private void sendRunThis(String tag, PrintStream ps) throws IOException {
  tag = tag.substring(tag.indexOf("RUNTHIS@")+8,tag.length());
  tag = URLDecoder.decode(tag,ENCODING);
  TestSpecification test = getParent().getTestTree().getTestSpecification(tag);
  if (test!=null) {
      if (!getParent().isTestRunning()) {
    getParent().runSingleTest(test);
    writeH1(ps,Resources.getString("running"));
    okResponse(ps);
View Full Code Here


 
    private void sendTestDetail(String tag, PrintStream ps) throws IOException {
  ArrayList data, titles;
  tag = tag.substring(tag.indexOf("@")+1,tag.length());
  tag = URLDecoder.decode(tag,ENCODING);
  TestSpecification test = getParent().getTestTree().getTestSpecification(tag);
  String fileName;
  if (test!=null) {   
      writeH1(ps, Resources.getString("testName")+":"+test.getTestName());
      // test name, author & detail table
      titles = new ArrayList();
      data = new ArrayList();
      titles.add(Resources.getString("testDescription"));
      titles.add(Resources.getString("testAuthor"));
      titles.add(Resources.getString("testBugInfo"));
      data.add(test.getTestDescription());
      data.add(test.getTestAuthor());
      data.add(test.getTestBugInfo());
      tabulate("",titles,data,testOutputTableTitleCol,testOutputTableCol,ps);
           
      writeHr(ps);
     
      // "run this" command table
      data.clear();
      fileName = URLEncoder.encode(test.getTestSpecPath(),ENCODING);
      data.add("<A HREF=\"RUNTHIS@"+fileName+"\">"+Resources.getString("runNode")+"</A>");
      simpleTable(data,commandTableCol,data.size(),ps);
      writeHr(ps);
     
      // output command table
      String commandList[] = test.getViewOutputList();
      titles.clear();
      titles.add("Command");
      titles.add(Resources.getString("environment"));
      titles.add(Resources.getString("standardOutput"));
      titles.add(Resources.getString("standardError"));
      data.clear();
      String tempFileName;
      for (int i = 0; i < commandList.length; i++) {
    data.add(commandList[i]);       
    tempFileName = test.getEnvironmentTraceFileName(getParent().getProjectResultsDirectory(),commandList[i]);
    tempFileName = URLEncoder.encode(tempFileName,ENCODING);
    data.add("<A HREF=\""+FILEDETAIL+tempFileName+"\">"+
       commandList[i]+" "+Resources.getString("environment")+"</A>");
    tempFileName = test.getStdOutTraceFileName(getParent().getProjectResultsDirectory(),commandList[i]);
    tempFileName = URLEncoder.encode(tempFileName,ENCODING);
    data.add("<A HREF=\""+FILEDETAIL+tempFileName+"\">"+
       commandList[i]+" "+Resources.getString("standardOutput")+"</A>");
    tempFileName = test.getStdErrTraceFileName(getParent().getProjectResultsDirectory(),commandList[i]);
    tempFileName = URLEncoder.encode(tempFileName,ENCODING);
    data.add("<A HREF=\""+FILEDETAIL+tempFileName+"\">"+
       commandList[i]+" "+Resources.getString("standardError")+"</A>");
      }
      tabulate("",titles,data,testOutputTableTitleCol,testOutputTableCol,ps);
      writeLn(ps);
   
      // parser output table
      titles.clear();
      titles.add(Resources.getString("parserOutput"));
      data.clear();
      data.add(getFileContents(test.getParserTraceFileName(getParent().getProjectResultsDirectory())));
      tabulate("",titles,data,parserOutputTableTitleCol,parserOutputTableCol,ps);
      writeLn(ps);
   
      // properties include table
      titles.clear();
      titles.add(Resources.getString("propIncludes"));
      data.clear();
      String dataA[] = test.getIncludePropList();
      for (int i = 0; i < dataA.length; i++) {
    fileName = URLEncoder.encode(dataA[i],ENCODING);
    data.add("<A HREF=\""+FILEDETAIL+fileName+"\">"+dataA[i]+"</A>");
      }
      tabulate("",titles,data,includesTableTitleCol,includesTableCol,ps);
      writeLn(ps);
   
      // misc include table
      titles.clear();
      titles.add(Resources.getString("miscIncludes"));
      data.clear();
      dataA = test.getIncludeMiscList();
      for (int i = 0; i < dataA.length; i++) {
    fileName = URLEncoder.encode(dataA[i],ENCODING);
    data.add("<A HREF=\""+FILEDETAIL+fileName+"\">"+dataA[i]+"</A>");
      }
      tabulate("",titles,data,includesTableTitleCol,includesTableCol,ps);
      writeLn(ps);
     
   
      // keywords table
      titles.clear();
      titles.add(Resources.getString("keyword"));
      dataA = test.getKeyWords();
      tabulate("",titles,arrayToArrayList(test.getKeyWords()),includesTableTitleCol,includesTableCol,ps);   
      writeLn(ps);
     
      // write the test status
      titles.clear();
      data.clear();
      titles.add(Resources.getString("testStatus"));
      data.add(test.getStatusString());
      //       switch (test.getStatus()) {
      //       case ProtocolConstants.PASSED :
      //         simpleTable(data,passedCol,2,ps);
      //         break;
      //       case ProtocolConstants.FAILED :
View Full Code Here

    }
 
    private void sendTestOverview(PrintStream ps) throws IOException {
  ArrayList tests = getParent().getTestTree().getAllTestsByParent();
  ArrayList testList;
  TestSpecification test;
  String testFileName, nodeTitle, color;
  int projectRootIndex = getParent().getProperty("qat.project.path").length()+1;
   
  for (int j = 0; j < tests.size(); j++) {
      testList = (ArrayList)tests.get(j);
      // set up the node title
      nodeTitle = (String)testList.remove(0);
      nodeTitle = nodeTitle.substring(projectRootIndex,nodeTitle.length());
      
      // add the description field to the ArrayList
      for (int i = testList.size()-1; i >=0; i--) {
    test = ((TestSpecification)testList.get(i));
    switch (test.getStatus()) {
    case ProtocolConstants.PASSED     :
        color = passedCol;
        break;
    case ProtocolConstants.FAILED     :
        color = failedCol;
        break;
    case ProtocolConstants.UNRESOLVED :
        color = unresolvedCol;
        break;
    case ProtocolConstants.NOTRUN     :
        color = notrunCol;
        break;
    case ProtocolConstants.PENDING     :
        color = pendingCol;
        break;
    default :
        color = otherCol;
    }
    if (test.getStatus()==ProtocolConstants.RUNNING) {
        testList.add(i+1,"<b><blink><font color =\""+color+"\">"+test.getStatusString()+"</font></blink></b>");
    }
    else {
        testList.add(i+1,"<b><font color =\""+color+"\">"+test.getStatusString()+"</font></b>");
    }
    testList.add(i+1,test.getTestDescription());
      }

      // replace the TestSpecification by a link to the test detail.
      for (int i = 0; i < testList.size(); i+=3) {
    test = (TestSpecification)testList.get(i);
    testFileName = URLEncoder.encode(test.getTestSpecPath(),ENCODING);
    testList.set(i,"<A HREF=\""+TESTDETAIL+testFileName+"\">"+test.getTestName()+"</A>");
      }
      // create the table titles
      ArrayList titles = new ArrayList();
      titles.add(nodeTitle);
      titles.add(Resources.getString("testDescription"));
View Full Code Here

  }
 
 
  private void editSelectedFile() {
    try {
      TestSpecification test = qat.getSelectedTest();
      new  Notepad(test.getTestSpecPath(),
             null,
             false);
    }
    catch(java.lang.IndexOutOfBoundsException ex) {
      JOptionPane.showMessageDialog(null, "No files are selected!", "Error", JOptionPane.ERROR_MESSAGE);
View Full Code Here

TOP

Related Classes of qat.gui.TestSpecification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.