22.214.171.124.Creating a Project
In MarathonITE, a project holds all the testing project resources. Let us start by creating a new project for the SwingSet3 application.
If you have MarathonITE running, quit it. And start marathonite without any arguments.
MarathonITE displays a project selection dialog. The project selection dialog allows you to create, modify projects. From the project selection, click on the New and from the displayed options select Java/Swing Project.
MarathonITE opens up a new project dialog.
Configuring the Project
MarathonITE project configuration is provided in 3 sections which are displayed as tabs in the dialog. Generic information regarding the project is given in the Project tab, the default fixture configuration is provided in the Application tab and script language settings in the Language tab.
In the project tab, provide the name of the project and use the Browse button to select an empty folder to save the project. Optionally you can provide Description. We shall leave the pattern fields as empty for this tutorial.
Click on the Application tab.
MarathonITE borrows the concept of Fixtures from xUnit family of testing frameworks. A fixture defines how an application is launched from MarathonITE and also provides
teardown methods that are executed at the beginning and end of a test script respectively. A MarathonITE project can have more than one fixture. The application tab is used to create a default fixture.
Application tab allows you to select a launcher and appropriate information required for the launcher. For this example, we will use Java Command Line Launcher.
From the launcher combobox, select Java Command Line Launcher. You will be presented with two tabs - Main and Class Path.
When Java command line launcher is used, MarathonITE constructs a java command line in the following form and executes it.
java [vm-arguments] -cp [class-path-entries] [main-class-name] [program-arguments]
We need to provide all the information required to construct the command to MarathonITE. In the Main tab, provide the class name com.sun.swingset3.SwingSet3 - which is the main class used to launch SwingSet3 application. You can optionally enter Program Arguments and VM Arguments in the fields. If your application needs to start from a specific directory, you can specify Working Directory by clicking on Browse and selecting a folder. Though MarathonITE needs Java 1.8+ to work, your application can still use a different version of Java. You can use the Java Home field to specify that. For this tutorial, enter -Xmx512m in the VM Arguments and leave rest of the fields empty.
Click on the Class Path tab.
Use the Add Archives button to add SwingSet3.jar and all other JAR files in the swingset3/lib folder. You can also use Add Folders option and add different folders to the class path, though it is not required in this case.
Now select Language Tab.
Language tab allows you to select the scripting language and customize the language runtime used in MarathonITE scripts. At this time MarathonITE supports Ruby and we intend to support other languages. For this example, there is nothing we need to customize in this tab.
Testing the Configuration
You can test the configuration and check for any errors by using the Test option. When you select the option, MarathonITE uses the given configuration to launch the application.
If everything is fine, your application should launch. Once MarathonITE is able to connect to the application - a window is shown. The window shows the standard output and error from the command - you can see any errors if the application is not launched.
Click on the Close button. This should close the application.
Saving the Project
Click on the Save button to save the project. MarathonITE will close the project configuration window and you are presented with the project selection dialog with the newly created project already select.
Click on the Select button to start MarathonITE with the new project.