You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2015/12/11 22:23:00 UTC
[26/50] [abbrv] incubator-geode git commit: Merge remote-tracking
branch 'origin/develop' into feature/GEODE-217
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/build.gradle
----------------------------------------------------------------------
diff --cc build.gradle
index 0c24db9,b5465b8..625da36
--- a/build.gradle
+++ b/build.gradle
@@@ -264,35 -290,37 +290,39 @@@ subprojects
}
javadoc.classpath += configurations.provided
-
+
+ javadoc {
+ options.addStringOption('Xdoclint:none', '-quiet')
+ }
+
dependencies {
- compile 'org.springframework:spring-aop:3.2.12.RELEASE'
- compile 'org.springframework:spring-beans:3.2.12.RELEASE'
- compile 'org.springframework:spring-context:3.2.12.RELEASE'
- compile 'org.springframework:spring-context-support:3.2.12.RELEASE'
- compile 'org.springframework:spring-core:3.2.12.RELEASE'
- compile 'org.springframework:spring-expression:3.2.12.RELEASE'
- compile 'org.springframework:spring-web:3.2.12.RELEASE'
- compile 'org.springframework:spring-webmvc:3.2.12.RELEASE'
-
- testCompile 'com.github.stefanbirkner:system-rules:1.9.0'
- testCompile 'com.jayway.awaitility:awaitility:1.6.3'
- testCompile 'edu.umd.cs.mtc:multithreadedtc:1.01'
- testCompile 'eu.codearte.catch-exception:catch-exception:1.4.4'
- testCompile 'eu.codearte.catch-exception:catch-throwable:1.4.4'
- testCompile 'junit:junit:4.12'
- testCompile 'org.assertj:assertj-core:3.1.0'
- testCompile 'org.easetech:easytest-core:1.3.2'
- testCompile 'org.hamcrest:hamcrest-all:1.3'
- testCompile 'org.jmock:jmock:2.8.1'
- testCompile 'org.jmock:jmock-junit4:2.8.1'
- testCompile 'org.jmock:jmock-legacy:2.8.1'
- testCompile 'org.mockito:mockito-core:1.10.19'
- testCompile 'pl.pragmatists:JUnitParams:1.0.4'
-
- testRuntime 'cglib:cglib:3.1'
- testRuntime 'org.objenesis:objenesis:2.1'
- testRuntime 'org.ow2.asm:asm:5.0.3'
+ compile 'org.springframework:spring-aop:' + project.'springframework.version'
+ compile 'org.springframework:spring-beans:' + project.'springframework.version'
+ compile 'org.springframework:spring-context:' + project.'springframework.version'
+ compile 'org.springframework:spring-context-support:' + project.'springframework.version'
+ compile 'org.springframework:spring-core:' + project.'springframework.version'
+ compile 'org.springframework:spring-expression:' + project.'springframework.version'
+ compile 'org.springframework:spring-web:' + project.'springframework.version'
+ compile 'org.springframework:spring-webmvc:' + project.'springframework.version'
+ compile 'com.github.stephenc.findbugs:findbugs-annotations:' + project.'stephenc-findbugs.version'
+
- testCompile 'com.jayway.awaitility:awaitility:' + project.'awaitility.version'
+ testCompile 'com.github.stefanbirkner:system-rules:' + project.'system-rules.version'
++ testCompile 'com.jayway.awaitility:awaitility:' + project.'awaitility.version'
+ testCompile 'edu.umd.cs.mtc:multithreadedtc:' + project.'multithreadedtc.version'
++ testCompile 'eu.codearte.catch-exception:catch-exception:' + project.'catch-exception.version'
++ testCompile 'eu.codearte.catch-exception:catch-throwable:' + project.'catch-throwable.version'
+ testCompile 'junit:junit:' + project.'junit.version'
+ testCompile 'org.assertj:assertj-core:' + project.'assertj-core.version'
- testCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'
+ testCompile 'org.hamcrest:hamcrest-all:' + project.'hamcrest-all.version'
+ testCompile 'org.jmock:jmock:' + project.'jmock.version'
+ testCompile 'org.jmock:jmock-junit4:' + project.'jmock.version'
+ testCompile 'org.jmock:jmock-legacy:' + project.'jmock.version'
++ testCompile 'org.mockito:mockito-core:' + project.'mockito-core.version'
+ testCompile 'pl.pragmatists:JUnitParams:' + project.'JUnitParams.version'
+
+ testRuntime 'cglib:cglib:' + project.'cglib.version'
+ testRuntime 'org.objenesis:objenesis:' + project.'objenesis.version'
+ testRuntime 'org.ow2.asm:asm:' + project.'asm.version'
}
test {
@@@ -345,12 -373,15 +375,14 @@@
task distributedTest(type:Test) {
include '**/*DUnitTest.class'
- // exclde all categories so that dunitTest task is only task executing categorized dunit tests
+ // maxParallelForks = 2
+ // maxParallelForks = Runtime.runtime.availableProcessors()
+
-// TODO add @Category(DistributedTest.class) to dunit tests
-// useJUnit {
-// excludeCategories 'com.gemstone.gemfire.test.junit.categories.UnitTest'
-// excludeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
-// includeCategories 'com.gemstone.gemfire.test.junit.categories.DistributedTest'
-// }
+ useJUnit {
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.UnitTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
- excludeCategories 'com.gemstone.gemfire.test.junit.categories.DistributedTest'
++ includeCategories 'com.gemstone.gemfire.test.junit.categories.DistributedTest'
+ }
//I'm hoping this might deal with SOME OOMEs I've seen
forkEvery 30
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/DebuggerSupport.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/DebuggerSupport.java
index f7d4fcb,49ce32e..b022700
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/DebuggerSupport.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/DebuggerSupport.java
@@@ -8,14 -17,9 +17,12 @@@
package com.gemstone.gemfire.internal.util;
-import com.gemstone.gemfire.i18n.LogWriterI18n;
+import org.apache.logging.log4j.Logger;
+
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
- import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
/**
*
* @author Eric Zoerner
@@@ -29,12 -32,12 +36,12 @@@ public abstract class DebuggerSupport
}
/** Debugger support */
- public static void waitForJavaDebugger(LogWriterI18n logger) {
- waitForJavaDebugger(logger, null);
+ public static void waitForJavaDebugger() {
+ waitForJavaDebugger(null);
}
- @SuppressFBWarnings(value="IL_INFINITE_LOOP", justification="Endless loop is for debugging purposes.")
+ @edu.umd.cs.findbugs.annotations.SuppressWarnings(value="IL_INFINITE_LOOP", justification="Endless loop is for debugging purposes.")
- public static void waitForJavaDebugger(LogWriterI18n logger, String extraLogMsg) {
+ public static void waitForJavaDebugger(String extraLogMsg) {
boolean cont = false;
String msg = ":";
if (extraLogMsg != null)
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/DistributedMemberDUnitTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
index 4588651,6a622e3..0b5048a
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/HostedLocatorsDUnitTest.java
@@@ -1,14 -1,22 +1,30 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.gemstone.gemfire.distributed;
+import static com.gemstone.gemfire.test.dunit.DUnitTestRule.*;
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+import static com.jayway.awaitility.Awaitility.*;
+import static java.util.concurrent.TimeUnit.*;
+import static org.assertj.core.api.Assertions.*;
+import static org.junit.Assert.*;
+
import java.io.File;
+import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupDUnitTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
index 72b64e6,2c351be..eb67628
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/OutOfOffHeapMemoryDUnitTest.java
@@@ -1,10 -1,21 +1,26 @@@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.gemstone.gemfire.internal.offheap;
+import static com.gemstone.gemfire.test.dunit.ExpectedExceptionString.*;
+import static com.gemstone.gemfire.test.dunit.Invoke.*;
+import static com.gemstone.gemfire.test.dunit.Wait.*;
+import static org.junit.Assert.*;
+
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/internal/process/PidFileJUnitTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestSuite.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestSuite.java
index ef2686e,0000000..6748386
mode 100755,000000..100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestSuite.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/test/golden/GoldenTestSuite.java
@@@ -1,27 -1,0 +1,43 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+package com.gemstone.gemfire.test.golden;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ FailWithErrorInOutputJUnitTest.class,
+ FailWithExtraLineInOutputJUnitTest.class,
+ FailWithLineMissingFromEndOfOutputJUnitTest.class,
+ FailWithLineMissingFromMiddleOfOutputJUnitTest.class,
+ FailWithLoggerErrorInOutputJUnitTest.class,
+ FailWithLoggerFatalInOutputJUnitTest.class,
+ FailWithLoggerWarnInOutputJUnitTest.class,
+ FailWithSevereInOutputJUnitTest.class,
+ FailWithTimeoutOfWaitForOutputToMatchJUnitTest.class,
+ FailWithWarningInOutputJUnitTest.class,
+ PassJUnitTest.class,
+ PassWithExpectedErrorJUnitTest.class,
+ PassWithExpectedSevereJUnitTest.class,
+ PassWithExpectedWarningJUnitTest.class,
+})
+/**
+ * Suite of tests for the test.golden Golden Test framework classes.
+ */
+public class GoldenTestSuite {
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/dunit/DistributedTestCase.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/dunit/DistributedTestCase.java
index d26d3e1,a3d4785..c43f61c
--- a/gemfire-core/src/test/java/dunit/DistributedTestCase.java
+++ b/gemfire-core/src/test/java/dunit/DistributedTestCase.java
@@@ -544,20 -559,8 +559,8 @@@ public abstract class DistributedTestCa
* NOTE: if you use this method be sure that you clean up the VM before the end of your
* test with disconnectFromDS() or disconnectAllFromDS().
*/
- public void crashDistributedSystem(final DistributedSystem msys) {
+ public static void crashDistributedSystem(final DistributedSystem msys) {
- MembershipManagerHelper.inhibitForcedDisconnectLogging(true);
- MembershipManagerHelper.playDead(msys);
- JChannel c = MembershipManagerHelper.getJChannel(msys);
- Protocol udp = c.getProtocolStack().findProtocol("UDP");
- udp.stop();
- udp.passUp(new Event(Event.EXIT, new RuntimeException("killing member's ds")));
- try {
- MembershipManagerHelper.getJChannel(msys).waitForClose();
- }
- catch (InterruptedException ie) {
- Thread.currentThread().interrupt();
- // attempt rest of work with interrupt bit set
- }
+ MembershipManagerHelper.crashDistributedSystem(msys);
MembershipManagerHelper.inhibitForcedDisconnectLogging(false);
WaitCriterion wc = new WaitCriterion() {
public boolean done() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/dunit/VM.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
----------------------------------------------------------------------
diff --cc gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
index 965b1ab,60ac04d..4d89d01
--- a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
+++ b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java
@@@ -148,16 -168,14 +168,14 @@@ public class ProcessManager
"-D" + DUnitLauncher.WORKSPACE_DIR_PARAM + "=" + new File(".").getAbsolutePath(),
"-DlogLevel=" + DUnitLauncher.LOG_LEVEL,
"-Djava.library.path=" + System.getProperty("java.library.path"),
- "-Xrunjdwp:transport=dt_socket,server=y,suspend=n",
+ "-Xrunjdwp:transport=dt_socket,server=y,suspend=" + jdkSuspend + jdkDebug,
"-XX:+HeapDumpOnOutOfMemoryError",
"-Xmx512m",
- "-XX:MaxPermSize=256M",
"-Dgemfire.DEFAULT_MAX_OPLOG_SIZE=10",
"-Dgemfire.disallowMcastDefaults=true",
- "-XX:MaxPermSize=256M",
"-ea",
agent,
- "dunit.standalone.ChildVM"
+ ChildVM.class.getName()
};
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
----------------------------------------------------------------------
diff --cc gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
index bf6456f,0000000..7b6d345
mode 100755,000000..100755
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
+++ b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
@@@ -1,164 -1,0 +1,180 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+package com.gemstone.gemfire.test.junit.rules;
+
+import static org.junit.Assert.assertThat;
+
+import java.util.concurrent.TimeUnit;
+
+import org.hamcrest.Matcher;
+import org.junit.rules.ExpectedException;
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+/**
+ * Expect an Exception within a specified timeout.
+ *
+ * @author Kirk Lund
+ * @since 8.2
+ */
+public class ExpectedTimeoutRule implements TestRule {
+
+ /**
+ * @return a Rule that expects no timeout (identical to behavior without this Rule)
+ */
+ public static ExpectedTimeoutRule none() {
+ return new ExpectedTimeoutRule();
+ }
+
+ private ExpectedException delegate;
+ private boolean expectsThrowable;
+ private long minDuration;
+ private long maxDuration;
+ private TimeUnit timeUnit;
+
+ private ExpectedTimeoutRule() {
+ this.delegate = ExpectedException.none();
+ }
+
+ public ExpectedTimeoutRule expectMinimumDuration(final long minDuration) {
+ this.minDuration = minDuration;
+ return this;
+ }
+ public ExpectedTimeoutRule expectMaximumDuration(final long maxDuration) {
+ this.maxDuration = maxDuration;
+ return this;
+ }
+ public ExpectedTimeoutRule expectTimeUnit(final TimeUnit timeUnit) {
+ this.timeUnit = timeUnit;
+ return this;
+ }
+
+ public ExpectedTimeoutRule handleAssertionErrors() {
+ this.delegate.handleAssertionErrors();
+ return this;
+ }
+
+ public ExpectedTimeoutRule handleAssumptionViolatedExceptions() {
+ this.delegate.handleAssumptionViolatedExceptions();
+ return this;
+ }
+
+ /**
+ * Adds {@code matcher} to the list of requirements for any thrown
+ * exception.
+ */
+ public void expect(final Matcher<?> matcher) {
+ this.delegate.expect(matcher);
+ }
+
+ /**
+ * Adds to the list of requirements for any thrown exception that it should
+ * be an instance of {@code type}
+ */
+ public void expect(final Class<? extends Throwable> type) {
+ this.delegate.expect(type);
+ this.expectsThrowable = true;
+ }
+
+ /**
+ * Adds to the list of requirements for any thrown exception that it should
+ * <em>contain</em> string {@code substring}
+ */
+ public void expectMessage(final String substring) {
+ this.delegate.expectMessage(substring);
+ }
+
+ /**
+ * Adds {@code matcher} to the list of requirements for the message returned
+ * from any thrown exception.
+ */
+ public void expectMessage(final Matcher<String> matcher) {
+ this.delegate.expectMessage(matcher);
+ }
+
+ /**
+ * Adds {@code matcher} to the list of requirements for the cause of
+ * any thrown exception.
+ */
+ public void expectCause(final Matcher<? extends Throwable> expectedCause) {
+ this.delegate.expectCause(expectedCause);
+ }
+
+ public boolean expectsTimeout() {
+ return minDuration > 0 || maxDuration > 0;
+ }
+
+ public boolean expectsThrowable() {
+ return expectsThrowable = true;
+ }
+
+ @Override
+ public Statement apply(final Statement base, final Description description) {
+ Statement next = delegate.apply(base, description);
+ return new ExpectedTimeoutStatement(next);
+ }
+
+ private void handleTime(final Long duration) {
+ if (expectsTimeout()) {
+ assertThat(timeUnit.convert(duration, TimeUnit.NANOSECONDS), new TimeMatcher(timeUnit, minDuration, maxDuration));
+ }
+ }
+
+ private static class TimeMatcher extends org.hamcrest.TypeSafeMatcher<Long> {
+
+ private final TimeUnit timeUnit;
+ private final long minDuration;
+ private final long maxDuration;
+
+ public TimeMatcher(final TimeUnit timeUnit, final long minDuration, final long maxDuration) {
+ this.timeUnit = timeUnit;
+ this.minDuration = minDuration;
+ this.maxDuration = maxDuration;
+ }
+
+ @Override
+ public boolean matchesSafely(final Long duration) {
+ return duration >= this.minDuration && duration <= this.maxDuration;
+ }
+
+ @Override
+ public void describeTo(final org.hamcrest.Description description) {
+ description.appendText("expects duration to be greater than or equal to ")
+ .appendValue(this.minDuration)
+ .appendText(" and less than or equal to ")
+ .appendValue(this.maxDuration)
+ .appendText(" ")
+ .appendValue(this.timeUnit);
+ }
+ }
+
+ private class ExpectedTimeoutStatement extends Statement {
+ private final Statement next;
+
+ public ExpectedTimeoutStatement(final Statement base) {
+ next = base;
+ }
+
+ @Override
+ public void evaluate() throws Throwable {
+ long start = System.nanoTime();
+ next.evaluate();
+ handleTime(System.nanoTime() - start);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/tests/ExpectedTimeoutRuleJUnitTest.java
----------------------------------------------------------------------
diff --cc gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/tests/ExpectedTimeoutRuleJUnitTest.java
index 41ef275,0000000..67c285a
mode 100755,000000..100755
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/tests/ExpectedTimeoutRuleJUnitTest.java
+++ b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/tests/ExpectedTimeoutRuleJUnitTest.java
@@@ -1,198 -1,0 +1,214 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ *
++ * http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+package com.gemstone.gemfire.test.junit.rules.tests;
+
+import static com.gemstone.gemfire.test.junit.rules.tests.RunTest.*;
+import static org.assertj.core.api.Assertions.*;
+
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.Result;
+import org.junit.runner.notification.Failure;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.rules.ExpectedTimeoutRule;
+
+/**
+ * Unit tests for ExpectedTimeout JUnit Rule.
+ *
+ * @author Kirk Lund
+ * @since 8.2
+ */
+@Category(UnitTest.class)
+public class ExpectedTimeoutRuleJUnitTest {
+
+ @Test
+ public void passesUnused() {
+ Result result = runTest(PassingTestShouldPassWhenUnused.class);
+
+ assertThat(result.wasSuccessful()).isTrue();
+ }
+
+ @Test
+ public void failsWithoutExpectedException() {
+ Result result = runTest(FailsWithoutExpectedException.class);
+
+ assertThat(result.wasSuccessful()).isFalse();
+
+ List<Failure> failures = result.getFailures();
+ assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);
+
+ Failure failure = failures.get(0);
+ assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class).hasMessage("Expected test to throw an instance of " + TimeoutException.class.getName());
+ }
+
+ @Test
+ public void failsWithoutExpectedTimeoutException() {
+ Result result = runTest(FailsWithoutExpectedTimeoutException.class);
+
+ assertThat(result.wasSuccessful()).isFalse();
+
+ List<Failure> failures = result.getFailures();
+ assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);
+
+ Failure failure = failures.get(0);
+ assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class).hasMessage("Expected test to throw (an instance of " + TimeoutException.class.getName() + " and exception with message a string containing \"" + FailsWithoutExpectedTimeoutException.message + "\")");
+ }
+
+ @Test
+ public void failsWithExpectedTimeoutButWrongError() {
+ Result result = runTest(FailsWithExpectedTimeoutButWrongError.class);
+
+ assertThat(result.wasSuccessful()).isFalse();
+
+ List<Failure> failures = result.getFailures();
+ assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);
+
+ Failure failure = failures.get(0);
+ String expectedMessage =
+ "\n" +
+ "Expected: (an instance of java.util.concurrent.TimeoutException and exception with message a string containing \"this is a message for FailsWithExpectedTimeoutButWrongError\")" +
+ "\n" +
+ " " +
+ "but: an instance of java.util.concurrent.TimeoutException <java.lang.NullPointerException> is a java.lang.NullPointerException";
+ assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class).hasMessageContaining(expectedMessage);
+ }
+
+ @Test
+ public void passesWithExpectedTimeoutAndTimeoutException() {
+ Result result = runTest(PassesWithExpectedTimeoutAndTimeoutException.class);
+
+ assertThat(result.wasSuccessful()).isTrue();
+ }
+
+ @Test
+ public void failsWhenTimeoutIsEarly() {
+ Result result = runTest(FailsWhenTimeoutIsEarly.class);
+
+ assertThat(result.wasSuccessful()).isFalse();
+
+ List<Failure> failures = result.getFailures();
+ assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);
+
+ Failure failure = failures.get(0);
+ assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class).hasMessage("Expected test to throw (an instance of " + TimeoutException.class.getName() + " and exception with message a string containing \"" + FailsWhenTimeoutIsEarly.message + "\")");
+ }
+
+ @Test
+ public void failsWhenTimeoutIsLate() {
+ Result result = runTest(FailsWhenTimeoutIsLate.class);
+
+ assertThat(result.wasSuccessful()).isFalse();
+
+ List<Failure> failures = result.getFailures();
+ assertThat(failures.size()).as("Failures: " + failures).isEqualTo(1);
+
+ Failure failure = failures.get(0);
+ assertThat(failure.getException()).isExactlyInstanceOf(AssertionError.class).hasMessage("Expected test to throw (an instance of " + TimeoutException.class.getName() + " and exception with message a string containing \"" + FailsWhenTimeoutIsLate.message + "\")");
+ }
+
+ public static class AbstractExpectedTimeoutRuleTest {
+ @Rule
+ public ExpectedTimeoutRule timeout = ExpectedTimeoutRule.none();
+ }
+
+ public static class PassingTestShouldPassWhenUnused extends AbstractExpectedTimeoutRuleTest {
+ @Test
+ public void passesUnused() throws Exception {
+ }
+ }
+
+ public static class FailsWithoutExpectedException extends AbstractExpectedTimeoutRuleTest {
+ @Test
+ public void failsWithoutExpectedException() throws Exception {
+ timeout.expect(TimeoutException.class);
+ }
+ }
+
+ public static class FailsWithoutExpectedTimeoutException extends AbstractExpectedTimeoutRuleTest {
+ public static final String message = "this is a message for FailsWithoutExpectedTimeoutException";
+ @Test
+ public void failsWithoutExpectedTimeoutAndTimeoutException() throws Exception {
+ timeout.expect(TimeoutException.class);
+ timeout.expectMessage(message);
+ timeout.expectMinimumDuration(10);
+ timeout.expectMaximumDuration(1000);
+ timeout.expectTimeUnit(TimeUnit.MILLISECONDS);
+ Thread.sleep(100);
+ }
+ }
+
+ public static class FailsWithExpectedTimeoutButWrongError extends AbstractExpectedTimeoutRuleTest {
+ public static final String message = "this is a message for FailsWithExpectedTimeoutButWrongError";
+ @Test
+ public void failsWithExpectedTimeoutButWrongError() throws Exception {
+ timeout.expect(TimeoutException.class);
+ timeout.expectMessage(message);
+ timeout.expectMinimumDuration(10);
+ timeout.expectMaximumDuration(1000);
+ timeout.expectTimeUnit(TimeUnit.MILLISECONDS);
+ Thread.sleep(100);
+ throw new NullPointerException();
+ }
+ }
+
+ public static class PassesWithExpectedTimeoutAndTimeoutException extends AbstractExpectedTimeoutRuleTest {
+ public static final String message = "this is a message for PassesWithExpectedTimeoutAndTimeoutException";
+ public static final Class<TimeoutException> exceptionClass = TimeoutException.class;
+ @Test
+ public void passesWithExpectedTimeoutAndTimeoutException() throws Exception {
+ timeout.expect(exceptionClass);
+ timeout.expectMessage(message);
+ timeout.expectMinimumDuration(10);
+ timeout.expectMaximumDuration(1000);
+ timeout.expectTimeUnit(TimeUnit.MILLISECONDS);
+ Thread.sleep(100);
+ throw new TimeoutException(message);
+ }
+ }
+
+ public static class FailsWhenTimeoutIsEarly extends AbstractExpectedTimeoutRuleTest {
+ public static final String message = "this is a message for FailsWhenTimeoutIsEarly";
+ @Test
+ public void failsWhenTimeoutIsEarly() throws Exception {
+ timeout.expect(TimeoutException.class);
+ timeout.expectMessage(message);
+ timeout.expectMinimumDuration(1000);
+ timeout.expectMaximumDuration(2000);
+ timeout.expectTimeUnit(TimeUnit.MILLISECONDS);
+ Thread.sleep(10);
+ }
+ }
+
+ public static class FailsWhenTimeoutIsLate extends AbstractExpectedTimeoutRuleTest {
+ public static final String message = "this is a message for FailsWhenTimeoutIsLate";
+ @Test
+ public void failsWhenTimeoutIsLate() throws Exception {
+ timeout.expect(TimeoutException.class);
+ timeout.expectMessage(message);
+ timeout.expectMinimumDuration(10);
+ timeout.expectMaximumDuration(20);
+ timeout.expectTimeUnit(TimeUnit.MILLISECONDS);
+ Thread.sleep(100);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4c72833c/gradle/dependency-versions.properties
----------------------------------------------------------------------
diff --cc gradle/dependency-versions.properties
index 0000000,3e6b6a5..160ff5b
mode 000000,100644..100644
--- a/gradle/dependency-versions.properties
+++ b/gradle/dependency-versions.properties
@@@ -1,0 -1,65 +1,67 @@@
+ # Buildscript Dependencies
+ gradle-maven-publish-auth.version = 2.0.1
+
+ # Dependency versions
+ activation.version = 1.1.1
+ annotations.version = 3.0.0
+ antlr.version = 2.7.7
+ asm.version = 5.0.3
-assertj-core.version = 2.1.0
++assertj-core.version = 3.1.0
+ awaitility.version = 1.6.5
+ bcel.version = 5.2
++catch-exception.version = 1.4.4
++catch-throwable.version = 1.4.4
+ cglib.version = 3.1
+ classmate.version = 0.9.0
+ commons-collections.version = 3.2.1
+ commons-configuration.version = 1.6
+ commons-fileupload.version = 1.3.1
+ commons-io.version = 2.3
+ commons-lang.version = 2.5
+ commons-logging.version = 1.1.1
+ commons-modeler.version = 2.0
+ derby.version = 10.2.2.0
+ fastutil.version = 7.0.2
+ guava.version = 15.0
+ hadoop.version = 2.4.1
+ hamcrest-all.version = 1.3
+ hbase.version = 0.94.27
+ jackson.version = 2.2.0
+ jackson-module-scala_2.10.version = 2.1.5
+ jansi.version = 1.8
+ javax.mail-api.version = 1.4.5
+ javax.resource-api.version = 1.7
+ javax.servlet-api.version = 3.1.0
+ javax.transaction-api.version = 1.2
+ jedis.version = 2.7.2
+ jetty.version = 9.3.6.v20151106
+ jline.version = 1.0.S2-B
+ jmock.version = 2.8.1
+ jna.version = 4.0.0
+ json4s.version = 3.2.4
+ junit.version = 4.12
+ JUnitParams.version = 1.0.4
+ log4j.version = 2.1
+ lucene.version = 5.3.0
+ mockito-core.version = 1.10.19
+ multithreadedtc.version = 1.01
+ mx4j.version = 3.0.1
+ mx4j-remote.version = 3.0.1
+ mx4j-tools.version = 3.0.1
+ netty-all.version = 4.0.4.Final
+ objenesis.version = 2.1
+ paranamer.version = 2.3
+ quartz.version = 2.2.1
+ scala.version = 2.10.0
+ slf4j-api.version = 1.7.7
+ snappy-java.version = 1.1.1.6
+ spring-data-commons.version = 1.9.1.RELEASE
+ spring-data-gemfire.version = 1.5.1.RELEASE
+ spring-hateos.version = 0.16.0.RELEASE
+ spring-shell.version = 1.0.0.RELEASE
+ springframework.version = 3.2.12.RELEASE
+ stephenc-findbugs.version = 1.3.9-1
+ spymemcached.version = 2.9.0
+ swagger.version = 1.3.2
+ swagger-springmvc.version = 0.8.2
+ system-rules.version = 1.12.1