Explore Java demos

This topic provides information about how to view the Ghost Client Java demos provided with the installation.

About this task

The procedure in this topic shows you how to use the Java demos provided with the Ghost Client installation to run integrity tests on the gwc-demo applications via the Ghost Client.

Before you begin:
  • Make sure that the directory where your GGC package is installed has the following samples included in its /samples/java directory:
    • One SessionManager implementation named IntegrityTestsSessionManager.java that will manage the testing session
    • One Scenario implementation named GenericScenario.java that will instantiate real scenarios depending on the application launched by the GAS
    • Several simple Scenario implementations that will be invoked through the GenericScenario
  • Make sure your environment is configured to run Java and the GGC, see Configure your environment for Ghost Client.
  • If you are using the GAS:
    • Make sure your GAS version is at least version 2.50.34 or greater.
    • Make sure that the standalone dispatcher httpdispatch see Dispatcher: httpdispatch is started and that you can access the GAS demos welcome page, http://localhost:6394/demos.html, from your browser.
  1. To run the test simulating a GDC 2.50 over HTTP client, type the command as shown below:

    java com.fourjs.ggc.Launcher -u http://localhost:6394/ja/r/gwc-demo -s com.fourjs.ggc.testcases.IntegrityTestsSessionManager

    Below is sample output logged by the GGC to the console during the running of integrity tests for CustomerOrderScenario.
    ...
    [INFO] (tid:18) 12:5:26:926 GenericScenario.java:57              > GenericScenario: ApplicationName=CustOrders / remainingScenario=null,null,null,fglp
    ed,CustOrders,
    [INFO] (tid:18) 12:5:26:927 GenericScenario.java:62              > GenericScenario: ApplicationName=[CustOrders] started.
    [INFO] (tid:18) 12:5:26:927 CustomerOrderScenario.java:41        > CustomerOrderScenario: started.
    [INFO] (tid:18) 12:5:27:40 CustomerOrderScenario.java:67         > CustomerOrderScenario: Creating a new customer ...
    [INFO] (tid:18) 12:5:27:101 CustomerOrderScenario.java:93        > CustomerOrderScenario: Searching a given customer (with cust_id=3)  ...
    [INFO] (tid:18) 12:5:27:116 CustomerOrderScenario.java:100       > CustomerOrderScenario: checking this customer orders  ...
    [INFO] (tid:18) 12:5:27:121 CustomerOrderScenario.java:129       > CustomerOrderScenario: modifying one of his orders (order_id=305) ...
    [INFO] (tid:18) 12:5:27:181 CustomerOrderScenario.java:151       > CustomerOrderScenario: Use the zoom to select the item.
    [INFO] (tid:18) 12:5:27:218 CustomerOrderScenario.java:170       > CustomerOrderScenario: Check the new order is correct.
    [INFO] (tid:18) 12:5:27:227 CustomerOrderScenario.java:182       > CustomerOrderScenario: done.
    [INFO] (tid:18) 12:5:27:230 GenericScenario.java:71              > GenericScenario: ApplicationName=[CustOrders] done.
    ...
  2. To run the test simulation on GDC, GWC-JS, GMA, or GMI clients, type the command shown below:

    java com.fourjs.ggc.Launcher -u http://localhost:6394/ua/r/gwc-demo -s com.fourjs.ggc.testcases.IntegrityTestsSessionManager

Or alternatively you can run the test in direct connection mode without using the GAS.

  1. To run the tests using a stand-alone DVM, type the command:

    java com.fourjs.ggc.Launcher -s path.to.myTests.mySessionManager --command "fglrun demo"

    Note: The DVM command line to launch the application needs to be passed in double quotes, for example "fglrun demo".