Running the supplied SimBank tests
Galasa SimBank comes with a selection of prepared Galasa tests:
- A basic Installation Verification Test (IVT) which logs on to SimBank -
SimBankIVT.java
. - A test that updates an account using web services and examines the changes with 3270 screens -
BasicAccountCreditTest.java
. - A test that uses a provisioned account object to perform the same test as
BasicAccountCreditTest.java
in an improved test design -ProvisionedAccountCreditTests.java
. - A test that exercises the z/OS Batch Manager by simulating the submission of a JCL job to add a number of accounts to the SimBank system -
BatchAccountsOpenTest.java
.
All of these example tests become available when you set up a Galasa example project within Eclipse.
If you are using the Galasa plug-in from the external update site and are using Maven, follow the instructions in the Creating an example Galasa project using Maven section.
If you are using the Galasa plug-in from the external update site and are using Gradle, follow the instructions in the Creating an example Galasa project using Gradle section.
If you are using the Galasa zipped distribution you must use Gradle to build your project, so follow the instructions in the Creating an example Galasa project using Gradle (zipped distribution) section.
Note that there are some variations in the Eclipse interface, depending on the version of Eclipse that you are using.
Creating an example Galasa project using Maven
NOTE: Normally m2e (the Eclipse Maven plug-in) automatically compiles the test bundles and produces the necessary manifest and OSGi files. However, there appears to be an anomaly in m2e in the 2019 versions of Eclipse which we are investigating. If the bundles fail to build correctly, you can force the Maven build by right-clicking the project and selecting Run As > Maven Install. We will resolve this issue in a future release.
- Ensure that Eclipse is running.
- Choose File > New > Example, select SimBank example Maven projects and click Next.
- Confirm your New project prefix as
dev.galasa.simbank
and press Finish. In your Package Explorer (if it's not visible, choose Window > Show View > Package Explorer), two new entries appear:
dev.galasa.simbank.manager
dev.galasa.simbank.tests
- Right-click on
dev.galasa.simbank.manager
and choose Run As > Maven install - wait a few moments for the Maven build and then right-click ondev.galasa.simbank.tests
and do the same. Note that the order in which you do this is significant - firstdev.galasa.simbank.manager
and thendev.galasa.simbank.tests
. This is because the SimBank tests have a dependency on the SimBank Manager. - Expand
dev.galasa.simbank.tests
and then expandsrc/main/java
. - Explore the
dev.galasa.simbanks.tests
package. You'll see the group of tests provided with SimBank:
Explore these tests by selecting from the left-hand menu - if you are new to Galasa, The SimBank IVT is the best place to start.
Creating an example Galasa project using Gradle
- Ensure that Eclipse is running.
- Depending on your operating system, choose either Window > Preferences or Eclipse > Preferences, check that you are using the correct version of Gradle.
- Choose File > New > Example, select SimBank example Gradle projects and click Next.
- Confirm your New project prefix as
dev.galasa.simbank
and press Finish. In your Package Explorer (if it's not visible, choose Window > Show View > Package Explorer), three new entries appear:
dev.galasa.simbank.manager
dev.galasa.simbank.parent
dev.galasa.simbank.tests
- In Project Explorer, right-click on
dev.galasa.simbank.parent
and select Gradle > Refresh Gradle Project. A BUILD SUCCESSFUL message is displayed in the Console tab when the project is refreshed successfully.
Note: If you get an error connecting to the Gradle build, go to Window > Preferences > Gradle, check the Local installation directory box, browse to the folder in which you installed Gradle and click OK and Apply and Close.
- Navigate to Run > Run Configurations. The Create, manage and run configurations dialog box appears.
- Depending on version of Eclipse that you are using, either right-click Gradle Project or Gradle Task and choose New Configuration.
- Provide a meaningful name and set up your Gradle Task to run a clean build.
- In Working Directory, click Workspace, select
dev.galasa.simbank.parent
and clickOK
. - Click Apply then Run. A BUILD SUCCESSFUL message is displayed in the Console tab.
- Expand
dev.galasa.simbank.tests
and then expandsrc/main/java
. - Explore the
dev.galasa.simbank.tests
package. You'll see the group of tests provided with SimBank:
Explore these tests by selecting from the left-hand menu - if you are new to Galasa, The SimBank IVT is the best place to start.
Creating an example Galasa project using Gradle (zipped distribution)
- Ensure that Eclipse is running.
- Depending on your operating system, choose either Window > Preferences or Eclipse > Preferences, check that you are using the correct version of Gradle, and then select
Galasa
from the left hand pane. - Change the Remote Maven URI to the local Maven directory, for example,
file:///home/username/galasa-isolated-mvp/maven
to enable running tests to access any dependencies.
Note: If you are using the Docker image, set the URL to the running container, for example, http://hostname:8080/maven
.
- Click Apply and Close.
- Choose File > New > Example, select SimBank example Gradle projects and click Next.
- Confirm your New project prefix as
dev.galasa.simbank
and press Finish. In your Package Explorer (if it's not visible, choose Window > Show View > Package Explorer), three new entries appear:
dev.galasa.simbank.manager
dev.galasa.simbank.parent
dev.galasa.simbank.tests
- Add a
pluginManagement
section, at the top of thesettings.gradle
file indev.galasa.simbank.parent
so that the Gradle build can search the Maven directory for any required plug-ins. Specify the Maven repository as the location of the unzipped Maven directory. For example:
pluginManagement {
repositories {
maven {
url = "file:///home/username/galasa-isolated-mvp/maven"
}
}
}
Note: If you are using the Docker image, set the URL to the running container. For example:
pluginManagement {
repositories {
maven {
url = "http://hostname:8080/maven"
}
}
}
- In
dev.galasa.simbank.manager
, modify thebuild.gradle
file:- In the repositories closure, replace
mavenCentral()
with the location of the unzipped Maven directory so that the individual projects can locate any dependencies that they might require for building. For example:
Note: If you are using the Docker image, set the URL to the running container. For example:repositories { maven { url = "file:///home/username/galasa-isolated-mvp/maven" } }
repositories { maven { url = "http://hostname:8080/maven" } }
- Modify the dependencies closure by adding the following constraints:
constraints { implementation('commons-codec:commons-codec:1.15'){ because "Force specific version of commons-codec for security reasons" } implementation('org.apache.httpcomponents:httpcore:4.4.14'){ because "Force specific version of httpcore for security reasons" } }
- In the repositories closure, replace
- In
dev.galasa.simbank.tests
, modify thebuild.gradle
file:- In the repositories closure, replace
mavenCentral()
with the location of the unzipped Maven directory. For example:
Note: If you are using the Docker image, set the URL to the running container. For example:repositories { maven { url = "file:///home/username/galasa-isolated-mvp/maven" } }
repositories { maven { url = "http://hostname:8080/maven" } }
- Modify the Selenium Manager dependency to remove packages that are not required. Change the dependency from:
to:implementation'dev.galasa:dev.galasa.selenium.manager:0.+'
implementation('dev.galasa:dev.galasa.selenium.manager:0.+'){ exclude group: 'com.squareup.okio', module: 'okio' exclude group: 'com.squareup.okhttp3', module: 'okhttp' exclude group: 'net.bytebuddy', module: 'byte-buddy' exclude group: 'org.apache.commons', module: 'commons-exec' exclude group: 'com.google.guava', module: 'guava' }
- Modify the dependencies closure by adding the following constraints:
constraints { implementation('commons-codec:commons-codec:1.15'){ because "Force specific version of commons-codec for security reasons" } implementation('org.apache.httpcomponents:httpcore:4.4.14'){ because "Force specific version of httpcore for security reasons" } }
- In the repositories closure, replace
- Ensure that you save the modifications that you made to the files.
- In Project Explorer, right-click on
dev.galasa.simbank.parent
and select Gradle > Refresh Gradle Project. A BUILD SUCCESSFUL message is displayed in the Console tab when the project is refreshed successfully.
Note: If you get an error connecting to the Gradle build, go to Window > Preferences > Gradle, check the Local installation directory box, browse to the folder in which you installed Gradle and click OK and Apply and Close.
- Navigate to Run > Run Configurations. The Create, manage and run configurations dialog box appears.
- Depending on version of Eclipse that you are using, either right-click Gradle Project or Gradle Task and choose New Configuration.
- Provide a meaningful name and set up your Gradle Task to run a clean build.
- In Working Directory, click Workspace, select
dev.galasa.simbank.parent
and clickOK
. - Click Apply then Run. A BUILD SUCCESSFUL message is displayed in the Console tab.
- Expand
dev.galasa.simbank.tests
and then expandsrc/main/java
. - Explore the
dev.galasa.simbank.tests
package. You'll see the group of tests provided with SimBank:
Explore these tests by selecting from the left-hand menu - if you are new to Galasa, The SimBank IVT is the best place to start.