You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ab...@apache.org on 2016/02/01 22:52:27 UTC
[2/4] incubator-geode git commit: GEODE-883: Reorganize code in
gemfire-junit
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java b/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
new file mode 100755
index 0000000..b721c41
--- /dev/null
+++ b/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
@@ -0,0 +1,57 @@
+/*
+ * 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.support;
+
+import org.junit.runner.Description;
+import com.gemstone.gemfire.test.junit.IgnoreCondition;
+
+/**
+ * The DefaultIgnoreCondition class...
+ *
+ * @author John Blum
+ * @see org.junit.runner.Description
+ * @see com.gemstone.gemfire.test.junit.ConditionalIgnore
+ * @see com.gemstone.gemfire.test.junit.IgnoreCondition
+ */
+@SuppressWarnings("unused")
+public class DefaultIgnoreCondition implements IgnoreCondition {
+
+ public static final boolean DEFAULT_IGNORE = false;
+
+ public static final DefaultIgnoreCondition DO_NOT_IGNORE = new DefaultIgnoreCondition(false);
+ public static final DefaultIgnoreCondition IGNORE = new DefaultIgnoreCondition(true);
+
+ private final boolean ignore;
+
+ public DefaultIgnoreCondition() {
+ this(DEFAULT_IGNORE);
+ }
+
+ public DefaultIgnoreCondition(final boolean ignore) {
+ this.ignore = ignore;
+ }
+
+ public boolean isIgnore() {
+ return ignore;
+ }
+
+ @Override
+ public boolean evaluate(final Description testCaseDescription) {
+ return isIgnore();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/IgnoreConditionEvaluationException.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/IgnoreConditionEvaluationException.java b/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/IgnoreConditionEvaluationException.java
new file mode 100755
index 0000000..0d8a321
--- /dev/null
+++ b/gemfire-junit/src/main/java/com/gemstone/gemfire/test/junit/support/IgnoreConditionEvaluationException.java
@@ -0,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.junit.support;
+
+/**
+ * The IgnoreConditionEvaluationException class...
+ *
+ * @author John Blum
+ * @see java.lang.RuntimeException
+ */
+@SuppressWarnings({ "serial", "unused" })
+public class IgnoreConditionEvaluationException extends RuntimeException {
+
+ public IgnoreConditionEvaluationException() {
+ }
+
+ public IgnoreConditionEvaluationException(final String message) {
+ super(message);
+ }
+
+ public IgnoreConditionEvaluationException(final Throwable cause) {
+ super(cause);
+ }
+
+ public IgnoreConditionEvaluationException(final String message, final Throwable cause) {
+ super(message, cause);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/ConditionalIgnore.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/ConditionalIgnore.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/ConditionalIgnore.java
deleted file mode 100755
index b409cb1..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/ConditionalIgnore.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import com.gemstone.gemfire.test.junit.support.DefaultIgnoreCondition;
-
-/**
- * The ConditionalIgnore class is a Java Annotation used to annotated a test suite class test case method in order to
- * conditionally ignore the test case for a fixed amount of time, or based on a predetermined condition provided by
- * the IgnoreCondition interface.
- *
- * @author John Blum
- * @see java.lang.annotation.Annotation
- * @see com.gemstone.gemfire.test.junit.IgnoreCondition
- * @see com.gemstone.gemfire.test.junit.support.DefaultIgnoreCondition
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE, ElementType.METHOD })
-@SuppressWarnings("unused")
-public @interface ConditionalIgnore {
-
- Class<? extends IgnoreCondition> condition() default DefaultIgnoreCondition.class;
-
- String until() default "1970-01-01";
-
- String value() default "";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreCondition.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreCondition.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreCondition.java
deleted file mode 100755
index 0caa959..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreCondition.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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;
-
-import org.junit.runner.Description;
-
-/**
- * The IgnoreCondition class...
- *
- * @author John Blum
- * @see org.junit.runner.Description
- */
-@SuppressWarnings("unused")
-public interface IgnoreCondition {
-
- boolean evaluate(Description testCaseDescription);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreUntil.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreUntil.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreUntil.java
deleted file mode 100755
index 5910d10..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/IgnoreUntil.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import com.gemstone.gemfire.test.junit.support.DefaultIgnoreCondition;
-
-/**
- * The IgnoreUntil class is a Java Annotation used to annotated a test suite class test case method in order to
- * conditionally ignore the test case for a fixed amount of time, or based on a predetermined condition provided by
- * the IgnoreCondition interface.
- *
- * @author John Blum
- * @see java.lang.annotation.Annotation
- * @see com.gemstone.gemfire.test.junit.IgnoreCondition
- * @see com.gemstone.gemfire.test.junit.support.DefaultIgnoreCondition
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE, ElementType.METHOD })
-@SuppressWarnings("unused")
-public @interface IgnoreUntil {
-
- Class<? extends IgnoreCondition> condition() default DefaultIgnoreCondition.class;
-
- String until() default "1970-01-01";
-
- String value() default "";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Repeat.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Repeat.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Repeat.java
deleted file mode 100755
index 5cfa321..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Repeat.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * The Repeat class is a Java Annotation enabling an annotated test suite class test case method to be repeated
- * a specified number of iterations.
- *
- * @author John Blum
- * @see java.lang.annotation.Annotation
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD })
-@SuppressWarnings("unused")
-public @interface Repeat {
-
- public static int DEFAULT = 1;
-
- int value() default DEFAULT;
-
- String property() default "";
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Retry.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Retry.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Retry.java
deleted file mode 100755
index 65f3cf6..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/Retry.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Java Annotation used to annotate a test suite class test case method in order to
- * retry it in case of failure up to the specified maximum attempts.
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD })
-public @interface Retry {
-
- public static int DEFAULT = 1;
-
- int value() default DEFAULT;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/ContainerTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/ContainerTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/ContainerTest.java
deleted file mode 100755
index 8eec738..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/ContainerTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test executes within a container
- * environment such as an OSGi server.
- *
- * @author Kirk Lund
- */
-public interface ContainerTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTest.java
deleted file mode 100644
index 6aa538b..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test involving multiple members of a
- * distributed system.
- *
- * @author Kirk Lund
- */
-public interface DistributedTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTransactionsTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTransactionsTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTransactionsTest.java
deleted file mode 100644
index 1892ddd..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/DistributedTransactionsTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.categories;
-
-/**
- * Unit test category that specifies tests for distributed transactions
- * functionality
- * @author shirishd
- */
-public interface DistributedTransactionsTest {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/HydraTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/HydraTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/HydraTest.java
deleted file mode 100755
index 4fe535b..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/HydraTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a hydra test.
- *
- * @author Kirk Lund
- */
-public interface HydraTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/IntegrationTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/IntegrationTest.java
deleted file mode 100644
index 1be6e45..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/IntegrationTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test involving inter-operation of
- * components or subsystems.
- *
- * @author Kirk Lund
- */
-public interface IntegrationTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/PerformanceTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/PerformanceTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/PerformanceTest.java
deleted file mode 100644
index ad952be..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/PerformanceTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test that measures performance.
- *
- * @author Kirk Lund
- */
-public interface PerformanceTest {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UITest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UITest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UITest.java
deleted file mode 100644
index 834931a..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UITest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test involving a browser present to test the UI
- *
- * @author Jinmei Liao
- */
-public interface UITest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UnitTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UnitTest.java
deleted file mode 100644
index d5be9e8..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UnitTest.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.categories;
-/**
- * JUnit Test Category that specifies a test with very narrow and well defined
- * scope. Any complex dependencies and interactions are stubbed or mocked.
- *
- * @author Kirk Lund
- */
-public interface UnitTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/WanTest.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/WanTest.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/WanTest.java
deleted file mode 100644
index 9abf15b..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/WanTest.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * 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.categories;
-/**
- * Tests Wan Feature.
- *
- * @author Kirk Lund
- */
-public interface WanTest {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ConditionalIgnoreRule.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ConditionalIgnoreRule.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ConditionalIgnoreRule.java
deleted file mode 100755
index 80898b5..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ConditionalIgnoreRule.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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 java.io.Serializable;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-import org.junit.AssumptionViolatedException;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-import com.gemstone.gemfire.test.junit.ConditionalIgnore;
-import com.gemstone.gemfire.test.junit.IgnoreCondition;
-import com.gemstone.gemfire.test.junit.support.IgnoreConditionEvaluationException;
-
-/**
- * The ConditionalIgnoreRule class...
- *
- * @author John Blum
- * @see org.junit.rules.TestRule
- * @see org.junit.runner.Description
- * @see org.junit.runners.model.Statement
- * @see com.gemstone.gemfire.test.junit.ConditionalIgnore
- * @see com.gemstone.gemfire.test.junit.IgnoreCondition
- */
-@SuppressWarnings({ "serial", "unused" })
-public class ConditionalIgnoreRule implements TestRule, Serializable {
-
- protected static final String DATE_FORMAT_PATTERN = "yyyy-MM-dd";
- protected static final String DEFAULT_MESSAGE = "Ignoring test case (%1$s) of test class (%2$s)!";
-
- protected static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_PATTERN);
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return new Statement() {
- @Override public void evaluate() throws Throwable {
- ConditionalIgnoreRule.this.evaluate(base, description);
- }
- };
- }
-
- public final void evaluate(Statement statement, Description description) throws Throwable {
- throwOnIgnoreTest(statement, description).evaluate();
- }
-
- protected Statement throwOnIgnoreTest(Statement statement, Description description) {
- if (isTest(description)) {
- boolean ignoreTest = false;
- String message = "";
-
- ConditionalIgnore testCaseAnnotation = description.getAnnotation(ConditionalIgnore.class);
-
- if (testCaseAnnotation != null) {
- ignoreTest = evaluate(testCaseAnnotation, description);
- message = testCaseAnnotation.value();
- }
- else if (description.getTestClass().isAnnotationPresent(ConditionalIgnore.class)) {
- ConditionalIgnore testClassAnnotation = description.getTestClass().getAnnotation(ConditionalIgnore.class);
-
- ignoreTest = evaluate(testClassAnnotation, description);
- message = testClassAnnotation.value();
- }
-
- if (ignoreTest) {
- throw new AssumptionViolatedException(format(message, description));
- }
- }
-
- return statement;
- }
-
- protected boolean isTest(final Description description) {
- return (description.isSuite() || description.isTest());
- }
-
- protected String format(String message, Description description) {
- message = (!message.isEmpty() ? message : DEFAULT_MESSAGE);
- return String.format(message, description.getMethodName(), description.getClassName());
- }
-
- protected boolean evaluate(ConditionalIgnore conditionalIgnoreAnnotation, Description description) {
- return (evaluateCondition(conditionalIgnoreAnnotation.condition(), description)
- || evaluateUntil(conditionalIgnoreAnnotation.until()));
- }
-
- protected boolean evaluateCondition(Class<? extends IgnoreCondition> ignoreConditionType, Description description) {
- try {
- return ignoreConditionType.newInstance().evaluate(description);
- }
- catch (Exception e) {
- throw new IgnoreConditionEvaluationException(String.format("failed to evaluate IgnoreCondition: %1$s",
- ignoreConditionType.getName()), e);
- }
- }
-
- protected boolean evaluateUntil(String timestamp) {
- try {
- return DATE_FORMAT.parse(timestamp).after(Calendar.getInstance().getTime());
- }
- catch (ParseException e) {
- return false;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeout.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeout.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeout.java
deleted file mode 100755
index 2f53811..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeout.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * 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 ExpectedTimeout implements TestRule {
-
- /**
- * @return a Rule that expects no timeout (identical to behavior without this Rule)
- */
- public static ExpectedTimeout none() {
- return new ExpectedTimeout();
- }
-
- private ExpectedException delegate;
- private boolean expectsThrowable;
- private long minDuration;
- private long maxDuration;
- private TimeUnit timeUnit;
-
- private ExpectedTimeout() {
- this.delegate = ExpectedException.none();
- }
-
- public ExpectedTimeout expectMinimumDuration(final long minDuration) {
- this.minDuration = minDuration;
- return this;
- }
- public ExpectedTimeout expectMaximumDuration(final long maxDuration) {
- this.maxDuration = maxDuration;
- return this;
- }
- public ExpectedTimeout expectTimeUnit(final TimeUnit timeUnit) {
- this.timeUnit = timeUnit;
- return this;
- }
-
- public ExpectedTimeout handleAssertionErrors() {
- this.delegate.handleAssertionErrors();
- return this;
- }
-
- public ExpectedTimeout 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/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
----------------------------------------------------------------------
diff --git 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
deleted file mode 100755
index 7b6d345..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/ExpectedTimeoutRule.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * 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/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/IgnoreUntilRule.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/IgnoreUntilRule.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/IgnoreUntilRule.java
deleted file mode 100755
index bf4ec3f..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/IgnoreUntilRule.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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 java.io.Serializable;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-import org.junit.AssumptionViolatedException;
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-import com.gemstone.gemfire.test.junit.IgnoreUntil;
-import com.gemstone.gemfire.test.junit.IgnoreCondition;
-import com.gemstone.gemfire.test.junit.support.IgnoreConditionEvaluationException;
-
-/**
- * The IgnoreUntilRule class...
- *
- * @author John Blum
- * @see org.junit.rules.TestRule
- * @see org.junit.runner.Description
- * @see org.junit.runners.model.Statement
- * @see com.gemstone.gemfire.test.junit.IgnoreUntil
- * @see com.gemstone.gemfire.test.junit.IgnoreCondition
- */
-@SuppressWarnings({ "serial", "unused" })
-public class IgnoreUntilRule implements TestRule, Serializable {
-
- protected static final String DATE_FORMAT_PATTERN = "yyyy-MM-dd";
- protected static final String DEFAULT_MESSAGE = "Ignoring test case (%1$s) of test class (%2$s)!";
-
- protected static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_PATTERN);
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return new Statement() {
- @Override public void evaluate() throws Throwable {
- IgnoreUntilRule.this.evaluate(base, description);
- }
- };
- }
-
- public final void evaluate(Statement statement, Description description) throws Throwable {
- throwOnIgnoreTest(statement, description).evaluate();
- }
-
- protected Statement throwOnIgnoreTest(Statement statement, Description description) {
- if (isTest(description)) {
- boolean ignoreTest = false;
- String message = "";
-
- IgnoreUntil testCaseAnnotation = description.getAnnotation(IgnoreUntil.class);
-
- if (testCaseAnnotation != null) {
- ignoreTest = evaluate(testCaseAnnotation, description);
- message = testCaseAnnotation.value();
- }
- else if (description.getTestClass().isAnnotationPresent(IgnoreUntil.class)) {
- IgnoreUntil testClassAnnotation = description.getTestClass().getAnnotation(IgnoreUntil.class);
-
- ignoreTest = evaluate(testClassAnnotation, description);
- message = testClassAnnotation.value();
- }
-
- if (ignoreTest) {
- throw new AssumptionViolatedException(format(message, description));
- }
- }
-
- return statement;
- }
-
- protected boolean isTest(final Description description) {
- return (description.isSuite() || description.isTest());
- }
-
- protected String format(String message, Description description) {
- message = (!message.isEmpty() ? message : DEFAULT_MESSAGE);
- return String.format(message, description.getMethodName(), description.getClassName());
- }
-
- protected boolean evaluate(IgnoreUntil conditionalIgnoreAnnotation, Description description) {
- return (evaluateCondition(conditionalIgnoreAnnotation.condition(), description)
- || evaluateUntil(conditionalIgnoreAnnotation.until()));
- }
-
- protected boolean evaluateCondition(Class<? extends IgnoreCondition> ignoreConditionType, Description description) {
- try {
- return ignoreConditionType.newInstance().evaluate(description);
- }
- catch (Exception e) {
- throw new IgnoreConditionEvaluationException(String.format("failed to evaluate IgnoreCondition: %1$s",
- ignoreConditionType.getName()), e);
- }
- }
-
- protected boolean evaluateUntil(String timestamp) {
- try {
- return DATE_FORMAT.parse(timestamp).after(Calendar.getInstance().getTime());
- }
- catch (ParseException e) {
- return false;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RepeatRule.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RepeatRule.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RepeatRule.java
deleted file mode 100755
index 7bfe538..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RepeatRule.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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 java.io.Serializable;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-import com.gemstone.gemfire.test.junit.Repeat;
-
-/**
- * The RepeatRule class is a JUnit TestRule that enables an appropriately @Repeat annotated test case method
- * to be repeated a specified number of times.
- *
- * @author John Blum
- * @see org.junit.rules.TestRule
- * @see org.junit.runner.Description
- * @see org.junit.runners.model.Statement
- */
-@SuppressWarnings({ "serial", "unused" })
-public class RepeatRule implements TestRule, Serializable {
-
- protected static final int DEFAULT_REPETITIONS = 1;
-
- @Override
- public Statement apply(final Statement statement, final Description description) {
- return new Statement() {
- @Override public void evaluate() throws Throwable {
- RepeatRule.this.evaluate(statement, description);
- }
- };
- }
-
- protected void evaluate(final Statement statement, final Description description) throws Throwable {
- if (isTest(description)) {
- Repeat repeat = description.getAnnotation(Repeat.class);
-
- for (int count = 0, repetitions = getRepetitions(repeat); count < repetitions; count++) {
- statement.evaluate();
- }
- }
- }
-
- private int getRepetitions(final Repeat repeat) {
- int repetitions = DEFAULT_REPETITIONS;
-
- if (repeat != null) {
- if (!"".equals(repeat.property())) {
- repetitions = Integer.getInteger(repeat.property(), DEFAULT_REPETITIONS);
- } else {
- repetitions = repeat.value();
- }
- }
-
- if (repetitions < 1) {
- throw new IllegalArgumentException("Repeat value must be a positive integer");
- }
-
- return repetitions;
- }
-
- private boolean isTest(final Description description) {
- return (description.isSuite() || description.isTest());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RetryRule.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RetryRule.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RetryRule.java
deleted file mode 100755
index 4a26d5e..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/RetryRule.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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 java.io.Serializable;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-import com.gemstone.gemfire.test.junit.Retry;
-
-/**
- * JUnit Rule that enables retrying a failed test up to a maximum number of retries.
- * </p>
- * RetryRule can be used globally for all tests in a test case by specifying a
- * retryCount when instantiating it:
- * <pre>
- * @Rule
- * public final RetryRule retryRule = new RetryRule(3);
- *
- * @Test
- * public void shouldBeRetriedUntilPasses() {
- * ...
- * }
- * </pre>
- * </p>
- * The above will result in 3 retries for every test in the test case.
- * </p>
- * RetryRule can be used locally for specific tests by annotating the test
- * method with @Rule and specifying a retryCount for that test:
- * <pre>
- * @Rule
- * public final RetryRule retryRule = new RetryRule();
- *
- * @Test
- * @Retry(3)
- * public void shouldBeRetriedUntilPasses() {
- * ...
- * }
- * </pre>
- * </p>
- * This version of RetryRule will retry a test that fails because of any kind
- * of Throwable.
- */
-@SuppressWarnings("serial")
-public class RetryRule implements TestRule, Serializable {
-
- /**
- * Enables printing of failures to System.err even if test passes on a retry
- */
- private static final boolean LOG = false;
-
- private final AbstractRetryRule implementation;
-
- public RetryRule() {
- this.implementation = new LocalRetryRule();
- }
-
- public RetryRule(final int retryCount) {
- this.implementation = new GlobalRetryRule(retryCount);
- }
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return this.implementation.apply(base, description);
- }
-
- protected abstract class AbstractRetryRule implements TestRule {
- protected AbstractRetryRule() {
- }
- protected void evaluate(final Statement base, final Description description, final int retryCount) throws Throwable {
- if (retryCount == 0) {
-
- }
- Throwable caughtThrowable = null;
-
- for (int count = 0; count < retryCount; count++) {
- try {
- base.evaluate();
- return;
- } catch (Throwable t) {
- caughtThrowable = t;
- debug(description.getDisplayName() + ": run " + (count + 1) + " failed");
- }
- }
-
- debug(description.getDisplayName() + ": giving up after " + retryCount + " failures");
- throw caughtThrowable;
- }
- private void debug(final String message) {
- if (LOG) {
- System.err.println(message);
- }
- }
- }
-
- /**
- * Implementation of RetryRule for all test methods in a test case
- */
- protected class GlobalRetryRule extends AbstractRetryRule {
-
- private final int retryCount;
-
- protected GlobalRetryRule(final int retryCount) {
- if (retryCount < 1) {
- throw new IllegalArgumentException("Retry count must be greater than zero");
- }
- this.retryCount = retryCount;
- }
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- GlobalRetryRule.this.evaluatePerCase(base, description);
- }
- };
- }
-
- protected void evaluatePerCase(final Statement base, final Description description) throws Throwable {
- evaluate(base, description, this.retryCount);
- }
- }
-
- /**
- * Implementation of RetryRule for test methods annotated with Retry
- */
- protected class LocalRetryRule extends AbstractRetryRule {
-
- protected LocalRetryRule() {
- }
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- LocalRetryRule.this.evaluatePerTest(base, description);
- }
- };
- }
-
- protected void evaluatePerTest(final Statement base, final Description description) throws Throwable {
- if (isTest(description)) {
- Retry retry = description.getAnnotation(Retry.class);
- int retryCount = getRetryCount(retry);
- evaluate(base, description, retryCount);
- }
- }
-
- private int getRetryCount(final Retry retry) {
- int retryCount = Retry.DEFAULT;
-
- if (retry != null) {
- retryCount = retry.value();
- }
-
- return retryCount;
- }
-
- private boolean isTest(final Description description) {
- return (description.isSuite() || description.isTest());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableExternalResource.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableExternalResource.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableExternalResource.java
deleted file mode 100755
index 37d8eb5..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableExternalResource.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * 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 org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-/**
- * Serializable version of ExternalResource JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs. The <tt>after()</tt> callback has a throws-clause
- * that matches <tt>before()</tt>.
- *
- * Implementation copied from <tt>org.junit.rules.ExternalResource</tt>.
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public abstract class SerializableExternalResource implements SerializableTestRule {
-
- @Override
- public Statement apply(final Statement base, final Description description) {
- if (description.isTest()) {
- return statement(base);
- } else if (description.isSuite()) {
- return statementClass(base);
- }
- return base;
- }
-
- private Statement statement(final Statement base) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- before();
- try {
- base.evaluate();
- } finally {
- after();
- }
- }
- };
- }
-
- private Statement statementClass(final Statement base) {
- return new Statement() {
- @Override
- public void evaluate() throws Throwable {
- beforeClass();
- try {
- base.evaluate();
- } finally {
- afterClass();
- }
- }
- };
- }
-
- /**
- * Override to set up your specific external resource.
- *
- * @throws Throwable if setup fails (which will disable {@code after}
- */
- protected void before() throws Throwable {
- // do nothing
- }
-
- /**
- * Override to tear down your specific external resource.
- *
- * @throws Throwable if teardown fails (which will disable {@code after}
- */
- protected void after() throws Throwable {
- // do nothing
- }
-
- /**
- * Override to set up your specific external resource.
- *
- * @throws Throwable if setup fails (which will disable {@code after}
- */
- protected void beforeClass() throws Throwable {
- // do nothing
- }
-
- /**
- * Override to tear down your specific external resource.
- *
- * @throws Throwable if teardown fails (which will disable {@code after}
- */
- protected void afterClass() throws Throwable {
- // do nothing
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableRuleChain.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableRuleChain.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableRuleChain.java
deleted file mode 100755
index 936345e..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableRuleChain.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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 java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.junit.rules.TestRule;
-import org.junit.runner.Description;
-import org.junit.runners.model.Statement;
-
-/**
- * Serializable version of TemporaryFolder JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * Implementation copied from <tt>org.junit.rules.RuleChain</tt>.
- *
- * The SerializableRuleChain rule allows ordering of TestRules. You create a
- * {@code RuleChain} with {@link #outerRule(TestRule)} and subsequent calls of
- * {@link #around(TestRule)}:
- *
- * <pre>
- * public static class UseRuleChain {
- * @Rule
- * public RuleChain chain= RuleChain
- * .outerRule(new LoggingRule("outer rule")
- * .around(new LoggingRule("middle rule")
- * .around(new LoggingRule("inner rule");
- *
- * @Test
- * public void example() {
- * assertTrue(true);
- * }
- * }
- * </pre>
- *
- * writes the log
- *
- * <pre>
- * starting outer rule
- * starting middle rule
- * starting inner rule
- * finished inner rule
- * finished middle rule
- * finished outer rule
- * </pre>
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public class SerializableRuleChain implements SerializableTestRule {
- private static final SerializableRuleChain EMPTY_CHAIN = new SerializableRuleChain(Collections.<TestRule>emptyList());
-
- private transient List<TestRule> rulesStartingWithInnerMost;
-
- /**
- * Returns a {@code SerializableRuleChain} without a {@link TestRule}. This method may
- * be the starting point of a {@code SerializableRuleChain}.
- *
- * @return a {@code SerializableRuleChain} without a {@link TestRule}.
- */
- public static SerializableRuleChain emptyRuleChain() {
- return EMPTY_CHAIN;
- }
-
- /**
- * Returns a {@code SerializableRuleChain} with a single {@link TestRule}. This method
- * is the usual starting point of a {@code SerializableRuleChain}.
- *
- * @param outerRule the outer rule of the {@code SerializableRuleChain}.
- * @return a {@code SerializableRuleChain} with a single {@link TestRule}.
- */
- public static SerializableRuleChain outerRule(TestRule outerRule) {
- return emptyRuleChain().around(outerRule);
- }
-
- private SerializableRuleChain(List<TestRule> rules) {
- this.rulesStartingWithInnerMost = rules;
- }
-
- /**
- * Create a new {@code SerializableRuleChain}, which encloses the {@code nextRule} with
- * the rules of the current {@code SerializableRuleChain}.
- *
- * @param enclosedRule the rule to enclose.
- * @return a new {@code SerializableRuleChain}.
- */
- public SerializableRuleChain around(TestRule enclosedRule) {
- List<TestRule> rulesOfNewChain = new ArrayList<TestRule>();
- rulesOfNewChain.add(enclosedRule);
- rulesOfNewChain.addAll(rulesStartingWithInnerMost);
- return new SerializableRuleChain(rulesOfNewChain);
- }
-
- /**
- * {@inheritDoc}
- */
- public Statement apply(Statement base, Description description) {
- for (TestRule each : rulesStartingWithInnerMost) {
- base = each.apply(base, description);
- }
- return base;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTemporaryFolder.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTemporaryFolder.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTemporaryFolder.java
deleted file mode 100755
index 0e796b3..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTemporaryFolder.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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 java.io.File;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-
-import org.junit.rules.TemporaryFolder;
-
-/**
- * Serializable version of TemporaryFolder JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public class SerializableTemporaryFolder extends TemporaryFolder implements SerializableTestRule {
-
- private void writeObject(final ObjectOutputStream out) throws Exception {
- writeParentFolder(out);
- writeFolder(out);
- }
-
- private void readObject(final ObjectInputStream in) throws Exception {
- readParentFolder(in);
- readFolder(in);
- }
-
- private void readParentFolder(final ObjectInputStream in) throws Exception {
- final Field parentFolderField = TemporaryFolder.class.getDeclaredField("parentFolder");
- parentFolderField.setAccessible(true);
- parentFolderField.set(this, (File) in.readObject());
- }
-
- private void readFolder(final ObjectInputStream in) throws Exception {
- final Field folderField = TemporaryFolder.class.getDeclaredField("folder");
- folderField.setAccessible(true);
- folderField.set(this, (File) in.readObject());
- }
-
- private void writeParentFolder(final ObjectOutputStream out) throws Exception {
- final Field parentFolderField = TemporaryFolder.class.getDeclaredField("parentFolder");
- parentFolderField.setAccessible(true);
- final File parentFolderFieldValue = (File) parentFolderField.get(this);
- out.writeObject(parentFolderFieldValue);
- }
-
- private void writeFolder(final ObjectOutputStream out) throws Exception {
- final Field folderField = TemporaryFolder.class.getDeclaredField("folder");
- folderField.setAccessible(true);
- final File folderFieldValue = (File) folderField.get(this);
- out.writeObject(folderFieldValue);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestName.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestName.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestName.java
deleted file mode 100755
index 1fd255f..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestName.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-
-import org.junit.rules.TestName;
-
-/**
- * Serializable version of TestName JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public class SerializableTestName extends TestName implements SerializableTestRule {
-
- private void writeObject(final ObjectOutputStream out) throws Exception {
- writeName(out);
- }
-
- private void readObject(final ObjectInputStream in) throws Exception {
- readName(in);
- }
-
- private void writeName(final ObjectOutputStream out) throws Exception {
- final Field nameField = TestName.class.getDeclaredField("name");
- nameField.setAccessible(true);
- final String nameValue = (String) nameField.get(this);
- out.writeObject(nameValue);
- }
-
- private void readName(final ObjectInputStream in) throws Exception {
- Field nameField = TestName.class.getDeclaredField("name");
- nameField.setAccessible(true);
- nameField.set(this, (String) in.readObject());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestRule.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestRule.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestRule.java
deleted file mode 100755
index 354c38a..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestRule.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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 java.io.Serializable;
-
-import org.junit.rules.TestRule;
-
-/**
- * Serializable version of JUnit TestRule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * The simplest way to satisfy this interface is to apply <tt>transient</tt>
- * to every instance field.
- *
- * @author Kirk Lund
- */
-public interface SerializableTestRule extends Serializable, TestRule {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestWatcher.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestWatcher.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestWatcher.java
deleted file mode 100755
index 5bcf686..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTestWatcher.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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 org.junit.rules.TestWatcher;
-
-/**
- * Serializable version of TestWatcher JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public class SerializableTestWatcher extends TestWatcher implements SerializableTestRule {
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTimeout.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTimeout.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTimeout.java
deleted file mode 100755
index 3136a1c..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/rules/SerializableTimeout.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * 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 java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.lang.reflect.Field;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.rules.TemporaryFolder;
-import org.junit.rules.TestName;
-import org.junit.rules.Timeout;
-
-/**
- * Serializable version of Timeout JUnit Rule. JUnit lifecycle is not
- * executed in remote JVMs.
- *
- * @author Kirk Lund
- */
-@SuppressWarnings("serial")
-public class SerializableTimeout extends Timeout implements SerializableTestRule {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public SerializableTimeout(final long timeout, final TimeUnit timeUnit) {
- super(timeout, timeUnit);
- }
-
- protected SerializableTimeout(final Builder builder) {
- super(builder);
- }
-
- public static class Builder extends Timeout.Builder {
-
- protected Builder() {
- super();
- }
-
- @Override
- public SerializableTimeout build() {
- return new SerializableTimeout(this);
- }
- }
-
- private void writeObject(final ObjectOutputStream out) throws Exception {
- writeTimeout(out);
- writeTimeUnit(out);
- writeLookForStuckThread(out);
- }
-
- private void readObject(final ObjectInputStream in) throws Exception {
- readTimeout(in);
- readTimeUnit(in);
- readLookForStuckThread(in);
- }
-
- private void writeTimeout(final ObjectOutputStream out) throws Exception {
- final Field timeoutField = TestName.class.getDeclaredField("timeout");
- timeoutField.setAccessible(true);
- final Long timeoutValue = (Long) timeoutField.get(this);
- out.writeLong(timeoutValue);
- }
-
- private void writeTimeUnit(final ObjectOutputStream out) throws Exception {
- final Field timeoutField = TestName.class.getDeclaredField("timeUnit");
- timeoutField.setAccessible(true);
- final TimeUnit timeoutValue = (TimeUnit) timeoutField.get(this);
- out.writeObject(timeoutValue);
- }
-
- private void writeLookForStuckThread(final ObjectOutputStream out) throws Exception {
- try {
- final Field lookForStuckThreadField = TemporaryFolder.class.getDeclaredField("lookForStuckThread");
- lookForStuckThreadField.setAccessible(true);
- final Boolean lookForStuckThreadValue = (Boolean) lookForStuckThreadField.get(this);
- out.writeBoolean(lookForStuckThreadValue);
- } catch (NoSuchFieldException e) {
- out.writeBoolean(false);
- }
- }
-
- private void readTimeout(final ObjectInputStream in) throws Exception {
- Field timeoutField = TestName.class.getDeclaredField("timeout");
- timeoutField.setAccessible(true);
- timeoutField.set(this, (Long) in.readObject());
- }
-
- private void readTimeUnit(final ObjectInputStream in) throws Exception {
- Field timeUnitField = TestName.class.getDeclaredField("timeUnit");
- timeUnitField.setAccessible(true);
- timeUnitField.set(this, (TimeUnit) in.readObject());
- }
-
- private void readLookForStuckThread(final ObjectInputStream in) throws Exception {
- try {
- final Field lookForStuckThreadField = TemporaryFolder.class.getDeclaredField("lookForStuckThread");
- lookForStuckThreadField.setAccessible(true);
- lookForStuckThreadField.set(this, (Boolean) in.readObject());
- } catch (NoSuchFieldException e) {
- final boolean value = (Boolean) in.readObject();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4dde1af5/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
----------------------------------------------------------------------
diff --git a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
deleted file mode 100755
index b721c41..0000000
--- a/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/support/DefaultIgnoreCondition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.support;
-
-import org.junit.runner.Description;
-import com.gemstone.gemfire.test.junit.IgnoreCondition;
-
-/**
- * The DefaultIgnoreCondition class...
- *
- * @author John Blum
- * @see org.junit.runner.Description
- * @see com.gemstone.gemfire.test.junit.ConditionalIgnore
- * @see com.gemstone.gemfire.test.junit.IgnoreCondition
- */
-@SuppressWarnings("unused")
-public class DefaultIgnoreCondition implements IgnoreCondition {
-
- public static final boolean DEFAULT_IGNORE = false;
-
- public static final DefaultIgnoreCondition DO_NOT_IGNORE = new DefaultIgnoreCondition(false);
- public static final DefaultIgnoreCondition IGNORE = new DefaultIgnoreCondition(true);
-
- private final boolean ignore;
-
- public DefaultIgnoreCondition() {
- this(DEFAULT_IGNORE);
- }
-
- public DefaultIgnoreCondition(final boolean ignore) {
- this.ignore = ignore;
- }
-
- public boolean isIgnore() {
- return ignore;
- }
-
- @Override
- public boolean evaluate(final Description testCaseDescription) {
- return isIgnore();
- }
-
-}