Fix warnings in dltk.testing.
Change-Id: Ib8ed781513b138b78bee300a2fe42ed5ea1af271
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/DLTKTestingModel.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/DLTKTestingModel.java
index d0ad409..46f128e 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/DLTKTestingModel.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/DLTKTestingModel.java
@@ -24,7 +24,6 @@
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerFactoryConfigurationError;
@@ -411,25 +410,10 @@
*/
public static void exportTestRunSession(TestRunSession testRunSession,
File file) throws CoreException {
- FileOutputStream out = null;
- try {
- out = new FileOutputStream(file);
+ try (FileOutputStream out = new FileOutputStream(file)) {
exportTestRunSession(testRunSession, out);
-
- } catch (IOException e) {
+ } catch (IOException | TransformerException e) {
throwExportError(file, e);
- } catch (TransformerConfigurationException e) {
- throwExportError(file, e);
- } catch (TransformerException e) {
- throwExportError(file, e);
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e2) {
- DLTKTestingPlugin.log(e2);
- }
- }
}
}
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/RemoteTestRunnerClient.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/RemoteTestRunnerClient.java
index 0e1abd3..12cd929 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/RemoteTestRunnerClient.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/RemoteTestRunnerClient.java
@@ -12,9 +12,6 @@
*******************************************************************************/
package org.eclipse.dltk.internal.testing.model;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
@@ -217,14 +214,6 @@
private ITestRunListener2[] fListeners;
/**
- * The server socket
- */
- // private ServerSocket fServerSocket;
- // private Socket fSocket;
- // private int fPort= -1;
- private PrintWriter fWriter;
- private BufferedReader fBufferedReader;
- /**
* The protocol version
*/
private String fVersion;
@@ -243,8 +232,6 @@
*/
private int fFailureKind;
- private boolean fDebug = false;
-
/**
* Reads the message stream from the RemoteTestRunner
*/
@@ -275,10 +262,6 @@
// }
}
- private String readMessage(BufferedReader in) throws IOException {
- return in.readLine();
- }
-
private void receiveMessage(String message) {
fCurrentState = fCurrentState.readMessage(message);
}
@@ -487,22 +470,6 @@
}
}
- private void notifyTestRunTerminated() {
- // fix for 77771 RemoteTestRunnerClient doing work after junit shutdown
- // [JUnit]
- if (DLTKTestingPlugin.isStopped())
- return;
- for (int i = 0; i < fListeners.length; i++) {
- final ITestRunListener2 listener = fListeners[i];
- SafeRunner.run(new ListenerSafeRunnable() {
- @Override
- public void run() {
- listener.testRunTerminated();
- }
- });
- }
- }
-
@Override
public void rerunTest(String testId, String className, String testName) {
// if (isRunning()) {
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestContainerElement.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestContainerElement.java
index 1fb06e8..9e3ced1 100644
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestContainerElement.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestContainerElement.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,8 +16,8 @@
import org.eclipse.dltk.testing.model.ITestElement;
import org.eclipse.dltk.testing.model.ITestElementContainer;
-public abstract class TestContainerElement extends TestElement implements
- ITestElementContainer {
+public abstract class TestContainerElement extends TestElement
+ implements ITestElementContainer {
private List<TestElement> fChildren;
private Status fChildrenStatus;
@@ -30,12 +30,9 @@
public TestContainerElement(TestContainerElement parent, String id,
String testName, int childrenCount) {
super(parent, id, testName);
- fChildren = new ArrayList<TestElement>(childrenCount);
+ fChildren = new ArrayList<>(childrenCount);
}
- /*
- * @see org.eclipse.jdt.junit.ITestElement#getTestResult()
- */
@Override
public Result getTestResult(boolean includeChildren) {
if (includeChildren) {
@@ -45,16 +42,10 @@
}
}
- /*
- * @see org.eclipse.jdt.junit.ITestSuiteElement#getSuiteTypeName()
- */
public String getSuiteTypeName() {
return getTestName();
}
- /*
- * @see org.eclipse.jdt.junit.model.ITestSuiteElement#getChildren()
- */
@Override
public ITestElement[] getChildren() {
return fChildren.toArray(new ITestElement[fChildren.size()]);
@@ -77,8 +68,8 @@
}
private Status getCumulatedStatus() {
- TestElement[] children = fChildren.toArray(new TestElement[fChildren
- .size()]);
+ TestElement[] children = fChildren
+ .toArray(new TestElement[fChildren.size()]);
// copy list to avoid concurreny problems
if (children.length == 0)
return getSuiteStatus();
@@ -127,7 +118,8 @@
// finally, set RUNNING_FAILURE/ERROR if child has failed but suite has
// not failed:
if (childStatus.isFailure()) {
- if (fChildrenStatus == null || !fChildrenStatus.isErrorOrFailure()) {
+ if (fChildrenStatus == null
+ || !fChildrenStatus.isErrorOrFailure()) {
internalSetChildrenStatus(Status.RUNNING_FAILURE);
return;
}
@@ -142,7 +134,7 @@
private void internalSetChildrenStatus(Status status) {
if (fChildrenStatus == status)
return;
-
+
if (status == Status.RUNNING) {
if (fTime >= 0.0d) {
// re-running child: ignore change
@@ -155,7 +147,7 @@
fTime = endTime + fTime;
}
}
-
+
fChildrenStatus = status;
TestContainerElement parent = getParent();
if (parent != null)
@@ -169,8 +161,8 @@
if (index > 0) {
className = className.substring(index + 1);
}
- return className
- + ": " + getSuiteTypeName() + " : " + super.toString() + " (" + fChildren.size() + ")"; //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return className + ": " + getSuiteTypeName() + " : " + super.toString() //$NON-NLS-1$//$NON-NLS-2$
+ + " (" + fChildren.size() + ")"; //$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 2edd71a..d7ddf46 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2016 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@
import java.util.Stack;
import org.eclipse.core.resources.ResourcesPlugin;
-
import org.eclipse.dltk.core.DLTKCore;
import org.eclipse.dltk.core.IScriptModel;
import org.eclipse.dltk.core.IScriptProject;
@@ -25,17 +24,17 @@
import org.xml.sax.helpers.DefaultHandler;
public class TestRunHandler extends DefaultHandler {
-
+
/*
* TODO: validate (currently assumes correct XML)
*/
-
+
private int fId;
-
+
private TestRunSession fTestRunSession;
private TestContainerElement fTestSuite;
private TestCaseElement fTestCase;
- private Stack<Boolean> fNotRun= new Stack<Boolean>();
+ private Stack<Boolean> fNotRun = new Stack<>();
private StringBuffer fFailureBuffer;
private boolean fInExpected;
@@ -46,180 +45,204 @@
private Locator fLocator;
private Status fStatus;
-
+
public TestRunHandler() {
-
+
}
-
+
public TestRunHandler(TestRunSession testRunSession) {
- fTestRunSession= testRunSession;
+ fTestRunSession = testRunSession;
}
@Override
public void setDocumentLocator(Locator locator) {
- fLocator= locator;
+ fLocator = locator;
}
-
+
@Override
public void startDocument() throws SAXException {
}
-
+
@Override
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ public void startElement(String uri, String localName, String qName,
+ Attributes attributes) throws SAXException {
if (qName.equals(IXMLTags.NODE_TESTRUN)) {
if (fTestRunSession == null) {
- String name= attributes.getValue(IXMLTags.ATTR_NAME);
- String project= attributes.getValue(IXMLTags.ATTR_PROJECT);
- IScriptProject javaProject= null;
+ String name = attributes.getValue(IXMLTags.ATTR_NAME);
+ String project = attributes.getValue(IXMLTags.ATTR_PROJECT);
+ IScriptProject javaProject = null;
if (project != null) {
- IScriptModel javaModel= DLTKCore.create(ResourcesPlugin.getWorkspace().getRoot());
- javaProject= javaModel.getScriptProject(project);
- if (! javaProject.exists())
- javaProject= null;
+ IScriptModel javaModel = DLTKCore
+ .create(ResourcesPlugin.getWorkspace().getRoot());
+ javaProject = javaModel.getScriptProject(project);
+ if (!javaProject.exists())
+ javaProject = null;
}
- fTestRunSession= new TestRunSession(name, javaProject);
- //TODO: read counts?
-
+ fTestRunSession = new TestRunSession(name, javaProject);
+ // TODO: read counts?
+
} else {
- fTestRunSession.reset();
+ fTestRunSession.reset();
}
- fTestSuite= fTestRunSession.getTestRoot();
-
- } else if (qName.equals(IXMLTags.NODE_TESTSUITES)) {
- // support Ant's 'junitreport' task; create suite from NODE_TESTSUITE
-
+ fTestSuite = fTestRunSession.getTestRoot();
+
+ } else if (qName.equals(IXMLTags.NODE_TESTSUITES)) {
+ // support Ant's 'junitreport' task; create suite from
+ // NODE_TESTSUITE
+
} else if (qName.equals(IXMLTags.NODE_CATEGORY)) {
String id = attributes.getValue(IXMLTags.ATTR_ID);
String name = attributes.getValue(IXMLTags.ATTR_NAME);
fTestSuite = new TestCategoryElement(fTestSuite, id, name);
} else if (qName.equals(IXMLTags.NODE_TESTSUITE)) {
- String name= attributes.getValue(IXMLTags.ATTR_NAME);
-
+ String name = attributes.getValue(IXMLTags.ATTR_NAME);
+
if (fTestRunSession == null) {
// support standalone suites and Ant's 'junitreport' task:
- fTestRunSession= new TestRunSession(name, null);
- fTestSuite= fTestRunSession.getTestRoot();
+ fTestRunSession = new TestRunSession(name, null);
+ fTestSuite = fTestRunSession.getTestRoot();
}
-
- String pack= attributes.getValue(IXMLTags.ATTR_PACKAGE);
- String suiteName= pack == null ? name : pack + "." + name; //$NON-NLS-1$
- fTestSuite= (TestSuiteElement) fTestRunSession.createTestElement(fTestSuite, getNextId(), suiteName, true, 0);
+
+ String pack = attributes.getValue(IXMLTags.ATTR_PACKAGE);
+ String suiteName = pack == null ? name : pack + "." + name; //$NON-NLS-1$
+ fTestSuite = (TestSuiteElement) fTestRunSession.createTestElement(
+ fTestSuite, getNextId(), suiteName, true, 0);
readTime(fTestSuite, attributes);
- fNotRun.push(Boolean.valueOf(attributes.getValue(IXMLTags.ATTR_INCOMPLETE)));
-
- } else if (qName.equals(IXMLTags.NODE_PROPERTIES) || qName.equals(IXMLTags.NODE_PROPERTY)) {
+ fNotRun.push(Boolean
+ .valueOf(attributes.getValue(IXMLTags.ATTR_INCOMPLETE)));
+
+ } else if (qName.equals(IXMLTags.NODE_PROPERTIES)
+ || qName.equals(IXMLTags.NODE_PROPERTY)) {
// 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, false, 0);
- fNotRun.push(Boolean.valueOf(attributes.getValue(IXMLTags.ATTR_INCOMPLETE)));
- fTestCase.setIgnored(Boolean.valueOf(attributes.getValue(IXMLTags.ATTR_IGNORED)).booleanValue());
+ 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());
readTime(fTestCase, attributes);
-
+
} else if (qName.equals(IXMLTags.NODE_ERROR)) {
- //TODO: multiple failures: https://bugs.eclipse.org/bugs/show_bug.cgi?id=125296
- fStatus= Status.ERROR;
- fFailureBuffer= new StringBuffer();
-
+ // TODO: multiple failures:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=125296
+ fStatus = Status.ERROR;
+ fFailureBuffer = new StringBuffer();
+
} else if (qName.equals(IXMLTags.NODE_FAILURE)) {
- //TODO: multiple failures: https://bugs.eclipse.org/bugs/show_bug.cgi?id=125296
- fStatus= Status.FAILURE;
- fFailureBuffer= new StringBuffer();
-
+ // TODO: multiple failures:
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=125296
+ fStatus = Status.FAILURE;
+ fFailureBuffer = new StringBuffer();
+
} else if (qName.equals(IXMLTags.NODE_EXPECTED)) {
- fInExpected= true;
- fExpectedBuffer= new StringBuffer();
-
+ fInExpected = true;
+ fExpectedBuffer = new StringBuffer();
+
} else if (qName.equals(IXMLTags.NODE_ACTUAL)) {
- fInActual= true;
- fActualBuffer= new StringBuffer();
-
- } else if (qName.equals(IXMLTags.NODE_SYSTEM_OUT) || qName.equals(IXMLTags.NODE_SYSTEM_ERR)) {
+ fInActual = true;
+ fActualBuffer = new StringBuffer();
+
+ } else if (qName.equals(IXMLTags.NODE_SYSTEM_OUT)
+ || qName.equals(IXMLTags.NODE_SYSTEM_ERR)) {
// not interested
-
+
} else {
- throw new SAXParseException("unknown node '" + qName + "'", fLocator); //$NON-NLS-1$//$NON-NLS-2$
+ throw new SAXParseException("unknown node '" + qName + "'", //$NON-NLS-1$//$NON-NLS-2$
+ fLocator);
}
}
+
private void readTime(TestElement testElement, Attributes attributes) {
- String timeString= attributes.getValue(IXMLTags.ATTR_TIME);
- if (timeString != null) {
- try {
- testElement.setElapsedTimeInSeconds(Double.parseDouble(timeString));
- } catch (NumberFormatException e) {
- }
+ String timeString = attributes.getValue(IXMLTags.ATTR_TIME);
+ if (timeString != null) {
+ try {
+ testElement.setElapsedTimeInSeconds(
+ Double.parseDouble(timeString));
+ } catch (NumberFormatException e) {
}
+ }
}
+
@Override
- public void characters(char[] ch, int start, int length) throws SAXException {
+ public void characters(char[] ch, int start, int length)
+ throws SAXException {
if (fInExpected) {
fExpectedBuffer.append(ch, start, length);
-
+
} else if (fInActual) {
fActualBuffer.append(ch, start, length);
-
+
} else if (fFailureBuffer != null) {
fFailureBuffer.append(ch, start, length);
}
}
-
+
@Override
- public void endElement(String uri, String localName, String qName) throws SAXException {
- if (qName.equals(IXMLTags.NODE_TESTRUN)) {
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+ if (qName.equals(IXMLTags.NODE_TESTRUN)) {
// OK
-
- } else if (qName.equals(IXMLTags.NODE_TESTSUITES)) {
+
+ } else if (qName.equals(IXMLTags.NODE_TESTSUITES)) {
// OK
-
+
} else if (qName.equals(IXMLTags.NODE_CATEGORY)) {
fTestSuite = fTestSuite.getParent();
} else if (qName.equals(IXMLTags.NODE_TESTSUITE)) {
handleTestElementEnd(fTestSuite);
- fTestSuite= fTestSuite.getParent();
- //TODO: end suite: compare counters?
-
- } else if (qName.equals(IXMLTags.NODE_PROPERTIES) || qName.equals(IXMLTags.NODE_PROPERTY)) {
+ fTestSuite = fTestSuite.getParent();
+ // TODO: end suite: compare counters?
+
+ } else if (qName.equals(IXMLTags.NODE_PROPERTIES)
+ || qName.equals(IXMLTags.NODE_PROPERTY)) {
// OK
-
+
} else if (qName.equals(IXMLTags.NODE_TESTCASE)) {
handleTestElementEnd(fTestCase);
- fTestCase= null;
-
- } else if (qName.equals(IXMLTags.NODE_FAILURE) || qName.equals(IXMLTags.NODE_ERROR)) {
- TestElement testElement= fTestCase;
+ fTestCase = null;
+
+ } else if (qName.equals(IXMLTags.NODE_FAILURE)
+ || qName.equals(IXMLTags.NODE_ERROR)) {
+ TestElement testElement = fTestCase;
if (testElement == null)
- testElement= fTestSuite;
+ testElement = fTestSuite;
handleFailure(testElement);
-
+
} else if (qName.equals(IXMLTags.NODE_EXPECTED)) {
- fInExpected= false;
-
+ fInExpected = false;
+
} else if (qName.equals(IXMLTags.NODE_ACTUAL)) {
- fInActual= false;
-
- } else if (qName.equals(IXMLTags.NODE_SYSTEM_OUT) || qName.equals(IXMLTags.NODE_SYSTEM_ERR)) {
+ fInActual = false;
+
+ } else if (qName.equals(IXMLTags.NODE_SYSTEM_OUT)
+ || qName.equals(IXMLTags.NODE_SYSTEM_ERR)) {
// OK
-
+
} else {
-
+
handleUnknownNode(qName);
}
}
private void handleTestElementEnd(TestElement testElement) {
- boolean completed= fNotRun.pop() != Boolean.TRUE;
+ boolean completed = fNotRun.pop() != Boolean.TRUE;
fTestRunSession.registerTestEnded(testElement, completed);
}
private void handleFailure(TestElement testElement) {
if (fFailureBuffer != null) {
- fTestRunSession.registerTestFailureStatus(testElement, fStatus, fFailureBuffer.toString(), toString(fExpectedBuffer), toString(fActualBuffer));
- fFailureBuffer= null;
- fExpectedBuffer= null;
- fActualBuffer= null;
- fStatus= null;
+ fTestRunSession.registerTestFailureStatus(testElement, fStatus,
+ fFailureBuffer.toString(), toString(fExpectedBuffer),
+ toString(fActualBuffer));
+ fFailureBuffer = null;
+ fExpectedBuffer = null;
+ fActualBuffer = null;
+ fStatus = null;
}
}
@@ -228,14 +251,15 @@
}
private void handleUnknownNode(String qName) throws SAXException {
- //TODO: just log if debug option is enabled?
- String msg= "unknown node '" + qName + "'"; //$NON-NLS-1$//$NON-NLS-2$
+ // TODO: just log if debug option is enabled?
+ String msg = "unknown node '" + qName + "'"; //$NON-NLS-1$//$NON-NLS-2$
if (fLocator != null) {
- msg += " at line " + fLocator.getLineNumber() + ", column " + fLocator.getColumnNumber(); //$NON-NLS-1$//$NON-NLS-2$
+ msg += " at line " + fLocator.getLineNumber() + ", column " //$NON-NLS-1$//$NON-NLS-2$
+ + fLocator.getColumnNumber();
}
throw new SAXException(msg);
}
-
+
@Override
public void error(SAXParseException e) throws SAXException {
throw e;
@@ -245,11 +269,11 @@
public void warning(SAXParseException e) throws SAXException {
throw e;
}
-
+
private String getNextId() {
return Integer.toString(fId++);
}
-
+
/**
* @return the parsed test run session, or <code>null</code>
*/
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSession.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSession.java
index 9d7bc6f..01a40c4 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSession.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/model/TestRunSession.java
@@ -828,19 +828,6 @@
}
}
- public void testFailed(int status, String testId, String testName,
- String trace) {
- testFailed(status, testId, testName, trace, null, null, -1);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jdt.internal.junit.model.ITestRunListener2#testFailed(
- * int, java.lang.String, java.lang.String, java.lang.String,
- * java.lang.String, java.lang.String)
- */
@Override
public void testFailed(int statusCode, String testId, String testName,
String trace, String expected, String actual, int code) {
@@ -871,19 +858,6 @@
return string;
}
- public void testReran(String testId, String testClass, String testName,
- int status, String trace) {
- testReran(testId, testClass, testName, status, trace, "", ""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jdt.internal.junit.model.ITestRunListener2#testReran(java
- * .lang.String, java.lang.String, java.lang.String, int,
- * java.lang.String, java.lang.String, java.lang.String)
- */
@Override
public void testReran(String testId, String className, String testName,
int statusCode, String trace, String expectedResult,
@@ -1005,11 +979,6 @@
return testRunnerUI;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jdt.junit.model.ITestElement#getElapsedTimeInSeconds()
- */
@Override
public double getElapsedTimeInSeconds() {
if (fTestRoot == null)
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/GotoReferencedTestAction.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/GotoReferencedTestAction.java
index 63d76ac..ab03337 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/GotoReferencedTestAction.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/GotoReferencedTestAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,24 +14,6 @@
import java.util.List;
import org.eclipse.core.runtime.CoreException;
-
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-
-import org.eclipse.jface.text.ITextSelection;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-
import org.eclipse.dltk.core.IField;
import org.eclipse.dltk.core.IMember;
import org.eclipse.dltk.core.IMethod;
@@ -46,131 +28,163 @@
import org.eclipse.dltk.testing.DLTKTestingMessages;
import org.eclipse.dltk.testing.DLTKTestingPlugin;
import org.eclipse.dltk.ui.DLTKUIPlugin;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
/**
* Shows a dialog with test methods that refer to the selection.
*/
-public class GotoReferencedTestAction implements IWorkbenchWindowActionDelegate {
+public class GotoReferencedTestAction
+ implements IWorkbenchWindowActionDelegate {
ISelection fSelection;
IWorkbenchWindow fWorkbench;
-
+
private void run(IStructuredSelection selection) {
- IModelElement[] elements= getSelectedElements(selection);
+ IModelElement[] elements = getSelectedElements(selection);
if (elements.length == 0) {
- MessageDialog.openInformation(getShell(), DLTKTestingMessages.GotoReferencedTestAction_dialog_title, DLTKTestingMessages.GotoReferencedTestAction_dialog_message);
+ MessageDialog.openInformation(getShell(),
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_title,
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_message);
return;
}
try {
run(elements);
} catch (CoreException e) {
- ErrorDialog.openError(getShell(), DLTKTestingMessages.GotoReferencedTestAction_dialog_title, DLTKTestingMessages.GotoReferencedTestAction_dialog_error, e.getStatus());
+ ErrorDialog.openError(getShell(),
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_title,
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_error,
+ e.getStatus());
}
}
-
+
private void run(ITextSelection ITextSelection) {
try {
- ScriptEditor editor= getActiveEditor();
+ ScriptEditor editor = getActiveEditor();
if (editor == null)
return;
- IModelElement element= SelectionConverter.getElementAtOffset(editor);
- int type= element != null ? element.getElementType() : -1;
+ IModelElement element = SelectionConverter
+ .getElementAtOffset(editor);
+ int type = element != null ? element.getElementType() : -1;
if (type != IModelElement.METHOD && type != IModelElement.TYPE) {
- element= SelectionConverter.getElementAtOffset(editor);
- if (element == null) {
- MessageDialog.openInformation(getShell(), DLTKTestingMessages.GotoReferencedTestAction_dialog_title, DLTKTestingMessages.GotoReferencedTestAction_dialog_error_nomethod);
+ element = SelectionConverter.getElementAtOffset(editor);
+ if (element == null) {
+ MessageDialog.openInformation(getShell(),
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_title,
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_error_nomethod);
return;
- }
+ }
}
- run(new IMember[] { (IMember)element });
+ run(new IMember[] { (IMember) element });
} catch (CoreException e) {
- ErrorDialog.openError(getShell(), DLTKTestingMessages.GotoReferencedTestAction_dialog_title, DLTKTestingMessages.GotoReferencedTestAction_dialog_error, e.getStatus());
+ ErrorDialog.openError(getShell(),
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_title,
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_error,
+ e.getStatus());
}
}
- private void run(IModelElement[] elements) throws PartInitException, ModelException {
- IModelElement element= elements[0];
-
- SelectionStatusDialog dialog = new TestMethodSelectionDialog(getShell(), element);
- dialog.setTitle(DLTKTestingMessages.GotoReferencedTestAction_selectdialog_title);
- String msg= Messages.format(DLTKTestingMessages.GotoReferencedTestAction_dialog_select_message, element.getElementName());
- dialog.setMessage(msg);
-
- if (dialog.open() == Window.CANCEL)
+ private void run(IModelElement[] elements)
+ throws PartInitException, ModelException {
+ IModelElement element = elements[0];
+
+ SelectionStatusDialog dialog = new TestMethodSelectionDialog(getShell(),
+ element);
+ dialog.setTitle(
+ DLTKTestingMessages.GotoReferencedTestAction_selectdialog_title);
+ String msg = Messages.format(
+ DLTKTestingMessages.GotoReferencedTestAction_dialog_select_message,
+ element.getElementName());
+ dialog.setMessage(msg);
+
+ if (dialog.open() == Window.CANCEL)
return;
-
+
Object result = dialog.getFirstResult();
- if (result == null)
+ if (result == null)
return;
-
- openElement((IModelElement)result);
+
+ openElement((IModelElement) result);
}
- private void openElement(IModelElement result) throws ModelException, PartInitException {
- IEditorPart part= DLTKUIPlugin.openInEditor(result);
+ private void openElement(IModelElement result)
+ throws ModelException, PartInitException {
+ IEditorPart part = DLTKUIPlugin.openInEditor(result);
EditorUtility.revealInEditor(part, result);
}
-
- private IModelElement[] getSelectedElements(IStructuredSelection selection) {
- List elements= selection.toList();
- int size= elements.size();
+
+ private IModelElement[] getSelectedElements(
+ IStructuredSelection selection) {
+ List elements = selection.toList();
+ int size = elements.size();
if (size == 0)
return new IModelElement[0];
-
- ArrayList<IModelElement> result= new ArrayList<IModelElement>(size);
-
- for (int i= 0; i < size; i++) {
- Object e= elements.get(i);
+
+ ArrayList<IModelElement> result = new ArrayList<>(size);
+
+ for (int i = 0; i < size; i++) {
+ Object e = elements.get(i);
if (e instanceof ISourceModule) {
- ISourceModule unit= (ISourceModule) e;
- IType[] types= new IType[0];
+ ISourceModule unit = (ISourceModule) e;
+ IType[] types = new IType[0];
try {
- types= unit.getTypes();
+ types = unit.getTypes();
} catch (ModelException ex) {
}
- for (int j= 0; j < types.length; j++) {
+ for (int j = 0; j < types.length; j++) {
result.add(types[j]);
- }
- }
- else if (e instanceof IMethod || e instanceof IType || e instanceof IField) {
- result.add((IModelElement)e);
+ }
+ } else if (e instanceof IMethod || e instanceof IType
+ || e instanceof IField) {
+ result.add((IModelElement) e);
} else {
return new IModelElement[0];
}
}
return result.toArray(new IModelElement[result.size()]);
}
-
+
@Override
public void run(IAction action) {
if (fSelection instanceof IStructuredSelection)
- run((IStructuredSelection)fSelection);
- else if (fSelection instanceof ITextSelection)
- run((ITextSelection)fSelection);
+ run((IStructuredSelection) fSelection);
+ else if (fSelection instanceof ITextSelection)
+ run((ITextSelection) fSelection);
}
-
+
@Override
public void selectionChanged(IAction action, ISelection selection) {
- fSelection= selection;
+ fSelection = selection;
action.setEnabled(getActiveEditor() != null);
}
-
+
private Shell getShell() {
if (fWorkbench != null)
return fWorkbench.getShell();
return DLTKTestingPlugin.getActiveWorkbenchShell();
}
-
+
@Override
public void dispose() {
}
-
+
@Override
public void init(IWorkbenchWindow window) {
- fWorkbench= window;
+ fWorkbench = window;
}
-
+
private ScriptEditor getActiveEditor() {
- IEditorPart editor= fWorkbench.getActivePage().getActiveEditor();
+ IEditorPart editor = fWorkbench.getActivePage().getActiveEditor();
if (editor instanceof ScriptEditor)
return (ScriptEditor) editor;
return null;
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionTableContentProvider.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionTableContentProvider.java
index 6690df3..ebd2a2b 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionTableContentProvider.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/ui/TestSessionTableContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,19 +13,16 @@
import java.util.ArrayList;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
import org.eclipse.dltk.internal.testing.model.TestCaseElement;
import org.eclipse.dltk.internal.testing.model.TestContainerElement;
import org.eclipse.dltk.internal.testing.model.TestRoot;
import org.eclipse.dltk.internal.testing.model.TestSuiteElement;
import org.eclipse.dltk.testing.model.ITestElement;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
-
-
-
-public class TestSessionTableContentProvider implements IStructuredContentProvider {
+public class TestSessionTableContentProvider
+ implements IStructuredContentProvider {
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
@@ -33,15 +30,15 @@
@Override
public Object[] getElements(Object inputElement) {
- ArrayList all= new ArrayList();
+ ArrayList<Object> all = new ArrayList<>();
addAll(all, (TestRoot) inputElement);
return all.toArray();
}
- private void addAll(ArrayList all, TestContainerElement suite) {
- ITestElement[] children= suite.getChildren();
- for (int i= 0; i < children.length; i++) {
- ITestElement element= children[i];
+ private void addAll(ArrayList<Object> all, TestContainerElement suite) {
+ ITestElement[] children = suite.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ ITestElement element = children[i];
if (element instanceof TestContainerElement) {
final TestContainerElement container = (TestContainerElement) element;
if (element instanceof TestSuiteElement) {
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/Resources.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/Resources.java
index f23eedb..c7d0300 100755
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/Resources.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/Resources.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,20 +17,17 @@
import java.util.List;
import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.Status;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.ResourcesPlugin;
-
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.dltk.internal.testing.Messages;
import org.eclipse.dltk.testing.DLTKTestingMessages;
import org.eclipse.dltk.testing.DLTKTestingPlugin;
-
public class Resources {
private Resources() {
@@ -38,8 +35,9 @@
/**
* Checks if the given resource is in sync with the underlying file system.
- *
- * @param resource the resource to be checked
+ *
+ * @param resource
+ * the resource to be checked
* @return IStatus status describing the check's result. If <code>status.
* isOK()</code> returns <code>true</code> then the resource is in sync
*/
@@ -50,36 +48,40 @@
/**
* Checks if the given resources are in sync with the underlying file
* system.
- *
- * @param resources the resources to be checked
+ *
+ * @param resources
+ * the resources to be checked
* @return IStatus status describing the check's result. If <code>status.
* isOK() </code> returns <code>true</code> then the resources are in sync
*/
public static IStatus checkInSync(IResource[] resources) {
- IStatus result= null;
- for (int i= 0; i < resources.length; i++) {
- IResource resource= resources[i];
+ IStatus result = null;
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
if (!resource.isSynchronized(IResource.DEPTH_INFINITE)) {
- result= addOutOfSync(result, resource);
+ result = addOutOfSync(result, resource);
}
}
if (result != null)
return result;
- return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$
+ return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(),
+ IStatus.OK, "", null); //$NON-NLS-1$
}
/**
* Makes the given resource committable. Committable means that it is
* writeable and that its content hasn't changed by calling
* <code>validateEdit</code> for the given resource on <tt>IWorkspace</tt>.
- *
- * @param resource the resource to be checked
- * @param context the context passed to <code>validateEdit</code>
+ *
+ * @param resource
+ * the resource to be checked
+ * @param context
+ * the context passed to <code>validateEdit</code>
* @return IStatus status describing the method's result. If <code>status.
* isOK()</code> returns <code>true</code> then the resource are committable
- *
+ *
* @see org.eclipse.core.resources.IWorkspace#validateEdit(org.eclipse.core.
- * resources.IFile[], java.lang.Object)
+ * resources.IFile[], java.lang.Object)
*/
public static IStatus makeCommittable(IResource resource, Object context) {
return makeCommittable(new IResource[] { resource }, context);
@@ -90,60 +92,78 @@
* resources are writeable and that the content of the resources hasn't
* changed by calling <code>validateEdit</code> for a given file on
* <tt>IWorkspace</tt>.
- *
- * @param resources the resources to be checked
- * @param context the context passed to <code>validateEdit</code>
+ *
+ * @param resources
+ * the resources to be checked
+ * @param context
+ * the context passed to <code>validateEdit</code>
* @return IStatus status describing the method's result. If <code>status.
* isOK()</code> returns <code>true</code> then the add resources are
- * committable
- *
- * @see org.eclipse.core.resources.IWorkspace#validateEdit(org.eclipse.core.resources.IFile[], java.lang.Object)
+ * committable
+ *
+ * @see org.eclipse.core.resources.IWorkspace#validateEdit(org.eclipse.core.resources.IFile[],
+ * java.lang.Object)
*/
- public static IStatus makeCommittable(IResource[] resources, Object context) {
- List<IFile> readOnlyFiles= new ArrayList<IFile>();
- for (int i= 0; i < resources.length; i++) {
- IResource resource= resources[i];
- if (resource.getType() == IResource.FILE && resource.getResourceAttributes().isReadOnly())
- readOnlyFiles.add((IFile)resource);
+ public static IStatus makeCommittable(IResource[] resources,
+ Object context) {
+ List<IFile> readOnlyFiles = new ArrayList<>();
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ if (resource.getType() == IResource.FILE
+ && resource.getResourceAttributes().isReadOnly())
+ readOnlyFiles.add((IFile) resource);
}
if (readOnlyFiles.size() == 0)
- return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$
+ return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(),
+ IStatus.OK, "", null); //$NON-NLS-1$
- Map<IFile, Long> oldTimeStamps= createModificationStampMap(readOnlyFiles);
- IStatus status= ResourcesPlugin.getWorkspace().validateEdit(readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]), context);
+ Map<IFile, Long> oldTimeStamps = createModificationStampMap(
+ readOnlyFiles);
+ IStatus status = ResourcesPlugin.getWorkspace().validateEdit(
+ readOnlyFiles.toArray(new IFile[readOnlyFiles.size()]),
+ context);
if (!status.isOK())
return status;
- IStatus modified= null;
- Map<IFile, Long> newTimeStamps= createModificationStampMap(readOnlyFiles);
- for (Iterator<IFile> iter= oldTimeStamps.keySet().iterator(); iter.hasNext();) {
- IFile file= iter.next();
+ IStatus modified = null;
+ Map<IFile, Long> newTimeStamps = createModificationStampMap(
+ readOnlyFiles);
+ for (Iterator<IFile> iter = oldTimeStamps.keySet().iterator(); iter
+ .hasNext();) {
+ IFile file = iter.next();
if (!oldTimeStamps.get(file).equals(newTimeStamps.get(file)))
- modified= addModified(modified, file);
+ modified = addModified(modified, file);
}
if (modified != null)
return modified;
- return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$
+ return new Status(IStatus.OK, DLTKTestingPlugin.getPluginId(),
+ IStatus.OK, "", null); //$NON-NLS-1$
}
- private static Map<IFile, Long> createModificationStampMap(List<IFile> files) {
- Map<IFile, Long> map= new HashMap<IFile, Long>();
- for (Iterator<IFile> iter= files.iterator(); iter.hasNext();) {
- IFile file= iter.next();
+ private static Map<IFile, Long> createModificationStampMap(
+ List<IFile> files) {
+ Map<IFile, Long> map = new HashMap<>();
+ for (Iterator<IFile> iter = files.iterator(); iter.hasNext();) {
+ IFile file = iter.next();
map.put(file, Long.valueOf(file.getModificationStamp()));
}
return map;
}
private static IStatus addModified(IStatus status, IFile file) {
- IStatus entry= new Status(IStatus.ERROR, DLTKTestingPlugin.PLUGIN_ID, Messages.format(DLTKTestingMessages.Resources_fileModified, file.getFullPath().toString()));
+ IStatus entry = new Status(IStatus.ERROR, DLTKTestingPlugin.PLUGIN_ID,
+ Messages.format(DLTKTestingMessages.Resources_fileModified,
+ file.getFullPath().toString()));
if (status == null) {
return entry;
} else if (status.isMultiStatus()) {
((MultiStatus) status).add(entry);
return status;
} else {
- MultiStatus result= new MultiStatus(DLTKTestingPlugin.getPluginId(), IDLTKTestingStatusConstants.VALIDATE_EDIT_CHANGED_CONTENT, DLTKTestingMessages.Resources_modifiedResources, null);
+ MultiStatus result = new MultiStatus(
+ DLTKTestingPlugin.getPluginId(),
+ IDLTKTestingStatusConstants.VALIDATE_EDIT_CHANGED_CONTENT,
+ DLTKTestingMessages.Resources_modifiedResources, null);
result.add(status);
result.add(entry);
return result;
@@ -151,15 +171,20 @@
}
private static IStatus addOutOfSync(IStatus status, IResource resource) {
- IStatus entry= new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.OUT_OF_SYNC_LOCAL,
- Messages.format(DLTKTestingMessages.Resources_outOfSync, resource.getFullPath().toString()), null);
+ IStatus entry = new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES,
+ IResourceStatus.OUT_OF_SYNC_LOCAL,
+ Messages.format(DLTKTestingMessages.Resources_outOfSync,
+ resource.getFullPath().toString()),
+ null);
if (status == null) {
return entry;
} else if (status.isMultiStatus()) {
((MultiStatus) status).add(entry);
return status;
} else {
- MultiStatus result= new MultiStatus(ResourcesPlugin.PI_RESOURCES, IResourceStatus.OUT_OF_SYNC_LOCAL, DLTKTestingMessages.Resources_outOfSyncResources, null);
+ MultiStatus result = new MultiStatus(ResourcesPlugin.PI_RESOURCES,
+ IResourceStatus.OUT_OF_SYNC_LOCAL,
+ DLTKTestingMessages.Resources_outOfSyncResources, null);
result.add(status);
result.add(entry);
return result;
diff --git a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/TestingConsoleListener.java b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/TestingConsoleListener.java
index ee2cb72..c49cee4 100644
--- a/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/TestingConsoleListener.java
+++ b/core/plugins/org.eclipse.dltk.testing/src/org/eclipse/dltk/internal/testing/util/TestingConsoleListener.java
@@ -14,7 +14,6 @@
public class TestingConsoleListener implements IConsoleListener {
private final String launchKey;
- private final ILaunch launch;
private final ITestingProcessor processor;
private boolean initialized = false;
private boolean finalized = false;
@@ -22,7 +21,6 @@
public TestingConsoleListener(String launchKey, ILaunch launch,
ITestingProcessor processor) {
this.launchKey = launchKey;
- this.launch = launch;
this.processor = processor;
}
@@ -44,19 +42,16 @@
if (console instanceof org.eclipse.debug.ui.console.IConsole) {
org.eclipse.debug.ui.console.IConsole pc = (org.eclipse.debug.ui.console.IConsole) console;
IProcess process = pc.getProcess();
- if (process != null
- && launchKey.equals(process.getLaunch().getAttribute(
- DLTKTestingConstants.LAUNCH_ATTR_KEY))) {
+ if (process != null && launchKey.equals(process.getLaunch()
+ .getAttribute(DLTKTestingConstants.LAUNCH_ATTR_KEY))) {
process((TextConsole) console);
initialized = true;
}
} else if (console instanceof ScriptDebugConsole) {
ScriptDebugConsole cl = (ScriptDebugConsole) console;
ILaunch launch2 = cl.getLaunch();
- if (launch2 != null
- && launchKey
- .equals(launch2
- .getAttribute(DLTKTestingConstants.LAUNCH_ATTR_KEY))) {
+ if (launch2 != null && launchKey.equals(launch2
+ .getAttribute(DLTKTestingConstants.LAUNCH_ATTR_KEY))) {
process(cl);
initialized = true;
}
@@ -83,7 +78,8 @@
}
@Override
- public synchronized void lineAppended(IRegion region, String content) {
+ public synchronized void lineAppended(IRegion region,
+ String content) {
if (first) {
first = false;
processor.start();
@@ -128,7 +124,7 @@
}
/**
- *
+ *
*/
public void install() {
if (initialized) {