Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exploring simbank docs #706

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/data/nav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@
path: /docs/cli-command-reference/cli-runs-submit-local
- title: Debugging a test locally
path: /docs/cli-command-reference/cli-runs-local-debug
- title: Exploring Galasa SimBank using the CLI
path: /docs/cli-command-reference/simbank-cli
- title: Getting started using Eclipse
path: /docs/getting-started/
items:
- title: Installing the Galasa plug-in
path: /docs/getting-started/installing-online
- title: Installing the Galasa plug-in offline
path: /docs/getting-started/installing-offline
- title: Exploring Galasa SimBank
- title: Exploring Galasa SimBank using Eclipse
path: /docs/getting-started/simbank
- title: Creating a project using Eclipse
path: /docs/running-simbank-tests/setting-up-galasa-project-eclipse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,16 @@ title: "Getting started using the Galasa CLI"

If you are installing Galasa for using in the command-line, you can use the Galasa command line interface tool (Galasa CLI) to interact with Galasa to complete tasks, for example, submitting and monitoring Galasa test runs. You can use the same set of Galasa CLI commands to run a given task, regardless of the technology that you are using.

Read on to understand more about the prerequisites that you need to install so that you can start using the Galasa CLI.

## About Galasa CLI commands

Galasa CLI commands start with `galasactl`. Example commands are provided for running on Mac or Unix, and Windows Powershell. The Windows Powershell uses the backtick (`) for line continuation characters. If you are using Windows command-shell, the line continuation character is the caret (^).
## Prerequisites

You can view the Galasa CLI command syntax, including parameter descriptions, in the <a href=https://github.com/galasa-dev/cli/blob/main/docs/generated/galasactl.md target="_blank"> cli repository</a> in GitHub.


## Known limitations

Go programs can sometimes struggle to resolve DNS names, especially when a working over a virtual private network (VPN). In such situations, you might notice that a bootstrap file cannot be found with galasactl, but can be found by a desktop browser, or curl command. In such situations you can manually add the host detail to the `/etc/hosts` file, to avoid DNS being involved in the resolution mechanism.


## Getting help

Once you have installed the Galasa CLI, you can use the following command to get more information about the command and command options, including default values.

```
galasactl --help
```

Use the `--log` option to send logging information to a file. Any folder that is referenced must exist. Existing files are overwritten. Specify `-` to log to `stderr`. The default is no logging.

```
galasactl --log <logFilePath>
```

## Errors

You can view a list of error messages that can be generated by the galasactl tool in the <a href="https://github.com/galasa-dev/cli/blob/main/docs/generated/errors-list.md" target="_blank"> Galasa cli repository</a> in GitHub.
| Software | Description |
| :---- | :-------- |
| Java JDK | Required. Galasa tests and Managers are written in Java - you need to install a Java version 11 JDK or later to use it. _Note:_ We do not currently support Java 17 or later. |
| Maven or Gradle | You must install either Maven or Gradle in order to build Galasa projects. Galasa projects are hierarchical file structures that provide the ability to store and run Galasa tests. All Galasa versions are compatible with Gradle releases 6.8.x and later. |
| 3270 emulator | Optional. Although you do not need a 3270 emulator to run a Galasa test (even if it tests a 3270 application) you can use one to explore Galasa Simbank, a simulated version of an application that helps you get acquainted with Galasa before connecting to a real mainframe to run your own tests. There are many such emulators available but IBM's Personal Communications (PCOMM) is frequently used, as is IBM's Host on Demand software, which includes support for Windows, Linux and MacOS.|



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,8 @@ path: "/docs/cli-command-reference/installing-cli-tool"
title: "Installing the Galasa CLI"
---

This section provides details about prerequisite software requirements and information about how to download and install the Galasa command line interface tool (Galasa CLI) on your local machine.

## Prerequisites

| Software | Description |
| :---- | :-------- |
| Java JDK | Required. Galasa tests and Managers are written in Java - you need to install a Java version 11 JDK or later to use it. _Note:_ We do not currently support Java 17 or later. |
| Maven or Gradle | You must install either Maven or Gradle in order to build Galasa projects. Galasa projects are hierarchical file structures that provide the ability to store and run Galasa tests. All Galasa versions are compatible with Gradle releases 6.9.x. |
| 3270 emulator | Optional. Although you do not need a 3270 emulator to run a Galasa test (even if it tests a 3270 application) you can use one to explore Galasa Simbank, a simulated version of an application that helps you get acquainted with Galasa before connecting to a real mainframe to run your own tests. There are many such emulators available but IBM's Personal Communications (PCOMM) is frequently used, as is IBM's Host on Demand software, which includes support for Windows, Linux and MacOS.|
This section provides details about how to download and install the Galasa command line interface tool (Galasa CLI) on your local machine and tells you a little bit about getting started with the Galasa CLI commands.


## Downloading the Galasa CLI
Expand Down Expand Up @@ -54,6 +47,38 @@ On Windows (Powershell)
You can now run the Galasa CLI too from any directory in your file system without having to specify the absolute path.


## About Galasa CLI commands

Galasa CLI commands start with `galasactl`. Example commands are provided for running on Mac or Unix, and Windows Powershell. The Windows Powershell uses the backtick (`) for line continuation characters. If you are using Windows command-shell, the line continuation character is the caret (^).

You can view the Galasa CLI command syntax, including parameter descriptions, in the <a href=https://github.com/galasa-dev/cli/blob/main/docs/generated/galasactl.md target="_blank"> cli repository</a> in GitHub.


## Known limitations

Go programs can sometimes struggle to resolve DNS names, especially when a working over a virtual private network (VPN). In such situations, you might notice that a bootstrap file cannot be found with galasactl, but can be found by a desktop browser, or curl command. In such situations you can manually add the host detail to the `/etc/hosts` file, to avoid DNS being involved in the resolution mechanism.


## Getting help

Once you have installed the Galasa CLI, you can use the following command to get more information about the command and command options, including default values.

```
galasactl --help
```

Use the `--log` option to send logging information to a file. Any folder that is referenced must exist. Existing files are overwritten. Specify `-` to log to `stderr`. The default is no logging.

```
galasactl --log <logFilePath>
```

## Errors

You can view a list of error messages that can be generated by the galasactl tool in the <a href="https://github.com/galasa-dev/cli/blob/main/docs/generated/errors-list.md" target="_blank"> Galasa cli repository</a> in GitHub.



## Next steps

Read the [Initialising your local environment](/docs/initialising-home-folder) documentation to help you to set up some basic file structures and files in your home folder so that you can start using Galasa.
Expand Down
116 changes: 116 additions & 0 deletions src/markdown-pages/docs/cli-command-reference/simbank-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
path: "/docs/cli-command-reference/simbank-cli"
title: "Exploring Galasa SimBank using the CLI"
---
Distributed with Galasa, SimBank is a component that simulates a mainframe application. It sits above another component called SimPlatform. As delivered, SimBank implements a sample banking application against which you can configure and run a set of provided tests in preparation for running your own tests against an *actual* mainframe application. You can also practice writing some new tests to run against the SimBank banking application.

By exercising the Galasa framework against SimBank, you can pre-empt a lot (but not all) of the work and learning necessary to eventually hook your own tests up with a genuine mainframe environment. If the provided SimBank tests do not work, then it is unlikely that you will be able to run your own tests on a mainframe application. In summary, SimBank helps you to learn Galasa's basic principles of operation before you need to learn how to connect Galasa to your own mainframe application-under-test.

## Launching SimBank
SimBank applications and a set of sample SimBank tests are located in the <a href="https://github.com/galasa-dev/simplatform" target="_blank"> Galasa simplatform repository</a> in GitHub.
To start exploring the Galasa Simbank application and to run the sample SimBank tests by using the Galasa CLI, you need to complete the following steps:

1. Clone the Galasa `simplatform` repository on your machine by running the following command in a terminal in the directory on your local machine in which you want to clone the repository files:
```
git clone https://github.com/galasa-dev/simplatform.git
```
1. Run the `./build-locally.sh` script to build the code.
1. Run the `./run-locally.sh --server` script to start the simbank server inside a local JVM.
In a few seconds, the terminal window displays a series of initialization messages, which on Windows looks like:
```
2019-10-21 14:24:35 INFO dev.galasa.simplatform.main.Simplatform main Starting Simplatform ...
2019-10-21 14:24:35 INFO dev.galasa.simplatform.db.Database setDerbyHome Setting Derby home to C:\Users\<username>\AppData\Local\Temp\galasaSimplatform1440125512154994774
2019-10-21 14:24:36 INFO dev.galasa.simplatform.saf.SecurityAuthorizationFacility <init> Creating SAF service
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Checking if account: 123456789 exists
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Account doesn't exist
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank openAccount Creating account: 123456789
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Checking if account: 987654321 exists
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Account doesn't exist
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank openAccount Creating account: 987654321
2019-10-21 14:24:36 INFO dev.galasa.simplatform.saf.SecurityAuthorizationFacility addUser Added user: IBMUSER
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main Loading services...
2019-10-21 14:24:36 INFO dev.galasa.simplatform.listener.Listener <init> Loading service: dev.galasa.simplatform.listener.WebServiceListener listening on port: 2080
2019-10-21 14:24:36 INFO dev.galasa.simplatform.listener.Listener <init> Loading service: dev.galasa.simplatform.listener.TelnetServiceListener listening on port: 2023
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main ... services loaded
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main Starting Derby Network server....
2019-10-21 14:24:37 INFO dev.galasa.simplatform.main.Simplatform main ... Derby Network server started on port 2027
2019-10-21 14:24:37 INFO dev.galasa.simplatform.main.Simplatform main ... Simplatform started
```

If you are a Mac or Linux user, the messages will be almost identical.

4. The SimBank process has been launched, and is listening on port *2023* for Telnet connections, on port *2080* for web services connections and on port *2027* for Derby SQL connections. Neither web services or Derby connections are explored further in this section.

## Manually exploring the SimBank application
When you launch SimBank, its banking application listens on port 2023 for incoming client Telnet connections, offering an opportunity to first connect to it manually to review and understand the (simulated) transactions it supports, before subjecting it to Galasa's provided tests.

### Logging in to the simulated application
1. With the *Galasa SimBank* component still running, configure your 3270 terminal emulator to access port *2023* of *localhost* (or IP address 127.0.0.1 if the *localhost* alias has not been set up) via the Telnet protocol. No SSL configuration is required.
1. Connect to the listening Telnet service with your 3270 emulator and review the logon screen:

![SimBank logon screen](../first-steps/simbank-logon.png)

1. Ensure that the cursor is in the `Userid` field - if it is not, use the TAB key to position it:

![TAB to the userid field](../first-steps/simbank-userid.png)

1. Enter the userid `IBMUSER`

![Enter your userid](../first-steps/simbank-ibmuser.png)

1. Press TAB to move the cursor into the `Password` field, type the password `SYS1` and press your 3270 terminal emulator's ENTER key to logon and transfer to the SimBank main menu:

![Banktest home screen](../first-steps/simbank-banktest.png)

> *Note:* Depending on your 3270 terminal emulator, its ENTER key may not be mapped to the physical ENTER key on your computer. For example,
> on PCOMM, by default, the ENTER key is mapped to the host machine's right CTRL key. If you are unsure about this, review
> your terminal emulator's documentation.

6. Press PF1:

![CICS home screen](../first-steps/simbank-cics.png)

1. Press your 3270 terminal emulator's CLEAR SCREEN key.
1. Enter the transaction name `BANK` and press your 3270 terminal emulator's ENTER key once more to get to the SimBank main menu:

![Main banking menu](../first-steps/simbank-mainmenu.png)

As you have been progressing through this process, selected events are logged to your terminal:

```
2019-08-16 09:26:39 INFO dev.galasa.simplatform.t3270.screens.AbstractScreen buildScreen Building Screen: SessionManagerLogon
2019-08-16 10:26:08 INFO dev.galasa.simplatform.saf.SecurityAuthorizationFacility authenticate User: IBMUSER authenticated
2019-08-16 10:26:08 INFO dev.galasa.simplatform.t3270.screens.AbstractScreen buildScreen Building Screen: SessionManagerMenu
2019-08-16 10:30:10 INFO dev.galasa.simplatform.t3270.screens.AbstractScreen buildScreen Building Screen: CICSGoodMorning
2019-08-16 10:36:19 INFO dev.galasa.simplatform.t3270.screens.AbstractScreen buildScreen Building Screen: CICSClearScreen
2019-08-16 10:38:54 INFO dev.galasa.simplatform.t3270.screens.AbstractScreen buildScreen Building Screen: BankMainMenu
```
This is an example of log output that can be useful when running tests.
### Browsing account information
1. From the SimBank main menu, press PF1, taking you to the account menu screen.
1. Press TAB until the cursor is in the `Account Number` field, enter `123456789` and press ENTER.
The account details are populated and it is apparent that account number 123456789 is 56.72 in credit.

![Account balance](../first-steps/simbank-balance.png)

1. Press PF3 to return to the account menu screen.

### Transferring funds between accounts
1. From the SimBank main menu, press PF4, taking you to the SimBank transfer menu.
1. Press TAB until the cursor is in the `Transfer from Account Number` field and enter `123456789`.
1. Press TAB until the cursor is in the `Transfer to Account Number` field and enter `987654321`.
1. Press TAB until the cursor is in the `Transfer Amount` field and enter `1`

![Inter-account transfer](../first-steps/simbank-transfer.png)

1. Press ENTER - a `Transfer Successful` message appears. A log message is also written to the terminal:

```
2019-08-16 13:50:53 INFO dev.galasa.simplatform.application.Bank transferMoney Transfering 1.0 from account: 123456789 to account: 987654321
```

Press PF3 and once again browse the 123456789 account as described previously to verify that its total credit has decreased by the transferred 1.00, and that the 987654321 account has increased by the same amount.

Note that SimBank also offers a web services interface on port 2080, and although it is not exercised in this topic, it *is* used by two of the provided tests - `BasicAccountCreditTest.java` and `ProvisionedAccountCreditTests.java`.

Having explored SimBank manually, it's a good time to run some or all of a small collection of automated tests that are provided with SimBank itself - to start, choose [Running the supplied SimBank tests](../running-simbank-tests) in the side-menu.
4 changes: 1 addition & 3 deletions src/markdown-pages/docs/ecosystem/ecosystem-manage-cps.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The example commands that are provided in the following sections assume that the
Use the `galasactl properties get` command to read CPS properties and values from a specified namespace in the Galasa Ecosystem to verify that the properties exist and are set correctly. You can filter the properties that are returned by using the property name (to return a single property), or by using the prefix, suffix, and infix flags to return a subset of properties that match the provided criteria.



### Retrieve all properties from a namespace

To retrieve all properties that are stored in the `framework` namespace, use the following command:<br><br>
Expand Down Expand Up @@ -98,9 +99,6 @@ Total: 2
```


Returned properties are first sorted according to the number of segments in the property name (denoted by the period character (.)), and then in alphabetical order.


## <a name="setting"></a>Setting properties in a namespace

You can update a property and its value in a namespace by using the `galasactl properties set` command. If the property does not exist in that namespace, the command creates the property. You must provide the namespace, the name of the property, and the value of the property in the command in the following example format:
Expand Down
Loading
Loading