Species Discovery Plugin Test Suite

From Gcube Wiki
Jump to: navigation, search

The Species Discovery Plugin Testsuite is a java library for the testing and the checking of the functionality offered by a Species Discovery plugin.

The test suite offers different sets of test to run over a plugin. Each test produces a report indicating which errors have been encountered. Some tests requires a set of scientific name or common name in order to be used, the test suite offers different sets that can be indicated when running a test. In order to build a TestSuite a TestSuiteBuilder has been provided. The builder facilitate the creation and configuration of a test suite.

Here an example of TestSuite creation for the ObisPlugin.

	//instantiate the plugin to test
	ObisPlugin obisPlugin = new ObisPlugin();
	//start the TestSuite creation for the specified plugin
	TestSuiteBuilder builder = TestSuiteBuilder.create(obisPlugin);
	//we want to load the plugin configuration from the IS in the /gcube/devsec scope
	//the suite will use the specified scientific name and common name sets
	//we require to run the ScanTest group
	//the test suite should save the test report into a file
	//finally we build the test suite...
	TestSuite testSuite = builder.build();
	//...and run it


In order to use the testsuite the developer have to declare the dependency in the pom file. Here an example: