2 * Copyright (C) 2009 The Android Open Source Project
4 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.eclipse.org/org/documents/epl-v10.php
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.ide.eclipse.adt.internal.launch.junit.runtime;
19 import org.eclipse.jdt.internal.junit.runner.ITestIdentifier;
20 import org.eclipse.jdt.internal.junit.runner.ITestReference;
21 import org.eclipse.jdt.internal.junit.runner.TestExecution;
24 * Base implementation of the Eclipse {@link ITestReference} and {@link ITestIdentifier} interfaces
27 * Provides generic equality/hashcode services
29 @SuppressWarnings("restriction") //$NON-NLS-1$
30 abstract class AndroidTestReference implements ITestReference, ITestIdentifier {
33 * Gets the {@link ITestIdentifier} for this test reference.
35 public ITestIdentifier getIdentifier() {
36 // this class serves as its own test identifier
43 public void run(TestExecution execution) {
44 throw new UnsupportedOperationException();
48 * Compares {@link ITestIdentifier} using names
51 public boolean equals(Object obj) {
52 if (obj instanceof ITestIdentifier) {
53 ITestIdentifier testid = (ITestIdentifier) obj;
54 return getName().equals(testid.getName());
60 public int hashCode() {
61 return getName().hashCode();