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

📄 jstatic.java

📁 Software Testing Automation Framework (STAF)的开发代码
💻 JAVA
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF)                              *//* (C) Copyright IBM Corp. 2001                                              *//*                                                                           *//* This software is licensed under the Common Public License (CPL) V1.0.     *//*****************************************************************************/import com.ibm.staf.*;public class JStatic{    // This is the main command line entry point    public static void main(String [] argv)    {        // Verify the command line arguments        if (argv.length != 0)        {            System.out.println();            System.out.println("Usage: java JStatic");            System.exit(1);        }        // Register with STAF        try        {            handle = new STAFHandle("Queue_Class_Test");        }        catch (STAFException e)        {            System.out.println("Error registering with STAF, RC: " + e.rc);            System.exit(1);        }        STAFResult staticResult = handle.submit2("local", "handle",                                                 "create handle name JStatic");        if (staticResult.rc != 0)        {            System.out.println("Error creating static handle, RC: " +                               staticResult.rc);            if (staticResult.result.length() != 0)                System.out.println("Additional info: " + staticResult.result);            System.exit(1);        }        System.out.println("Successfully created static handle: " +                           staticResult.result);        try        {            staticHandle = new STAFHandle(Integer.parseInt(staticResult.result));        }        catch (NumberFormatException e)        {            System.out.println("Invalid static handle received from STAF: " +                               staticResult.result);            System.exit(1);        }        System.out.println("Successfully created Java STAFHandle for static " +                           "handle");        System.out.println("Attempting PING request via static handle");        STAFResult pingResult = staticHandle.submit2("local", "ping", "ping");        System.out.println("Expected RC    : 0");        System.out.println("Actual RC      : " + pingResult.rc);        System.out.println("Expected Result: PONG");        System.out.println("Actual Result  : " + pingResult.result);        staticResult = handle.submit2("local", "handle", "delete handle " +                                      staticResult.result);        if (staticResult.rc != 0)        {            System.out.println("Error deleting static handle, RC: " +                               staticResult.rc);            if (staticResult.result.length() != 0)                System.out.println("Additional info: " + staticResult.result);            System.exit(1);        }        System.out.println("Successfully deleted static handle: " +                           staticHandle.getHandle());    }    private static STAFHandle handle;    private static STAFHandle staticHandle;}

⌨️ 快捷键说明

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