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

Unified Diff: testing/android/junit/javatests/src/org/chromium/testing/local/PackageFilterTest.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/PackageFilterTest.java
diff --git a/testing/android/junit/javatests/src/org/chromium/testing/local/PackageFilterTest.java b/testing/android/junit/javatests/src/org/chromium/testing/local/PackageFilterTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..4427676bdb2ffdd92cf37a537643e5e15ae4aadd
--- /dev/null
+++ b/testing/android/junit/javatests/src/org/chromium/testing/local/PackageFilterTest.java
@@ -0,0 +1,47 @@
+// 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;
+
+/**
+ * Unit tests for PackageFilter.
+ */
+@RunWith(BlockJUnit4ClassRunner.class)
+public class PackageFilterTest {
+
+ @Test
+ public void testDescription() {
+ Filter filterUnderTest = new PackageFilter("test.package");
+ Assert.assertEquals("package-filter: test.package", filterUnderTest.describe());
+ }
+
+ @Test
+ public void testNoFilter() {
+ Filter filterUnderTest = new PackageFilter("");
+ Assert.assertFalse(filterUnderTest.shouldRun(
+ Description.createTestDescription(PackageFilterTest.class, "testNoFilter")));
+ }
+
+ @Test
+ public void testFilterHit() {
+ Filter filterUnderTest = new PackageFilter("org.chromium.testing.local");
+ Assert.assertTrue(filterUnderTest.shouldRun(
+ Description.createTestDescription(PackageFilterTest.class, "testWithFilter")));
+ }
+
+ @Test
+ public void testFilterMiss() {
+ Filter filterUnderTest = new PackageFilter("org.chromium.native_test");
+ Assert.assertFalse(filterUnderTest.shouldRun(
+ Description.createTestDescription(PackageFilterTest.class, "testWithFilter")));
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698