correcting null testcase name case
diff --git a/bundles/org.eclipse.e4.languages.javascript.junit/src/org/eclipse/e4/languages/javascript/junit/JavaScriptTestCase.java b/bundles/org.eclipse.e4.languages.javascript.junit/src/org/eclipse/e4/languages/javascript/junit/JavaScriptTestCase.java
index 1dc5da1..df1a1f3 100644
--- a/bundles/org.eclipse.e4.languages.javascript.junit/src/org/eclipse/e4/languages/javascript/junit/JavaScriptTestCase.java
+++ b/bundles/org.eclipse.e4.languages.javascript.junit/src/org/eclipse/e4/languages/javascript/junit/JavaScriptTestCase.java
@@ -31,7 +31,7 @@
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
-public class JavaScriptTestCase extends TestCase{
+public class JavaScriptTestCase extends TestCase {
private Context context;
private ScriptableObject globalScope;
@@ -44,10 +44,10 @@
private boolean superRunTest = false;
private volatile static int evalCount;
private static URL ASSERT_SCRIPT = JavaScriptTestCase.class.getResource("assert.js");
-
+
static {
- String rhinoDebug = System.getProperty("rhino.debug");
- if ( rhinoDebug != null) {
+ String rhinoDebug = System.getProperty("rhino.debug");
+ if (rhinoDebug != null) {
try {
Class.forName("org.eclipse.wst.jsdt.debug.rhino.debugger.RhinoDebugger"); //$NON-NLS-1$
DebugUtil.debug(rhinoDebug);
@@ -55,7 +55,6 @@
}
}
}
-
public JavaScriptTestCase() {
this(null, null, null, null);
@@ -70,10 +69,11 @@
}
public JavaScriptTestCase(String testFunctionName, String testCaseName, Collection<?> scripts, ClassLoader applicationClassLoader) {
- super(testFunctionName + " (" + testCaseName + ")");
- // this is done to create a name that is usable like the typical classname/methodname id.
+ super(testCaseName == null ? testFunctionName : testFunctionName + " (" + testCaseName + ")");
+ // this is done to create a name that is usable like the typical
+ // classname/methodname id.
// The UI hides everything after the brackets
-
+
this.testFunctionName = testFunctionName;
this.testCaseName = testCaseName;
this.scripts = scripts;
@@ -115,7 +115,7 @@
Object value = currentScope.get(token, currentScope);
if (!tokenizer.hasMoreTokens()) {
BaseFunction constructor = (BaseFunction) value;
- Object[] arguments = (testName==null) ? new Object[0]: new Object[]{testName};
+ Object[] arguments = (testName == null) ? new Object[0] : new Object[] { testName };
return constructor.construct(context, getGlobalScope(), arguments);
}
if (value instanceof Scriptable)