Package qat.parser

Examples of qat.parser.AgentInstance


 
  // -- remote
  int agentCount = Integer.parseInt(getProperty(Common.AGENT_COUNT,"0"));
  for (int i = 1; i <= agentCount; i++) {
      try {
    AgentInstance agent = new AgentInstance(getProperty("agent"+i+".host"),
              Integer.parseInt(getProperty("agent"+i+".port")),
              ".",
              inEvaluationMode());
    String statusCode = agent.EXEC_CLASS(classLoader, className);
    setProperty("0",statusCode);
   
    // now print out a message if the status was timed out
    int value = Integer.parseInt(statusCode);
    if (value == qat.agent.ExecProcess.TIMEDOUT_STATE) {
View Full Code Here


        // check that this agentID is unused
        if (agentMap.get(agentid)!=null) {
          throw new Exception("agent identifier already exists :"+agentid.toString());
        }
        AgentInstance agentInstance =  new AgentInstance(agenthost.toString(),
            new Integer(agentport.toString()).intValue(),
            agentworkdir.toString(),
            inEvaluationMode());
        agentMap.put(agentid.toString(),agentInstance);
      }
View Full Code Here

      StringBuffer agentid = resolveVariable(getAttribute(attributes,"agentid"));
      if (onlyIf(attributes)) {
        printStream.println("releasing agent "+agentid);
        setStatusText(releaseAgentNode.getNodeName()+" "+agentid);

        AgentInstance agentInstance = (AgentInstance)agentMap.get(agentid.toString()); // remove also returns the object it deleted
        if (agentInstance==null)
          throw new Exception("unknown agentid "+agentid);
        try {
          agentInstance.DELAGENT();
        }
        catch (Exception ex) {
          printError(RELEASEAGENT_NODE,"error cleaning up agent "+agentid+"("+ex.toString()+") :");
        }
        finally {
View Full Code Here

      StringBuffer agentid      = resolveVariable(getAttribute(attributes,"agentid"));
      StringBuffer zipfile      = resolveVariable(getAttribute(attributes,"zipfile"));
      if (onlyIf(attributes)) {
        setStatusText(sendzipNode.getNodeName()+" "+agentid);
        printStream.println(sendzipNode.getNodeName()+" "+zipfile+" to agent "+agentid);
        AgentInstance agentInstance = (AgentInstance)agentMap.get(agentid.toString());
        if (agentInstance==null)
          throw new Exception("unknown agentid "+agentid);
        // send the zip file, and retrieve the associated zip ID
        try {
          properties.setProperty(agentid.toString()+zipfile.toString(),
              agentInstance.ZIPSEND(zipfile.toString(),agentid.toString()+zipfile.toString()));
        }
        catch (Exception ex) {
          printError(SENDZIP_NODE,"problem sending zip file to agent ("+ex.toString()+")");
        }
      }
View Full Code Here

      StringBuffer agentid      = resolveVariable(getAttribute(attributes,"agentid"));
      StringBuffer zipfile      = resolveVariable(getAttribute(attributes,"zipfile"));
      if (onlyIf(attributes)) {
        setStatusText(cleanzipNode.getNodeName()+" "+agentid);
        printStream.println(cleanzipNode.getNodeName()+" from agent "+agentid);
        AgentInstance agentInstance = (AgentInstance)agentMap.get(agentid.toString());
        if (agentInstance==null)
          throw new Exception("unknown agentid "+agentid);
        agentInstance.ZIPCLEAN(agentid.toString()+zipfile.toString());
        properties.remove(agentid.toString()+zipfile.toString());
      }
      else {
        printStream.println("cleanzip cancelled (onlyif false)");
      }
View Full Code Here

        cmdArray[0] = command.toString();
        int i  = 1;
        while(tokens.hasMoreTokens()) {
          cmdArray[i++] = tokens.nextToken();
        }
        AgentInstance agentInstance = (AgentInstance)agentMap.get(agentid.toString());
        if (agentInstance==null)
          throw new Exception("unknown agentid "+agentid);
        properties.setProperty(processid.toString(),
            agentInstance.CMDSTART(cmdArray, timeout.toString()));
      }
      else {
        printStream.println("start cancelled (onlyif false)");
      }
    }
View Full Code Here

        StringBuffer processidname = getAttribute(attributes, "processid");
        StringBuffer processid = resolveVariable(processidname);    processidname = QAXMLExpression.removeVariableBraces(processidname);
        processidname = resolveVariable(processidname);
        StringBuffer result    = resolveVariable(getAttribute(attributes, "status"));
        setStatusText(statusNode.getNodeName()+" "+processidname.toString()+" "+result.toString());
        printStream.println(statusNode.getNodeName()+" "+processidname.toString()+" "+result.toString());    AgentInstance agentInstance = getAgentRunningProcess(processid);

        if (agentInstance==null)
          throw new Exception("unknown processid "+processidname);

        String statusCode = agentInstance.CMDSTATUS(processid.toString());
        if (Integer.parseInt(statusCode)==0)
          properties.setProperty(result.toString(),"passed");
        else
          properties.setProperty(result.toString(),"failed");
View Full Code Here

        StringBuffer processid = resolveVariable(processidname);
        processidname = QAXMLExpression.removeVariableBraces(processidname);
        processidname = resolveVariable(processidname);
        setStatusText(traceNode.getNodeName()+" "+processidname.toString());
        printStream.println(traceNode.getNodeName()+" "+processidname.toString());
        AgentInstance agentInstance = getAgentRunningProcess(processid);

        if (agentInstance==null)
          throw new Exception("unknown processid "+processid);
        agentInstance.CMDGETTRACE(processid.toString(),
            projectResultsDir+File.separator+
            Common.getUniqueTestIdentifier(testPath)+"_"+processidname.toString());
        addToPropertiesList(INTERNAL_TRACE_LIST,processidname.toString());
      }
      else {
View Full Code Here

    try {
      org.w3c.dom.NamedNodeMap attributes = cleanNode.getAttributes();
      if (onlyIf(attributes)) {
        StringBuffer processidname = getAttribute(attributes, "processid");
        StringBuffer processid = resolveVariable(processidname);    processidname = QAXMLExpression.removeVariableBraces(processidname);    setStatusText(cleanNode.getNodeName()+" "+resolveVariable(processidname).toString());
        printStream.println(cleanNode.getNodeName()+" "+resolveVariable(processidname).toString());    AgentInstance agentInstance = getAgentRunningProcess(processid);

        if (agentInstance==null)
          throw new Exception("Unknown processID :"+processid.toString());
        agentInstance.CMDCLEAN(processid.toString());
        properties.remove(processidname.toString());
      }
      else {
        printStream.println("trace cancelled (onlyif false)");
      }
View Full Code Here

   * Looks through currently running agents for an identifier matching processID.
   * Returns the matching AgentInstance, or null if it wasn't found.
   */
  private AgentInstance getAgentRunningProcess(StringBuffer processid) {
    try {
      AgentInstance agentInstance;
      for (Iterator<String> e = agentMap.keySet().iterator() ; e.hasNext() ;) {
        agentInstance = (AgentInstance)agentMap.get(e.next());
        if (agentInstance.isHandlingProcess(processid.toString())) {
          return agentInstance;
        }
      }
    }
    catch(Exception e) {
View Full Code Here

TOP

Related Classes of qat.parser.AgentInstance

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.