summaryrefslogtreecommitdiff
path: root/test-runner/tests
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2017-02-09 14:47:53 +0000
committer Paul Duffin <paulduffin@google.com> 2017-02-09 14:52:43 +0000
commit57e490cf8cf85932c11208c64bbd2b35315ffbc8 (patch)
tree38070ad246bd7003c680149a74683ab7c951a832 /test-runner/tests
parent78a20be77acb6595ed112f2a2642ed569f6082b5 (diff)
Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate"
This partially reverts commit 3e5fbca0c57742f28f5c7e6bda6c3500b9471b47. Bug: 35187548 Bug: 30188076 Bug: 35089332 Test: make checkbuild Change-Id: I7ab4279aab604e3d56003b0a59867948aebabd28
Diffstat (limited to 'test-runner/tests')
-rw-r--r--test-runner/tests/src/com/android/internal/util/PredicatesTest.java74
1 files changed, 0 insertions, 74 deletions
diff --git a/test-runner/tests/src/com/android/internal/util/PredicatesTest.java b/test-runner/tests/src/com/android/internal/util/PredicatesTest.java
deleted file mode 100644
index c46ff051dd33..000000000000
--- a/test-runner/tests/src/com/android/internal/util/PredicatesTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed 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.android.internal.util;
-
-import junit.framework.TestCase;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-public class PredicatesTest extends TestCase {
-
- private static final Predicate<Object> TRUE = new Predicate<Object>() {
- public boolean apply(Object o) {
- return true;
- }
- };
-
- private static final Predicate<Object> FALSE = new Predicate<Object>() {
- public boolean apply(Object o) {
- return false;
- }
- };
-
- public void testAndPredicate_AllConditionsTrue() throws Exception {
- assertTrue(Predicates.and(newArrayList(TRUE)).apply(null));
- assertTrue(Predicates.and(newArrayList(TRUE, TRUE)).apply(null));
- }
-
- public void testAndPredicate_AtLeastOneConditionIsFalse() throws Exception {
- assertFalse(Predicates.and(newArrayList(FALSE, TRUE, TRUE)).apply(null));
- assertFalse(Predicates.and(newArrayList(TRUE, FALSE, TRUE)).apply(null));
- assertFalse(Predicates.and(newArrayList(TRUE, TRUE, FALSE)).apply(null));
- }
-
- public void testOrPredicate_AllConditionsTrue() throws Exception {
- assertTrue(Predicates.or(newArrayList(TRUE, TRUE, TRUE)).apply(null));
- }
-
- public void testOrPredicate_AllConditionsFalse() throws Exception {
- assertFalse(Predicates.or(newArrayList(FALSE, FALSE, FALSE)).apply(null));
- }
-
- public void testOrPredicate_AtLeastOneConditionIsTrue() throws Exception {
- assertTrue(Predicates.or(newArrayList(TRUE, FALSE, FALSE)).apply(null));
- assertTrue(Predicates.or(newArrayList(FALSE, TRUE, FALSE)).apply(null));
- assertTrue(Predicates.or(newArrayList(FALSE, FALSE, TRUE)).apply(null));
- }
-
- public void testNotPredicate() throws Exception {
- assertTrue(Predicates.not(FALSE).apply(null));
- assertFalse(Predicates.not(TRUE).apply(null));
- }
-
- private static <E> ArrayList<E> newArrayList(E... elements) {
- ArrayList<E> list = new ArrayList<E>();
- Collections.addAll(list, elements);
- return list;
- }
-
-}