All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Resources.FitNesseRoot.PlugIns.SshFixture.UserGuide.SshTestCreation.ScriptMode.wiki Maven / Gradle / Ivy

---
Test
---
!2 Script Mode
Script table can also be used to define !-SshFixture-! test.

|import                               |
|com.github.gun88.fitnesse.fixture.ssh|

The endpoint string (foo/[email protected]) can be defined in multiple ways:
 1 Table header
 1 Table body with single string
 1 Table body with multiple parameters
 1 [[VM options][&2                  |
|check  |error     |foo-bar                 |
|check  |exit code |0                       |
|execute|exit 123                           |
|check  |exit code |123                     |
|execute|echo foo; echo bar 1>&2; exit 234  |
|check  |output    |foo                     |
|check  |error     |bar                     |
|check  |exit code |234                     |
|close connection                           |

!***> code
{{{!-
|import                               |
|com.github.gun88.fitnesse.fixture.ssh|

|script |ssh client|foo/[email protected]|
|open connection                            |
|execute|echo foo-bar                       |
|check  |output    |foo-bar                 |
|check  |exit code |0                       |
|execute|echo foo-bar 1>&2                  |
|check  |error     |foo-bar                 |
|check  |exit code |0                       |
|execute|exit 123                           |
|check  |exit code |123                     |
|execute|echo foo; echo bar 1>&2; exit 234  |
|check  |output    |foo                     |
|check  |error     |bar                     |
|check  |exit code |234                     |
|close connection                           |

|ssh client  |foo/[email protected]|
|command     |output?                 |
|echo foo-bar|foo-bar                 |

|ssh client       |foo/[email protected]|
|command          |error?                  |
|echo foo-bar 1>&2|foo-bar                 |

|ssh client|foo/[email protected]|
|command   |exitCode?               |
|exit 123  |123                     |

!define TEST_SYSTEM {slim}
!path ${jsch.jar.path}
!path ${sshFixture.jar.path}
-!}}}
Note: if !-SshFixture-! is not installed as a plugin, remember to set or replace properties: jsch.jar.path, sshFixture.jar.path; with actual paths.

Note: In this example the connection was built via username and password, that are set in plain text in table header. Click [[here][




© 2015 - 2024 Weber Informatics LLC | Privacy Policy