OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.base.test.util; |
| 6 |
| 7 import junit.framework.TestCase; |
| 8 |
| 9 import org.chromium.base.Log; |
| 10 |
| 11 import java.lang.reflect.Method; |
| 12 |
| 13 /** |
| 14 * Check whether a test case should be skipped. |
| 15 */ |
| 16 public abstract class SkipCheck { |
| 17 |
| 18 private static final String TAG = "base_test"; |
| 19 |
| 20 /** |
| 21 * |
| 22 * Checks whether the given test case should be skipped. |
| 23 * |
| 24 * @param testCase The test case to check. |
| 25 * @return Whether the test case should be skipped. |
| 26 */ |
| 27 public abstract boolean shouldSkip(TestCase testCase); |
| 28 |
| 29 protected static Method getTestMethod(TestCase testCase) { |
| 30 try { |
| 31 return testCase.getClass().getMethod(testCase.getName(), (Class[]) n
ull); |
| 32 } catch (NoSuchMethodException e) { |
| 33 Log.e(TAG, "Unable to find %s in %s", testCase.getName(), |
| 34 testCase.getClass().getName(), e); |
| 35 return null; |
| 36 } |
| 37 } |
| 38 } |
| 39 |
OLD | NEW |