You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by up...@apache.org on 2016/01/23 00:26:08 UTC
[27/51] [abbrv] incubator-geode git commit: GEODE-12: added a UItest
category, put all pulse tests under UItest category,
added a uiTest task in gradle
GEODE-12: added a UItest category, put all pulse tests under UItest category, added a uiTest task in gradle
(cherry picked from commit 87042b8213cfb1ca1c3441e9ce0b47d27c456341)
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/f22c6c23
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/f22c6c23
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/f22c6c23
Branch: refs/heads/wan_cq_donation
Commit: f22c6c232705b2d484ce176b51f0b72a732b529b
Parents: a4dcef0
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Wed Jan 20 08:47:07 2016 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Thu Jan 21 14:31:21 2016 -0800
----------------------------------------------------------------------
build.gradle | 45 ++++++++++++++------
.../gemfire/test/junit/categories/UITest.java | 24 +++++++++++
.../tools/pulse/testbed/driver/PulseUITest.java | 3 +-
.../gemfire/tools/pulse/tests/PulseTest.java | 3 +-
.../pulse/tests/junit/BaseServiceTest.java | 3 +-
5 files changed, 63 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f22c6c23/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index d115363..340abc6 100755
--- a/build.gradle
+++ b/build.gradle
@@ -346,6 +346,26 @@ subprojects {
testRuntime 'org.ow2.asm:asm:' + project.'asm.version'
}
+ //This target does not run any tests. Rather, it validates that there are no
+ //tests that are missing a category annotation
+ task checkMissedTests(type: Test) {
+ include '**/*Test.class'
+ 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'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.PerformanceTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.HydraTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.ContainerTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.UITest'
+ }
+
+ beforeTest { descriptor ->
+ throw new GradleException("The test " + descriptor.getClassName() + "." + descriptor.getName() + " does not include a junit category.");
+ }
+ }
+
+
test {
include '**/*Test.class'
useJUnit {
@@ -355,6 +375,7 @@ subprojects {
excludeCategories 'com.gemstone.gemfire.test.junit.categories.PerformanceTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.HydraTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.ContainerTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.UITest'
}
// run each test in its own vm to avoid interference issues if a test doesn't clean up
@@ -366,37 +387,36 @@ subprojects {
}
}
- //This target does not run any tests. Rather, it validates that there are no
- //tests that are missing a category annotation
- task checkMissedTests(type: Test) {
+ task integrationTest(type:Test) {
include '**/*Test.class'
useJUnit {
excludeCategories 'com.gemstone.gemfire.test.junit.categories.UnitTest'
- excludeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
+ includeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.DistributedTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.PerformanceTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.HydraTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.ContainerTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.UITest'
}
- beforeTest { descriptor ->
- throw new GradleException("The test " + descriptor.getClassName() + "." + descriptor.getName() + " does not include a junit category.");
+ forkEvery 1
+
+ doFirst {
+ writeTestProperties(buildDir, name)
}
-
}
- task integrationTest(type:Test) {
+ task uiTest(type:Test) {
include '**/*Test.class'
useJUnit {
excludeCategories 'com.gemstone.gemfire.test.junit.categories.UnitTest'
- includeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.IntegrationTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.DistributedTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.PerformanceTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.HydraTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.ContainerTest'
- }
-
- forkEvery 1
+ includeCategories 'com.gemstone.gemfire.test.junit.categories.UITest'
+ }
doFirst {
writeTestProperties(buildDir, name)
@@ -416,6 +436,7 @@ subprojects {
excludeCategories 'com.gemstone.gemfire.test.junit.categories.PerformanceTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.HydraTest'
excludeCategories 'com.gemstone.gemfire.test.junit.categories.ContainerTest'
+ excludeCategories 'com.gemstone.gemfire.test.junit.categories.UITest'
}
//I'm hoping this might deal with SOME OOMEs I've seen
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f22c6c23/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
new file mode 100644
index 0000000..834931a
--- /dev/null
+++ b/gemfire-junit/src/test/java/com/gemstone/gemfire/test/junit/categories/UITest.java
@@ -0,0 +1,24 @@
+/*
+ * 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/f22c6c23/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/testbed/driver/PulseUITest.java
----------------------------------------------------------------------
diff --git a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/testbed/driver/PulseUITest.java b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/testbed/driver/PulseUITest.java
index 2d6f2a7..962adea 100644
--- a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/testbed/driver/PulseUITest.java
+++ b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/testbed/driver/PulseUITest.java
@@ -24,6 +24,7 @@ import java.net.InetAddress;
import java.util.List;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.test.junit.categories.UITest;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
import com.vmware.gemfire.tools.pulse.tests.PulseTest;
import junit.framework.Assert;
@@ -51,7 +52,7 @@ import com.vmware.gemfire.tools.pulse.testbed.TestBed;
*
*/
@Ignore
-@Category(IntegrationTest.class)
+@Category(UITest.class)
public class PulseUITest {
private static WebDriver driver;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f22c6c23/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
----------------------------------------------------------------------
diff --git a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
index 9c653f1..bca2258 100644
--- a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
+++ b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/PulseTest.java
@@ -25,6 +25,7 @@ import java.util.Properties;
import java.util.concurrent.TimeUnit;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.test.junit.categories.UITest;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
import junit.framework.Assert;
@@ -46,7 +47,7 @@ import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
-@Category(IntegrationTest.class)
+@Category(UITest.class)
@FixMethodOrder(MethodSorters.JVM)
public class PulseTest {
private static String jmxPropertiesFile;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f22c6c23/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/junit/BaseServiceTest.java
----------------------------------------------------------------------
diff --git a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/junit/BaseServiceTest.java b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/junit/BaseServiceTest.java
index ee6ade0..2da157c 100644
--- a/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/junit/BaseServiceTest.java
+++ b/gemfire-pulse/src/test/java/com/vmware/gemfire/tools/pulse/tests/junit/BaseServiceTest.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Properties;
import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import com.gemstone.gemfire.test.junit.categories.UITest;
import com.gemstone.gemfire.test.junit.categories.UnitTest;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
@@ -55,7 +56,7 @@ import org.junit.experimental.categories.Category;
*
*/
@Ignore
-@Category(IntegrationTest.class)
+@Category(UITest.class)
public abstract class BaseServiceTest {
protected static Properties propsForJUnit = new Properties();