remove some of the references to the getTestMethod()
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/IXMLTags.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/IXMLTags.java
index 4baca94..42a1b4b 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/IXMLTags.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/IXMLTags.java
@@ -65,7 +65,7 @@
/**
* value: String
*/
- public static final String ATTR_CLASSNAME= "classname"; //$NON-NLS-1$
+ //public static final String ATTR_CLASSNAME= "classname"; //$NON-NLS-1$
/**
* value: Boolean
*/
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestCaseElement.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestCaseElement.java
index 1e82566..83b5e42 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestCaseElement.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestCaseElement.java
@@ -28,7 +28,6 @@
/**
* {@inheritDoc}
- * @see org.eclipse.dltk.testing.model.ITestCaseElement#getTestMethodName()
* @see org.eclipse.jdt.internal.junit.runner.MessageIds#TEST_IDENTIFIER_MESSAGE_FORMAT
* @see org.eclipse.jdt.internal.junit.runner.MessageIds#IGNORED_TEST_PREFIX
*/
@@ -60,6 +59,6 @@
}
public String toString() {
- return "TestCase: " + getTestClassName() + "." + getTestMethodName() + " : " + super.toString(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return "TestCase: " + getTestName() + " : " + super.toString(); //$NON-NLS-1$ //$NON-NLS-2$
}
}
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunHandler.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunHandler.java
index 8f8cac2..484c8f8 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunHandler.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunHandler.java
@@ -104,9 +104,9 @@
// not interested
} else if (qName.equals(IXMLTags.NODE_TESTCASE)) {
- String name= attributes.getValue(IXMLTags.ATTR_NAME);
- String classname= attributes.getValue(IXMLTags.ATTR_CLASSNAME);
- fTestCase= (TestCaseElement) fTestRunSession.createTestElement(fTestSuite, getNextId(), name + '(' + classname + ')', false, 0);
+ String name = attributes.getValue(IXMLTags.ATTR_NAME);
+ // String classname= attributes.getValue(IXMLTags.ATTR_CLASSNAME);
+ fTestCase= (TestCaseElement) fTestRunSession.createTestElement(fTestSuite, getNextId(), name, false, 0);
fNotRun.push(Boolean.valueOf(attributes.getValue(IXMLTags.ATTR_INCOMPLETE)));
fTestCase.setIgnored(Boolean.valueOf(attributes.getValue(IXMLTags.ATTR_IGNORED)).booleanValue());
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSessionSerializer.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSessionSerializer.java
index a55f060..00c6df7 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSessionSerializer.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSessionSerializer.java
@@ -104,9 +104,11 @@
TestCaseElement testCaseElement= (TestCaseElement) testElement;
AttributesImpl atts= new AttributesImpl();
- addCDATA(atts, IXMLTags.ATTR_NAME, testCaseElement.getTestMethodName());
- addCDATA(atts, IXMLTags.ATTR_CLASSNAME, testCaseElement.getClassName());
-// addCDATA(atts, IXMLTags.ATTR_TIME, Integer.toString(testCaseElement.getTime()));
+ addCDATA(atts, IXMLTags.ATTR_NAME, testCaseElement.getTestName());
+ // addCDATA(atts, IXMLTags.ATTR_CLASSNAME,
+ // testCaseElement.getClassName());
+ // addCDATA(atts, IXMLTags.ATTR_TIME,
+ // Integer.toString(testCaseElement.getTime()));
if (testElement.getProgressState() != ProgressState.COMPLETED)
addCDATA(atts, IXMLTags.ATTR_INCOMPLETE, Boolean.TRUE.toString());
if (testCaseElement.isIgnored())
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionLabelProvider.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionLabelProvider.java
index 2e4676b..9138917 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionLabelProvider.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionLabelProvider.java
@@ -12,10 +12,12 @@
package org.eclipse.dltk.internal.testing.ui;
import org.eclipse.dltk.internal.testing.Messages;
+import org.eclipse.dltk.internal.testing.launcher.NullTestRunnerUI;
import org.eclipse.dltk.internal.testing.model.TestCaseElement;
import org.eclipse.dltk.internal.testing.model.TestSuiteElement;
import org.eclipse.dltk.internal.testing.model.TestElement.Status;
import org.eclipse.dltk.testing.DLTKTestingMessages;
+import org.eclipse.dltk.testing.ITestRunnerUI;
import org.eclipse.dltk.testing.ITestingClient;
import org.eclipse.dltk.testing.model.ITestCaseElement;
import org.eclipse.dltk.testing.model.ITestElement;
@@ -31,11 +33,13 @@
private final TestRunnerViewPart fTestRunnerPart;
private final int fLayoutMode;
+ private ITestRunnerUI runnerUI;
public TestSessionLabelProvider(TestRunnerViewPart testRunnerPart,
int layoutMode) {
fTestRunnerPart = testRunnerPart;
fLayoutMode = layoutMode;
+ runnerUI = NullTestRunnerUI.getInstance();
}
/*
@@ -76,7 +80,9 @@
private String getSimpleLabel(Object element) {
if (element instanceof ITestCaseElement) {
- return ((ITestCaseElement) element).getTestMethodName();
+ final ITestCaseElement caseElement = (ITestCaseElement) element;
+ return runnerUI != null ? runnerUI.getTestCaseLabel(caseElement)
+ : caseElement.getTestName();
} else if (element instanceof ITestSuiteElement) {
return ((ITestSuiteElement) element).getSuiteTypeName();
}
@@ -173,4 +179,11 @@
throw new IllegalArgumentException(String.valueOf(element));
}
}
+
+ /**
+ * @param value
+ */
+ public void setRunnerUI(ITestRunnerUI value) {
+ this.runnerUI = value;
+ }
}
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestViewer.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestViewer.java
index cff6813..29ef00f 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestViewer.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestViewer.java
@@ -24,6 +24,7 @@
import org.eclipse.dltk.core.IScriptProject;
import org.eclipse.dltk.core.IType;
import org.eclipse.dltk.core.ModelException;
+import org.eclipse.dltk.internal.testing.launcher.NullTestRunnerUI;
import org.eclipse.dltk.internal.testing.model.TestCaseElement;
import org.eclipse.dltk.internal.testing.model.TestElement;
import org.eclipse.dltk.internal.testing.model.TestRoot;
@@ -31,6 +32,7 @@
import org.eclipse.dltk.internal.testing.model.TestSuiteElement;
import org.eclipse.dltk.internal.testing.model.TestElement.Status;
import org.eclipse.dltk.testing.DLTKTestingMessages;
+import org.eclipse.dltk.testing.ITestRunnerUI;
import org.eclipse.dltk.ui.viewsupport.SelectionProviderMediator;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
@@ -300,6 +302,14 @@
fTestRunSession = testRunSession;
registerAutoScrollTarget(null);
registerViewersRefresh();
+ final ITestRunnerUI runnerUI;
+ if (testRunSession != null) {
+ runnerUI = testRunSession.getTestRunnerUI();
+ } else {
+ runnerUI = NullTestRunnerUI.getInstance();
+ }
+ fTreeLabelProvider.setRunnerUI(runnerUI);
+ fTableLabelProvider.setRunnerUI(runnerUI);
}
protected void handleDefaultSelected() {
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/AbstractTestRunnerUI.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/AbstractTestRunnerUI.java
index 803418e..29d7bb1 100644
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/AbstractTestRunnerUI.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/AbstractTestRunnerUI.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.dltk.testing;
+import org.eclipse.dltk.testing.model.ITestCaseElement;
import org.eclipse.jface.action.IAction;
public abstract class AbstractTestRunnerUI implements ITestRunnerUI {
@@ -28,6 +29,20 @@
}
/*
+ * @see ITestRunnerUI#getTestCaseLabel(ITestCaseElement)
+ */
+ public String getTestCaseLabel(ITestCaseElement caseElement) {
+ String testName = caseElement.getTestName();
+ int index = testName.indexOf('(');
+ if (index > 0)
+ return testName.substring(0, index);
+ index = testName.indexOf('@');
+ if (index > 0)
+ return testName.substring(0, index);
+ return testName;
+ }
+
+ /*
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
public Object getAdapter(Class adapter) {
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/ITestRunnerUI.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/ITestRunnerUI.java
index b16e594..2269362 100644
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/ITestRunnerUI.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/ITestRunnerUI.java
@@ -12,6 +12,7 @@
package org.eclipse.dltk.testing;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.dltk.testing.model.ITestCaseElement;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -48,4 +49,10 @@
*/
String getDisplayName();
+ /**
+ * @param caseElement
+ * @return
+ */
+ String getTestCaseLabel(ITestCaseElement caseElement);
+
}
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/model/ITestCaseElement.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/model/ITestCaseElement.java
index 7f21d9d..7b607a2 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/model/ITestCaseElement.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/testing/model/ITestCaseElement.java
@@ -34,6 +34,7 @@
* Returns the name of the test method.
*
* @return returns the name of the test method.
+ * @deprecated
*/
public String getTestMethodName();