KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > launcher > JUnitRuntimeClasspathEntry


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  * David Saff (saff@mit.edu) - initial API and implementation
11  * (bug 102632: [JUnit] Support for JUnit 4.)
12  *******************************************************************************/

13
14 package org.eclipse.jdt.internal.junit.launcher;
15
16 public class JUnitRuntimeClasspathEntry {
17     private final String JavaDoc fPluginId;
18
19     private final String JavaDoc fPluginRelativePath;
20
21     public JUnitRuntimeClasspathEntry(String JavaDoc pluginId, String JavaDoc jarFile) {
22         fPluginId = pluginId;
23         fPluginRelativePath = jarFile;
24     }
25
26     public String JavaDoc getPluginId() {
27         return fPluginId;
28     }
29
30     public String JavaDoc getPluginRelativePath() {
31         return fPluginRelativePath;
32     }
33
34     public JUnitRuntimeClasspathEntry developmentModeEntry() {
35         return new JUnitRuntimeClasspathEntry(getPluginId(), "bin"); //$NON-NLS-1$
36
}
37
38     public String JavaDoc toString() {
39         return "ClasspathEntry(" + fPluginId + "/" + fPluginRelativePath + ")"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
40
}
41
42     public boolean equals(Object JavaDoc obj) {
43         if (!(obj instanceof JUnitRuntimeClasspathEntry))
44             return false;
45         JUnitRuntimeClasspathEntry other = (JUnitRuntimeClasspathEntry) obj;
46         return fPluginId.equals(other.getPluginId())
47                 && ( (fPluginRelativePath == null && other.getPluginRelativePath() == null)
48                         || fPluginRelativePath.equals(other.getPluginRelativePath()) );
49     }
50     
51     public int hashCode() {
52         // TODO Auto-generated method stub
53
return super.hashCode();
54     }
55 }
56
Popular Tags