This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.
This page summarizes points to consider when adding or revisiting tests for some feature or functionality. Tests should be omitted only if there are certain reasons for not implementing tests of some kind.
The framework provides an ability to write a test-case once and run it in multiple Ignite and Cache configurations.
Test class has to extend
TestSuite has to be built using
As an example see
The following code will test
SomeFunctionalityTest with basic set of
IgniteConfiguration variations (
OptimizedMarshaller and enabled / disabled per class loading), will be used Ignite cluster with 3 nodes, the second started node is client (client with
idx=1), each test-method will be run with
testedGrid() method) .
The following code will test
SomeCacheFunctionalityTest with basic set of
IgniteConfiguration variations (see above) and basic set of
CacheConfiguration variations (different cache modes, atomicity modes and memory modes), Ignite cluster with 5 nodes will be used, the second started node is client (with
nodeIdx=1) and the third started node is client with near-only cache (with
nodeIdx=2), each test-method will be run with
testedGrid=0,1 and 2 (see
testedGrid() and methods) .
IgniteConfigVariationsAbstractTest has methods
key(int i) and
value(int i). To run a test scenario in all supported by the framework data modes (
Externaliazable, plane, mixed and etc. objects), it's enough to write test scenario using these methods to generate different keys and values and to place test scenario inside
runInAllDataModes(TestRunnable runnable) method.
For example, the following code test cache's put-get scenario in all supported by the framework data modes:
The main idea of Configuration Variations framework is a using of a matrix of possible variants of configuration properties.
Lets imagine there's a need to look over all possible variations of
IgniteConfiguration where marshaller property can be
perClassLoadingEnabled can be
false. So, there's the following matrix:
|Variant 1||Variant 2|
The framework has
VariationsIterator which will produce the following 4 variation vectors for the matrix above:
The following methods should be used to provide custom matrixes:
ConfigVariations - contains ready to use configuration parameters matrixes.
Parameters - contains util methods to build parameters matrixes.
ConfigVariationsTestSuiteBuilder also provides possibility to filter Ignite and Cache configurations. See
withIgniteConfigFilters(IgnitePredicate<IgniteConfiguration>... filters) and withCacheConfigFilters(IgnitePredicate<CacheConfiguration>... filters) methods.
The purpose of this ticket is to make sure that all ignite operations should work for any configuration properties combination.