Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1344)

Unified Diff: testing/android/junit/javatests/src/org/chromium/testing/local/RunnerFilterTest.java

Issue 596303002: Revert of Revert of [Android] JUnit runner + gyp changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@deps-changes
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/android/junit/javatests/src/org/chromium/testing/local/RunnerFilterTest.java
diff --git a/testing/android/junit/javatests/src/org/chromium/testing/local/RunnerFilterTest.java b/testing/android/junit/javatests/src/org/chromium/testing/local/RunnerFilterTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..9a73be785e3321cc530a03113a92de4e13b7f91a
--- /dev/null
+++ b/testing/android/junit/javatests/src/org/chromium/testing/local/RunnerFilterTest.java
@@ -0,0 +1,56 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.testing.local;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.Description;
+import org.junit.runner.RunWith;
+import org.junit.runner.manipulation.Filter;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.Suite;
+
+/**
+ * Unit tests for RunnerFilter.
+ */
+@RunWith(BlockJUnit4ClassRunner.class)
+public class RunnerFilterTest {
+
+ @Test
+ public void testDescription() {
+ Filter filterUnderTest = new RunnerFilter(BlockJUnit4ClassRunner.class);
+ Assert.assertEquals("runner-filter: org.junit.runners.BlockJUnit4ClassRunner",
+ filterUnderTest.describe());
+ }
+
+ @Test
+ public void testNoFilter() {
+ Filter filterUnderTest = new RunnerFilter(null);
+ Assert.assertFalse(filterUnderTest.shouldRun(
+ Description.createTestDescription(RunnerFilterTest.class, "testNoFilter")));
+ }
+
+ @Test
+ public void testFilterHit() {
+ Filter filterUnderTest = new RunnerFilter(BlockJUnit4ClassRunner.class);
+ Assert.assertTrue(filterUnderTest.shouldRun(
+ Description.createTestDescription(RunnerFilterTest.class, "testFilterHit")));
+ }
+
+ @Test
+ public void testFilterMiss() {
+ Filter filterUnderTest = new RunnerFilter(Suite.class);
+ Assert.assertFalse(filterUnderTest.shouldRun(
+ Description.createTestDescription(RunnerFilterTest.class, "testFilterMiss")));
+ }
+
+ @Test
+ public void testClassNotFound() {
+ Filter filterUnderTest = new RunnerFilter(BlockJUnit4ClassRunner.class);
+ Assert.assertFalse(filterUnderTest.shouldRun(
+ Description.createTestDescription("FakeTestClass", "fakeTestMethod")));
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698