⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 staxjobaction.java

📁 Software Testing Automation Framework (STAF)的开发代码
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
                evalAttr = "logtcnumstarts";                if (fUnevalLogTCNumStarts.equals(""))                {                    // Default to parent job's option if not specified                    fLogTCNumStarts =                        thread.getJob().getLogTCNumStartsAsString();                }                else                {                    fLogTCNumStarts =                        thread.pyStringEval(fUnevalLogTCNumStarts);                    if (fLogTCNumStarts.equalsIgnoreCase("parent"))                    {                        fLogTCNumStarts =                            thread.getJob().getLogTCNumStartsAsString();                    }                    else if (fLogTCNumStarts.equalsIgnoreCase("default"))                    {                        fLogTCNumStarts = thread.getJob().getSTAX().                                          getLogTCNumStartsAsString();                    }                    else if (fLogTCNumStarts.equalsIgnoreCase("Enabled") ||                             fLogTCNumStarts.equalsIgnoreCase("Disabled"))                    {                        // Do nothing - already set to Enabled or Disabled                    }                    else if (thread.pyBoolEval(fUnevalLogTCNumStarts))                    {                        fLogTCNumStarts = "Enabled";                    }                    else                    {                        fLogTCNumStarts = "Disabled";                    }                }                request.append(" logtcnumstarts ").append(fLogTCNumStarts);                // Evaluate the logtcstartstop attribute                evalElem = "job";                evalAttr = "logtcstartstop";                if (fUnevalLogTCStartStop.equals(""))                {                    // Default to parent job's option if not specified                    fLogTCStartStop =                        thread.getJob().getLogTCStartStopAsString();                }                else                {                    fLogTCStartStop =                        thread.pyStringEval(fUnevalLogTCStartStop);                    if (fLogTCStartStop.equalsIgnoreCase("parent"))                    {                        fLogTCStartStop =                            thread.getJob().getLogTCStartStopAsString();                    }                    else if (fLogTCStartStop.equalsIgnoreCase("default"))                    {                        fLogTCStartStop = thread.getJob().getSTAX().                                          getLogTCStartStopAsString();                    }                    else if (fLogTCStartStop.equalsIgnoreCase("Enabled") ||                             fLogTCStartStop.equalsIgnoreCase("Disabled"))                    {                        // Do nothing - already set to Enabled or Disabled                    }                    else if (thread.pyBoolEval(fUnevalLogTCStartStop))                    {                        fLogTCStartStop = "Enabled";                    }                    else                    {                        fLogTCStartStop = "Disabled";                    }                }                request.append(" logtcstartstop ").append(fLogTCStartStop);                // Evaluate the job-function element                if (!fUnevalFunction.equals(""))                {                    evalElem = "job-function";                    evalAttr = "if";                    if (thread.pyBoolEval(fFunctionIf))                    {                        fFunction = thread.pyStringEval(fUnevalFunction);                        request.append(" function ").append(                            STAFUtil.wrapData(fFunction));                    }                }                // Evaluate the job-function-args element                if (!fUnevalFunctionArgs.equals(""))                {                    evalElem = "job-function-args";                    evalAttr = "if";                    if (thread.pyBoolEval(fFunctionArgsIf))                    {                        if (thread.pyBoolEval(fFunctionArgsEval))                        {                            evalAttr = "";                            fFunctionArgs =                                thread.pyStringEval(fUnevalFunctionArgs);                        }                        request.append(" args ").append(                            STAFUtil.wrapData(fFunctionArgs));                    }                }                // Evaluate the job-script elements                evalElem = "job-script";                for (int i = 0; i < fUnevalScripts.size(); i++)                {                    evalAttr = "if";                    String scriptsIf = thread.pyStringEval(                        (String)fScriptsIf.elementAt(i));                    if (thread.pyBoolEval(scriptsIf))                    {                        evalAttr = "eval";                        String script = new String();                        if (thread.pyBoolEval(                            (String)fScriptsEval.elementAt(i)))                        {                            evalAttr = "";                            script = thread.pyStringEval(                                (String)fUnevalScripts.elementAt(i));                            fScripts.add(script);                        }                        else                        {                            script = (String)fUnevalScripts.elementAt(i);                            fScripts.add(script);                        }                        request.append(" script ").append(                            STAFUtil.wrapData(script));                    }                }                // Evaluate the job-scriptfile elements                if (!fUnevalScriptFiles.equals(""))                {                    evalElem = "job-scriptfile";                    evalAttr = "if";                    if (thread.pyBoolEval(fScriptFilesIf))                    {                        evalAttr = "";                        // Evaluate as a list; each item in the list is a                        // single scriptfile.                        List scriptFileList =                            thread.pyListEval(fUnevalScriptFiles);                        for (int j = 0; j < scriptFileList.size(); j++)                        {                            String scriptFile =                                ((Object)scriptFileList.get(j)).toString();                            fScriptFiles.add(scriptFile);                            request.append(" scriptfile ").append(                                       STAFUtil.wrapData(scriptFile));                        }                        if (!fUnevalScriptFilesMachine.equals(""))                        {                            evalAttr = "machine";                            fScriptFilesMachine =                                thread.pyStringEval(fUnevalScriptFilesMachine);                            request.append(" scriptfilemachine ").append(                                       STAFUtil.wrapData(fScriptFilesMachine));                        }                    }                }                // Evaluate the job-action element                if (fJobAction != null)                {                    evalElem = "job-action";                    evalAttr = "if";                    fJobActionFlag = thread.pyBoolEval(fJobActionIf);                }            }            catch (STAXPythonEvaluationException e)            {                fState = COMPLETE;                fThread.popAction();                String msg = "<job";                if (!fUnevalName.equals(""))                    msg += " name=\"" + fUnevalName + "\"> with ";                else                    msg += "> with ";                if (!fUnevalJobFile.equals(""))                    msg += "job-file " + fUnevalJobFile + "\n\n";                else                    msg += "job-data " + fUnevalJobData + "\n\n";                if (evalElem == "job")                {                    if (evalAttr.equals("name"))                        msg += "Job 'name' attribute in error";                    else if (evalAttr.equals("clearlogs"))                        msg += "Job 'clearlogs' attribute in error";                    else if (evalAttr.equals("monitor"))                        msg += "Job 'monitor' attribute in error";                    else if (evalAttr.equals("logtcelapsedtime"))                        msg += "Job 'logtcelapsedtime' attribute in error";                    else if (evalAttr.equals("logtcnumstarts"))                        msg += "Job 'logtcnumstarts' attribute in error";                    else if (evalAttr.equals("logtcstartstop"))                        msg += "Job 'logtcstartstop' attribute in error";                }                else                {                    if (!evalAttr.equals(""))                        msg += "Attribute " + evalAttr +                               " for job sub-element in error: <" + evalElem +                               ">";                    else                        msg += "Job sub-element in error: <" + evalElem + ">";                }                                fThread.setSignalMsgVar("STAXPythonEvalMsg", msg, e);                fThread.raiseSignal("STAXPythonEvaluationError");                return;            }            fRequest = request.toString();            // Create request info structure for STAX EXECUTE request            String staxMachineName =                fThread.getJob().getSTAX().getLocalMachineName();            String staxServiceName =                fThread.getJob().getSTAX().getServiceName();            fState = WAIT_SUBJOB;            // Get value for DiagEnabled needed for            // Submit STAX EXECUTE Command            STAXSubmitResult res = fThread.getJob().getSTAX().execute(                new STAFServiceInterfaceLevel30.RequestInfo(                    "",  // XXX: Default UUID to what?                    staxMachineName, staxMachineName,                    "STAF/Service/" + staxServiceName, 1, 5, true,                    0,  // XXX: diagEnabled flag is not available                    fRequest,                    0,    // XXX: requestNumber field is not available                    "none://anonymous",// Default user to "none://anonymous"                    "local://local",  // Default endpoint to "local://local"                    "local"           // Default physicalInterfaceID to "local"                    ), this);            fSubmitRC = res.getResult().rc;            fSubmitResult = res.getResult().result;            fSubJob = res.getJob();            fThread.pySetVar("RC", new Integer(fSubmitRC));            fThread.pySetVar("STAFResult", fSubmitResult);            if (fSubmitRC == 0)            {                fJobID = (new Integer(fSubmitResult)).intValue();                fThread.pySetVar("STAXSubJobID", fSubmitResult);                // Set actual starting function and function args                setStartFunction(fSubJob.getStartFunction());                setStartFuncArgs(fSubJob.getStartFuncArgs());                if ((fJobAction != null) && fJobActionFlag)                {                    // Start action specified by <job-action> element                    synchronized (fThreadMap)                    {                        STAXThread childThread = fThread.createChildThread();                        fThreadMap.put(new                            Integer(childThread.getThreadNumber()),                            childThread);                        STAXAction childThreadAction = fJobAction;                        childThread.addCompletionNotifiee(this);                        childThread.pushAction(                            childThreadAction.cloneAction());                        childThread.schedule();                    }                }            }            else            {                // STAX EXECUTE Request failed                fState = COMPLETE;                fThread.popAction();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -