Skip to content

copyedit gui->testing #19

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

Merged
merged 1 commit into from
Jun 5, 2025
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
5 changes: 5 additions & 0 deletions doc/Glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ A method of changing the internal parameters of an emulator to mimic the behavio

Slits used on each of the Muon instruments to control the neutron flux to the sample. Each "jaw" pivots on one edge, much like a door on a hinge.

## BDD

Behaviour-driven development. See the [Agile Alliance definition of BDD](https://www.agilealliance.org/glossary/bdd/),
and [how we use BDD for testing in Squish](/client/testing/System-Testing-with-Squish-BDD).

## Block

## Block Archive
Expand Down
22 changes: 12 additions & 10 deletions doc/client/testing/Adding-Unit-Tests.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# Adding tests

For more detailed information see [an_introduction_to_unit_testing.rst](An-Introduction-to-Unit-Testing).
:::{seealso}
- [Introduction to unit testing](An-Introduction-to-Unit-Testing)
:::

It is relatively simple to add unit tests for a plug-in in such a way that maven can run them as part of the build.

Here are the steps required in Eclipse:
The steps required to add unit tests for a plugin are:

* Create a new Fragment Project
* File > New > Project... > Plug-in Development > Fragment Project
* Set the project name to `\<the full name of the plug-in to test\>.tests`
* Change the location to the repository rather than the workspace: `xxx\ibex_gui\base\\\<project_name>` (don't forget the project name!!)
* Set the project name to `<the full name of the plug-in to test\>.tests`
* Change the location to the repository rather than the workspace: `ibex_gui\base\<project_name>` (don't
forget the project name!)
* Click "Next"
* Make sure the Execution Environment points at the correct version of Java (currently JavaSE-11)
* Make sure the Execution Environment points at the correct version of Java
* Click the "Browse" button next to "Plug-in ID"
* Select the plug-in to test and click "OK"
* Finish

* In the newly created plug-in, add a new Package with the same name as the plug-in or something equally sensible.
* In the newly created plug-in, add a new Package with the same name or structure as the plug-in.
* Select the plug-in
* File > New > Package
* Enter the name and click "Finish"

* In the new Package create a class for adding test
* Select the Package
* File > New > Class
* The class name **must** end in Test to be picked up by the automated build
* The class name **must** end with `Test` to be picked up by the automated build

* Add tests to the class
* Add `org.junit` and `org.mockito` (if required) to the 'Required Plug-ins', under the Dependencies tab for the manifest
* Add `org.junit` and `org.mockito` (if required) to the 'Required Plug-ins', under the Dependencies tab for the
manifest (`MANIFEST.MF`)

* Add the test plug-in to the Maven build by [following these steps](../coding/Adding-a-Plugin-or-Feature-to-Maven-Build)

Expand Down
Loading