use of org.apache.ignite.testframework.configvariations.ConfigParameter in project ignite by apache.
the class ParametersTest method testEnumVariationsWithNull.
/**
* @throws Exception If failed.
*/
@SuppressWarnings("unchecked")
public void testEnumVariationsWithNull() throws Exception {
ConfigParameter<CacheConfiguration>[] cfgParam = Parameters.enumParameters(true, "setCacheMode", CacheMode.class);
assertEquals(CacheMode.values().length + 1, cfgParam.length);
cfgParam[0] = null;
Set<CacheMode> set = new HashSet<>();
for (int i = 1; i < cfgParam.length; i++) {
ConfigParameter<CacheConfiguration> modeApplier = cfgParam[i];
CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
modeApplier.apply(cfg);
CacheMode mode = cfg.getCacheMode();
set.add(mode);
System.out.println(">>> " + mode);
}
assertEquals(CacheMode.values().length, set.size());
}
use of org.apache.ignite.testframework.configvariations.ConfigParameter in project ignite by apache.
the class ParametersTest method testEnumVariations.
/**
* @throws Exception If failed.
*/
public void testEnumVariations() throws Exception {
ConfigParameter<CacheConfiguration>[] modes = Parameters.enumParameters("setCacheMode", CacheMode.class);
assertEquals(CacheMode.values().length, modes.length);
Set<CacheMode> res = new HashSet<>();
for (ConfigParameter<CacheConfiguration> modeApplier : modes) {
CacheConfiguration cfg = new CacheConfiguration(DEFAULT_CACHE_NAME);
modeApplier.apply(cfg);
CacheMode mode = cfg.getCacheMode();
res.add(mode);
System.out.println(">>> " + mode);
}
assertEquals(modes.length, res.size());
}
Aggregations