-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from galasa-dev/next
publish 0.7.0 website docs
- Loading branch information
Showing
28 changed files
with
720 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
path: "/docs/support" | ||
title: "Support" | ||
--- | ||
|
||
If you find any problems whilst you’re using Galasa, get in touch and get the help you need: | ||
|
||
1) Search our project management repository on GitHub and our Spectrum channel, perhaps someone has already had a similar issue and solved it. | ||
2) If you have an error message or java stack trace, feel free to raise an issue in the project management repository and the Galasa community will get back to you as soon as possible. | ||
3) If you have a question or a query, try our Spectrum channel. Here, experts and users from the community can come together to help you out and answer your question. | ||
|
||
If your issue requires a code change, the community will do their best to respond and fix the problem as soon as they can. Depending on the severity of the issue, the fix might be scheduled for a future release of Galasa. Alternatively, the fix might be back ported to the current release. Naturally this is always a community decision and your input is just as important. | ||
|
||
If you want to have a go at fixing the defect yourself, let us know and we will help you to try and fix the issue. | ||
|
||
We are open to suggestions about more formal support, come and talk to us - we would love to hear from you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
path: "/docs/managers/artifact-manager" | ||
title: "Artifact Manager" | ||
--- | ||
|
||
**Release** | ||
|
||
## Overview | ||
This Manager allows a test to access files that are stored within the same bundle as the test code itself. Helper methods are provided to stream and substitute symbolics within the loaded file. <br><br> You can view the <a href="https://javadoc.galasa.dev/dev/galasa/artifact/package-summary.html">Javadoc documentation for this Manager here</a>. <br><br> | ||
|
||
|
||
|
||
|
||
## Code snippets | ||
|
||
Use the following code snippets to help you get started with the Artifact Manager. | ||
|
||
<details><summary>Create the Artifact Manager</summary> | ||
|
||
The ArtifactManager allows you to stream resources from within the same bundles as your test class. The easiest way to accomplish this is to use the BundleResources annotation: | ||
|
||
``` | ||
@BundleResources | ||
public IBundleResources resources; | ||
``` | ||
The resources object now references the list of resources that are held within the test bundle under */src/main/resources/*. These resources can now be accessed directly by the test code, by calling methods on the resources object. | ||
|
||
Alternatively, if the resources are within another class, you can use the ArtifactManager annotation to address the Manager directly: | ||
|
||
``` | ||
@ArtifactManager | ||
public IArtifactManager artifacts; | ||
``` | ||
|
||
This will provision an instance of the Artifact Manager. In order to obtain a IBundleResources object to reference the content of the resources within a test bundle you will need to use the API: | ||
|
||
``` | ||
IBundleResources resources = artifacts.getBundleResources(this.getClass()); | ||
``` | ||
|
||
</details> | ||
|
||
<details><summary>Retrieving the content of a file as a string</summary> | ||
|
||
The simplest thing that a test might want to do is retrieve the content of a file as a string. First, an input stream to the file location is constructed and then a helper method is invoked to stream the content as a string. However, if you wanted to read from the input stream yourself, then that option is available to you. | ||
|
||
``` | ||
InputStream is = resources.retrieveFile("input/hobbit.txt"); | ||
String textContext = resources.streamAsString(is); | ||
``` | ||
</details> | ||
|
||
<details><summary>Substituting variables into a file</summary> | ||
|
||
As you read a file from the local bundle you might want to substitute values into the file before retrieving it. This is called within Galasa as retrieving a skeleton file from the bundle. The first step is to create a HashMap containing the name of the variables that you want to be substituted in the target file, as well as the value that should be used. | ||
|
||
``` | ||
HashMap<String, Object> parameters = new HashMap<String, Object>(); | ||
parameters.put("ACCOUNT_NUMBER", "123456789"); | ||
parameters.put("AMOUNT", "50.05"); | ||
``` | ||
|
||
In this case we are adding two items to the HashMap, setting the substitute values for both ACCOUNT_NUMBER and AMOUNT. This HashMap is then passed to the retrieveSkeletonFile method. | ||
|
||
``` | ||
InputStream is = resources.retrieveSkeletonFile("input/hobbit.txt", parameters); | ||
String textContext = resources.streamAsString(is); | ||
``` | ||
|
||
When the file is now retrieved from the local bundle all references to ++ACCOUNT_NUMBER++ and ++AMOUNT++ will be substituted for "123456789" and "50.05" respectively. Note that these substitutions are for the instance of the test that is running. The actual copy of the file in the bundle is unchanged and cannot affect any other instances of the test that are running at the same time. | ||
</details> | ||
|
||
|
Oops, something went wrong.