All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.staf.TestJSTAF Maven / Gradle / Ivy

Go to download

The Software Testing Automation Framework (STAF) is an open source, multi-platform, multi-language framework designed around the idea of reusable components, called services (such as process invocation, resource management, logging, and monitoring). STAF removes the tedium of building an automation infrastructure, thus enabling you to focus on building your automation solution. The STAF framework provides the foundation upon which to build higher level solutions, and provides a pluggable approach supported across a large variety of platforms and languages. This component contains the STAF Java API (http://staf.sourceforge.net/current/STAFJava.htm ) only. For more information see http://staf.sourceforge.net/ .

The newest version!
/*****************************************************************************/
/* Software Testing Automation Framework (STAF)                              */
/* (C) Copyright IBM Corp. 2007                                              */
/*                                                                           */
/* This software is licensed under the Eclipse Public License (EPL) V1.0.    */
/*****************************************************************************/

package com.ibm.staf;

public class TestJSTAF
{
    public static void main(String[] args)
    {
        if (args.length < 3)
        {
            System.out.println("Usage: java com.ibm.staf.TestJSTAF    ");
            System.exit(1);
        }

        String where = args[0];
        String service = args[1];
        String request = "";

        for (int i = 2; i < args.length; i++)
        {
            request += args[i] + " ";
        }
        
        request = request.trim();

        STAFHandle handle = null;

        try
        {
            handle = new STAFHandle("TestJSTAF");
        }
        catch(STAFException e)
        {
            e.printStackTrace();
            System.exit(1);
        }

        System.out.println("TestJSTAF using STAF handle " + handle.getHandle());

        STAFResult result = handle.submit2(where, service, request);

        System.out.println("RC=" + result.rc);

        if (STAFMarshallingContext.isMarshalledData(result.result))
        {
            System.out.println("Result=");
            System.out.println(STAFMarshallingContext.unmarshall(result.result));
        }
        else
        {
            System.out.println("Result=" + result.result);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy