<%@page contentType="text/html;charset=UTF-8" pageEncoding="ISO-8859-1" session="true"
%><%@page errorPage="Exception.jsp"
%><%@page import="com.fujitsu.iflow.model.bpm.BPMSession"
%><%@page import="com.fujitsu.iflow.model.bpmcore.BPMSessionImpl"
%><%@page import="com.fujitsu.iflow.model.workflow.Filter"
%><%@page import="com.fujitsu.iflow.model.workflow.Plan"
%><%@page import="com.fujitsu.iflow.model.workflow.ProcessInstance"
%><%@page import="com.fujitsu.iflow.model.workflow.WFObjectList"
%><%@page import="com.fujitsu.iflow.model.workflow.WFObjectFactory"
%><%@page import="com.fujitsu.iflow.model.util.QuickForm"
%><%@page import="com.fujitsu.iflow.server.dataobjects.FilterEnum"
%><%@page import="com.fujitsu.iflow.server.dataobjects.ProcessInstanceStatesEnum"
%><%@page import="java.io.Writer"
%><%@page import="java.text.SimpleDateFormat"
%><%@page import="java.util.Date"
%><%@page import="java.util.Enumeration"
%><%@page import="java.util.Hashtable"
%><%

    request.setCharacterEncoding("UTF-8");request.getParameterNames(); //Need dummy call for WL9.1
    BPMSession bps = (BPMSession) session.getAttribute("BPMSession");
    if (bps == null) {
        %><jsp:include page="PasswordPanel.jsp" flush="true"/><%
        return;
    }

    int _pageSize = 20;
    int selIdValue=1;
    SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yy  hh:mm z");
    session.removeAttribute("Forms");

    ProcessInstance[] procInsts = null;
    String curActive = "My Active Processes";

    String[] bcolor = {"evenrow","oddrow"};
    int nextColor = 0;
    String rowColor = bcolor[nextColor];

    String testDir = (String) session.getAttribute("testDir");
    if (testDir==null) {
        testDir = session.getServletContext().getRealPath("").replace('\\','/')+"/test/";
        session.setAttribute("testDir", testDir);
    }
    String className = (String) session.getAttribute("className");
    if (className==null) {
        className = "com.fujitsu.iflowqa.testframe.UTF8Test";
        session.setAttribute("className", className);
    }
    String param0 = (String) session.getAttribute("param0");
    if (param0==null) {
        param0 = "";
        session.setAttribute("param0", param0);
    }
    String param1 = (String) session.getAttribute("param1");
    if (param1==null) {
        param1 = "";
        session.setAttribute("param1", param1);
    }
    String param2 = (String) session.getAttribute("param2");
    if (param2==null) {
        param2 = "";
        session.setAttribute("param2", param2);
    }
    String testList = (String) session.getAttribute("testList");
    if (testList==null) {
        testList = "";
        session.setAttribute("testList", testList);
    }

%>
<html>
<head>
<title>Run Test</title>
<jsp:include page="StyleSheet.jsp" flush="true"/>
<script language="javascript" src="styles/clockscripts.js"></script>
</head>

<body class="bodyClass">


<jsp:include page="Header.jsp" flush="true"/><br>
<table width="100%" border="0" cellpadding="5" cellspacing="5">
    <tr>
      <td><font size="-2">
         TestFrame tests are Java classes used for testing the integrity of the running system.
         This functionality is only useful for diagnostic purposes, and has no production value.
         The tests will often create process definitions or instances which are left behind
         in the system, and must be cleaned up manually.
         Please use caution when using this capability.
      </font></td>
    </tr>
</table>

<form action="RunTestResult.jsp" method="get">
<table>
    <tr><td>
         </td><td><b>To call a test directly, enter the class and parameters here:</b>
    </td></tr><tr><td>
         Test Directory: </td><td><input type="text" name="testDir" size="70"
                          value="<%=testDir%>">
    </td></tr><tr><td>
         Test Class Name: </td><td><input type="text" name="className" size="70"
                          value="<%=className%>">
    </td></tr><tr><td>
         Parameter 0: </td><td><input type="text" name="param0" size="70"
                          value="<%=param0%>">
    </td></tr><tr><td>
         Parameter 1: </td><td><input type="text" name="param1" size="70"
                          value="<%=param1%>">
    </td></tr><tr><td>
         Parameter 2: </td><td><input type="text" name="param2" size="70"
                          value="<%=param2%>">
    </td></tr><tr><td>
         </td><td><input type="submit" name="Run Test" value="Run Test">
    </td></tr>
  </table>
</form>


<form action="RunTestList.jsp" method="get">
<table>
    <tr><td>
         </td><td><b>To read a test list, and pick a test, enter here:</b>
    </td></tr><tr><td>
         Test Directory: </td><td><input type="text" name="testDir" size="70"
                          value="<%=testDir%>">
    </td></tr><tr><td>
         Test List: </td><td><input type="text" name="testList" size="70"
                          value="<%=testList%>">
    </td></tr><tr><td>
         </td><td><input type="submit" name="List Options" value="List Options">
    </td></tr>
  </table>
</form>

<form action="RunTestFlowPath.jsp" method="get">
<table>
    <tr><td>
         </td><td><b>To search for and run FlowPath Tests:</b>
    </td></tr><tr><td>
         Test Directory: </td><td><input type="text" name="testDir" size="70"
                          value="<%=testDir%>">
    </td></tr><tr><td>
         Subdirectory: </td><td><input type="text" name="pathPart" size="70"
                          value="FlowPath">
    </td></tr><tr><td>
         Test Type: </td><td><input type="radio" name="testType" size="70"
                          value="nonvoting" checked>Non Voting
                          <input type="radio" name="testType" size="70"
                          value="voting">Voting
    </td></tr><tr><td>
         Exclude File: </td><td><input type="text" name="excludeFile" size="70"
                          value="excludeList.txt">
    </td></tr><tr><td>
         </td><td><input type="submit" name="List Flow Path Files" value="Search for Flow Path Files">
    </td></tr>
  </table>
</form>


</body>
</html>
