Permalink
Browse files

GEODE-5424: Adding a spotless rule to enforce using GeodeAwaitility

Any tests that use regular awaitility will now fail the spotless check,
to avoid checking tests that don't pick up our default wait time.
  • Loading branch information...
upthewaterspout committed Oct 16, 2018
1 parent 6d95888 commit 1954e9220a5b890449916d6e5c38a61518eace00
@@ -17,12 +17,12 @@
import java.util.concurrent.TimeUnit;
import org.awaitility.Awaitility;
import org.awaitility.Duration;
import org.awaitility.core.ConditionFactory;
/**
* Utility to set consistent defaults for {@link Awaitility} calls for all geode tests
* Utility to set consistent defaults for {@link org.awaitility.Awaitility} calls for all geode
* tests
*/
public class GeodeAwaitility {
@@ -36,7 +36,7 @@
* Start building an await statement using Geode's default test timeout
*
* @return a {@link ConditionFactory} that is a builder for the await
* @see Awaitility#await()
* @see org.awaitility.Awaitility#await()
*/
public static ConditionFactory await() {
return await(null);
@@ -48,10 +48,10 @@ public static ConditionFactory await() {
* @param alias A name for this await, if you test has multiple await statements
*
* @return a {@link ConditionFactory} that is a builder for the await
* @see Awaitility#await(String)
* @see org.awaitility.Awaitility#await(String)
*/
public static ConditionFactory await(String alias) {
return Awaitility.await(alias)
return org.awaitility.Awaitility.await(alias)
.atMost(TIMEOUT)
.pollDelay(POLL_DELAY)
.pollInterval(POLL_INTERVAL);
@@ -42,6 +42,11 @@ subprojects {
throw new AssertionError("Do not use wildcard imports. 'spotlessApply' cannot resolve this issue.");
}
}
custom 'Refuse Awaitility import', {
if(it =~ /import\s+(static\s+)?org.awaitility.Awaitility.*/) {
throw new AssertionError("Do not use Awaitility.await(). Use GeodeAwaitility.await() instead. 'spotlessApply' cannot resolve this issue.")
}
}
importOrderFile "${project(':geode-core').projectDir}/../etc/eclipseOrganizeImports.importorder"
custom 'Remove unhelpful javadoc stubs', {

0 comments on commit 1954e92

Please sign in to comment.