Search in sources :

Example 1 with Environments

use of org.locationtech.geowave.test.annotation.Environments in project geowave by locationtech.

the class GeoWaveITRunner method getTestEnvironments.

private TestEnvironment[] getTestEnvironments() throws NullPointerException {
    final Set<Environment> environments = new HashSet<>();
    final Environments es = getTestClass().getJavaClass().getAnnotation(Environments.class);
    if (es != null) {
        final Environment[] envs = es.value();
        for (final Environment env : envs) {
            environments.add(env);
        }
    }
    final List<FrameworkMethod> envMethods = getTestEnvAnnotatedMethods();
    for (final FrameworkMethod m : envMethods) {
        final Environment[] envs = m.getMethod().getAnnotation(Environments.class).value();
        for (final Environment env : envs) {
            environments.add(env);
        }
    }
    final TestEnvironment[] testEnvs = new TestEnvironment[environments.size() + storeTypes.size()];
    int i = 0;
    for (final GeoWaveStoreType t : storeTypes) {
        testEnvs[i++] = t.getTestEnvironment();
    }
    for (final Environment e : environments) {
        testEnvs[i++] = e.getTestEnvironment();
    }
    return processDependencies(testEnvs);
}
Also used : Environments(org.locationtech.geowave.test.annotation.Environments) GeoWaveStoreType(org.locationtech.geowave.test.annotation.GeoWaveTestStore.GeoWaveStoreType) Environment(org.locationtech.geowave.test.annotation.Environments.Environment) FrameworkMethod(org.junit.runners.model.FrameworkMethod) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Aggregations

HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 FrameworkMethod (org.junit.runners.model.FrameworkMethod)1 Environments (org.locationtech.geowave.test.annotation.Environments)1 Environment (org.locationtech.geowave.test.annotation.Environments.Environment)1 GeoWaveStoreType (org.locationtech.geowave.test.annotation.GeoWaveTestStore.GeoWaveStoreType)1