# Setup: Testing

You have completed all steps of Setup Option A or Option B (or C), and installed the Game Server on your server host. Now, let's do some testing to see if everything is in place!

## Is the MySQL Server running?

Assuming you have set up your MySQL server as per our instructions, you should be able to log in to it with the user name and password of user `game`:

    	mysql -u game -p

Once connected to the MySQL server, you can switch to database `game` and check what tables it has now:

    mysql> use game;

    mysql> show tables;

Early on, the list of tables shown to you may be empty. But if you try the same query later on, after you have done some playing, you may see a list similar to this:

    	mysql> show tables;

    +------------------------+
    | Tables_in_game         |
    +------------------------+
    | Board                  |
    | Episode                |
    | Foo                    |
    | OPENJPA_SEQUENCE_TABLE |
    | Piece                  |
    | PlayerInfo             |
    | Test                   |
    | TestParent             |
    | User                   |
    | foo                    |
    | user_roles             |
    | users                  |
    | users_clear            |
    +------------------------+
    13 rows in set (0.00 sec)

## Is the Tomcat web server running?

Once you have set up Tomcat as per the Tomcat setup guide, you should be able to verify that it's running by going to the appropriate URL, such as `http://MY_HOST:MY_PORT/` . (Put your host name and port number instead of `MY_HOST` and `MY_PORT` in the URL; if you are sitting at your server's console, and are using the default port number 8080, that would be `http://localhost:8080/` )

## Is the Game Server web app deployed?

If you have put the Game Server WAR file, `w2020.war`, to the /opt/tomcat/webapps directory, Tomcat should automatically deploy your application. If you go to the URL `http://MY_HOST:MY_PORT/w2020` , you should see the main page of that application (the documentation page), which looks look this.

The page you are reading right now is part of that application, so if you go to the URL `http://MY_HOST:MY_PORT/w2020/setup/setup-testing.html`, you should see the same text you are reading now -- but your browser's URL bar will show that you're reading it from your own server, and not from our server (`sapir.psych.wisc.edu`).

The rest of this document will assume that you're reading it as it's served to you from your own server. This means that the links will go to active pages of your server. (Otherwise, by clicking on links you'll be merely testing our own server at U. Wisconsin, which is probably not what you want).

## Check the REST API components

Now that you're viewing this page on your own server, you can go to the Web API: Web API page. You don't particularly need to know what different things there do (they are responsible for the communication between the GUI client and the Game Server), but at least you can click on the first button in that page, /GetVersion, and if the Game Server is running, it should tell you its version number. (As of June 2022, it's 5.002).

## Validate an experiment plan

Again, assuming that you're viewing this page on your own game server, you can go to the experiment plan validation tool. That page will show the list of experiment plans installed on your server; each plan corresponds to one subdirectory under your `FILES_GAME_DATA/trial-lists` directory. Pick a plan, and click on the "Check" button. The server will then try to do all the things it normally does when it loads an experiment plan that a player starts using, i.e. compiling the rule set file etc, reporting any errors that may occur.

The sample experiment plans we are distributing via are public repository are not supposed to produce error messages, but once you start creating your own plans, you probably will see some errors :-)

## Try to play a game

Again, assuming that you're viewing this page on your own game server, you can go to the GUI play launch page. That page will show the list of experiment plans installed on your server; each plan corresponds to one subdirectory under your `FILES_GAME_DATA/trial-lists` directory.

Pick a plan, enter an arbitrary unique player name (e.g. `john-doe-2022-01-01-a`. and click on "Play". That should start a game with the GUI interface.

## Exporting the data

After you (or other players) have played some episodes, you can check what data have been saved by the server.

The transcript files and initial board files, described in the Data Guide under "Write-only files" can be found in your `FILES_SAVED` directory.

The data recorded in the database server can be viewed via the `mysql` command (the MySQL client), or with the tools that you have built from our source if you have followed the Setup Option B (or C). (The script would be in ~/w2020/game/scripts/export.sh, if you used the same directory as suggested in the Build Guide. For more details on what it exports, see "Exporting" in the Data Guide.