Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 16:20:42 +0000
committerJonah Graham2018-11-22 21:47:02 +0000
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /testsrunner/org.eclipse.cdt.testsrunner
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'testsrunner/org.eclipse.cdt.testsrunner')
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java58
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/DsfGdbRunTestsLaunchDelegate.java13
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ITestsLaunchConfigurationConstants.java2
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ProcessWrapper.java18
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/RunTestsLaunchDelegate.java13
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestingProcessFactory.java29
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProviderInfo.java34
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java24
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/ITestingSessionsManagerListener.java8
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java13
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestItem.java5
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestLocation.java3
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestMessage.java3
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java135
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java13
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java112
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java65
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/CTestingTab.java48
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/EmptyConfigurationTabGroup.java5
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/CounterPanel.java26
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/DummyUISession.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java182
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressBar.java46
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressCountPanel.java23
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsPanel.java48
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsView.java91
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java35
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java188
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java134
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedMessagesAction.java15
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedTestsAction.java15
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java96
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessageLevelFilterAction.java9
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessagesOrderingAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/OpenInEditorAction.java31
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RedebugSelectedAction.java6
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RelaunchSelectedAction.java19
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunAction.java7
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunSelectedAction.java6
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ScrollLockAction.java5
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFailedOnlyAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFileNameOnlyAction.java6
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowNextFailureAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowPreviousFailureAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTestsInHierarchyAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTimeAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/StopAction.java7
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyCollapseAllAction.java9
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyExpandAllAction.java9
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ToggleOrientationAction.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java149
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerConstants.java12
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProvider.java11
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProviderInfo.java18
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/IModelVisitor.java16
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestCase.java8
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestItem.java34
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestLocation.java8
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestMessage.java29
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelAccessor.java12
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelUpdater.java41
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestSuite.java4
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSession.java40
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSessionListener.java16
-rw-r--r--testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/TestingException.java19
65 files changed, 1002 insertions, 1061 deletions
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java
index 649005bf4a9..51c587818da 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/TestsRunnerPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -42,25 +42,24 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/** The plug-in ID. */
private static final String PLUGIN_ID = "org.eclipse.cdt.testsrunner"; //$NON-NLS-1$
-
+
/** The path to the plugin icons */
private static final IPath ICONS_PATH = new Path("$nl$/icons"); //$NON-NLS-1$
/** Plug-in instance. */
private static TestsRunnerPlugin plugin;
-
+
private TestsRunnerProvidersManager testsRunnerProvidersManager = new TestsRunnerProvidersManager();
private TestingSessionsManager testingSessionsManager = new TestingSessionsManager(testsRunnerProvidersManager);
-
public TestsRunnerPlugin() {
super();
plugin = this;
}
-
+
/**
* Returns the Tests Runner Plug-in instance
- *
+ *
* @return the plug-in instance
*/
public static TestsRunnerPlugin getDefault() {
@@ -74,16 +73,16 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Logs the specified status with this plug-in's log.
- *
+ *
* @param status status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
/**
* Logs an internal error with the specified message.
- *
+ *
* @param message the error message to log
*/
public static void logErrorMessage(String message) {
@@ -92,7 +91,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Logs an internal error with the specified throwable
- *
+ *
* @param e the exception to be logged
*/
public static void log(Throwable e) {
@@ -100,20 +99,20 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
}
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
-
+
setDefaultLaunchDelegates();
}
@Override
- public void stop(BundleContext context) throws Exception {
+ public void stop(BundleContext context) throws Exception {
super.stop(context);
}
/**
* Access the plugin's Testing Sessions Manager instance.
- *
+ *
* @return sessions manager
*/
public TestingSessionsManager getTestingSessionsManager() {
@@ -122,7 +121,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Access the plugin's Test Runners manager instance.
- *
+ *
* @return tests runners manager
*/
public TestsRunnerProvidersManager getTestsRunnerProvidersManager() {
@@ -131,7 +130,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Returns the descriptor for image with <code>relativePath</code> path.
- *
+ *
* @param relativePath path relative to <code>ICONS_PATH</code>
* @return image descriptor
*/
@@ -141,7 +140,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Returns the descriptor for image with <code>relativePath</code> path.
- *
+ *
* @param relativePath path relative to <code>ICONS_PATH</code>
* @return image descriptor
*/
@@ -152,7 +151,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Returns the image with the specified path.
- *
+ *
* @param path path
* @return image image
*/
@@ -162,7 +161,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
/**
* Returns the image with the specified path.
- *
+ *
* @param path path
* @return image image
*/
@@ -180,7 +179,7 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
* contain variables like $NL$. If no image could be found,
* <code>useMissingImageDescriptor</code> decides if either the 'missing
* image descriptor' is returned or <code>null</code>.
- *
+ *
* @param bundle a bundle
* @param path path in the bundle
* @param useMissingImageDescriptor if <code>true</code>, returns the shared
@@ -200,12 +199,12 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
}
return null;
}
-
+
/**
* Setup the launch delegate with id <code>delegateId</code> as default for
* launch configuration type <code>cfgType</code> for <code>mode</code>
* launch mode.
- *
+ *
* @param cfgType launch configuration type
* @param delegateId unique identifier of the launch delegate
* @param mode launch mode
@@ -227,16 +226,19 @@ public class TestsRunnerPlugin extends AbstractUIPlugin {
log(e);
}
}
-
+
/**
* Sets up the default launch delegates for the Tests Runner's launch configuration type.
*/
private void setDefaultLaunchDelegates() {
ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType configurationType = launchMgr.getLaunchConfigurationType(ITestsRunnerConstants.LAUNCH_CONFIGURATION_TYPE_ID);
-
- setDefaultLaunchDelegate(configurationType, ITestsRunnerConstants.PREFERRED_DEBUG_TESTS_LAUNCH_DELEGATE, ILaunchManager.DEBUG_MODE);
- setDefaultLaunchDelegate(configurationType, ITestsRunnerConstants.PREFERRED_RUN_TESTS_LAUNCH_DELEGATE, ILaunchManager.RUN_MODE);
+ ILaunchConfigurationType configurationType = launchMgr
+ .getLaunchConfigurationType(ITestsRunnerConstants.LAUNCH_CONFIGURATION_TYPE_ID);
+
+ setDefaultLaunchDelegate(configurationType, ITestsRunnerConstants.PREFERRED_DEBUG_TESTS_LAUNCH_DELEGATE,
+ ILaunchManager.DEBUG_MODE);
+ setDefaultLaunchDelegate(configurationType, ITestsRunnerConstants.PREFERRED_RUN_TESTS_LAUNCH_DELEGATE,
+ ILaunchManager.RUN_MODE);
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/DsfGdbRunTestsLaunchDelegate.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/DsfGdbRunTestsLaunchDelegate.java
index 544767eea3a..7e52384a439 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/DsfGdbRunTestsLaunchDelegate.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/DsfGdbRunTestsLaunchDelegate.java
@@ -15,15 +15,14 @@ package org.eclipse.cdt.testsrunner.internal.launcher;
import org.eclipse.cdt.testsrunner.launcher.BaseTestsLaunchDelegate;
-
/**
* Launch delegate implementation that redirects its queries to DSF.
*/
public class DsfGdbRunTestsLaunchDelegate extends BaseTestsLaunchDelegate {
-
- @Override
- public String getPreferredDelegateId() {
- return "org.eclipse.cdt.dsf.gdb.launch.localCLaunch"; //$NON-NLS-1$
- }
-
+
+ @Override
+ public String getPreferredDelegateId() {
+ return "org.eclipse.cdt.dsf.gdb.launch.localCLaunch"; //$NON-NLS-1$
+ }
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ITestsLaunchConfigurationConstants.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ITestsLaunchConfigurationConstants.java
index 67bc302aa2f..33bd2e017ae 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ITestsLaunchConfigurationConstants.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ITestsLaunchConfigurationConstants.java
@@ -16,7 +16,7 @@ package org.eclipse.cdt.testsrunner.internal.launcher;
/**
* Constants used for attributes in CDT Unit Testing Support launch
* configurations.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ProcessWrapper.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ProcessWrapper.java
index 9812a39be72..9b0a5d38eec 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ProcessWrapper.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/ProcessWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -21,26 +21,25 @@ import java.io.OutputStream;
* Wraps the underline process and prevent accessing to its output or error stream.
* This wrapping is necessary to prevent handling the test module output by Console
* because we want to handle it here.
- *
+ *
*/
class ProcessWrapper extends Process {
-
+
/** The real underlying process. */
private Process wrappedProcess;
-
+
/** The flag shows whether input stream should be replaced with empty dummy. */
private boolean hideInputStream;
/** The flag shows whether error stream should be replaced with empty dummy. */
private boolean hideErrorStream;
-
/** Buffer for empty dummy stream. */
private byte buffer[] = new byte[0];
/** Empty dummy stream. */
private InputStream emptyInputStream = new ByteArrayInputStream(buffer);
-
+
/**
* The synchronization event: before it happens <code>waitFor()</code> will
* not be called on underlying process object. See also the comments in
@@ -54,10 +53,9 @@ class ProcessWrapper extends Process {
*/
private boolean streamsClosingIsAllowed = false;
-
/**
* The constructor
- *
+ *
* @param wrappedProcess underlying process
* @param hideInputStream process input stream should be hidden
* @param hideErrorStream process error stream should be hidden
@@ -67,7 +65,7 @@ class ProcessWrapper extends Process {
this.hideInputStream = hideInputStream;
this.hideErrorStream = hideErrorStream;
}
-
+
@Override
public void destroy() {
wrappedProcess.destroy();
@@ -104,7 +102,7 @@ class ProcessWrapper extends Process {
}
return wrappedProcess.waitFor();
}
-
+
/**
* Sets up the flag the allows IO streams closing.
*/
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/RunTestsLaunchDelegate.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/RunTestsLaunchDelegate.java
index 06c8c27e29c..4f1d949cd86 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/RunTestsLaunchDelegate.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/RunTestsLaunchDelegate.java
@@ -15,16 +15,15 @@ package org.eclipse.cdt.testsrunner.internal.launcher;
import org.eclipse.cdt.testsrunner.launcher.BaseTestsLaunchDelegate;
-
/**
* Launch delegate implementation that is used for Run mode.
* @since 8.0
*/
public class RunTestsLaunchDelegate extends BaseTestsLaunchDelegate {
-
- @Override
- public String getPreferredDelegateId() {
- return "org.eclipse.cdt.cdi.launch.localCLaunch"; //$NON-NLS-1$
- }
-
+
+ @Override
+ public String getPreferredDelegateId() {
+ return "org.eclipse.cdt.cdi.launch.localCLaunch"; //$NON-NLS-1$
+ }
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestingProcessFactory.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestingProcessFactory.java
index 1b58e3fe9f3..82ec381c010 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestingProcessFactory.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestingProcessFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -43,29 +43,28 @@ public class TestingProcessFactory implements IProcessFactory {
private TestingSession testingSession;
private InputStream iStream;
private ProcessWrapper processWrapper;
-
+
TestingSessionRunner(TestingSession testingSession, InputStream iStream, ProcessWrapper processWrapper) {
this.testingSession = testingSession;
this.iStream = iStream;
this.processWrapper = processWrapper;
}
-
+
@Override
public void run() {
try {
testingSession.run(iStream);
- }
- finally {
+ } finally {
// Streams should be closed anyway to avoid testing process hang up
processWrapper.allowStreamsClosing();
}
}
}
-
+
/**
* Creates a wrapper for the specified process to handle its input or error
* stream.
- *
+ *
* @param launch launch
* @param process process to wrap
* @return wrapped process
@@ -74,19 +73,19 @@ public class TestingProcessFactory implements IProcessFactory {
private Process wrapProcess(ILaunch launch, Process process) throws CoreException {
TestingSession testingSession = TestsRunnerPlugin.getDefault().getTestingSessionsManager().newSession(launch);
ITestsRunnerProviderInfo testsRunnerProvider = testingSession.getTestsRunnerProviderInfo();
- InputStream iStream =
- testsRunnerProvider.isOutputStreamRequired() ? process.getInputStream() :
- testsRunnerProvider.isErrorStreamRequired() ? process.getErrorStream() : null;
- ProcessWrapper processWrapper = new ProcessWrapper(process, testsRunnerProvider.isOutputStreamRequired(), testsRunnerProvider.isErrorStreamRequired());
+ InputStream iStream = testsRunnerProvider.isOutputStreamRequired() ? process.getInputStream()
+ : testsRunnerProvider.isErrorStreamRequired() ? process.getErrorStream() : null;
+ ProcessWrapper processWrapper = new ProcessWrapper(process, testsRunnerProvider.isOutputStreamRequired(),
+ testsRunnerProvider.isErrorStreamRequired());
Thread t = new Thread(new TestingSessionRunner(testingSession, iStream, processWrapper));
t.start();
return processWrapper;
}
-
+
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) {
-
+
try {
// Mimic the behavior of DSF GDBProcessFactory.
if (attributes != null) {
@@ -94,12 +93,12 @@ public class TestingProcessFactory implements IProcessFactory {
if (IGdbDebugConstants.GDB_PROCESS_CREATION_VALUE.equals(processTypeCreationAttrValue)) {
return new GDBProcess(launch, process, label, attributes);
}
-
+
if (IGdbDebugConstants.INFERIOR_PROCESS_CREATION_VALUE.equals(processTypeCreationAttrValue)) {
return new InferiorRuntimeProcess(launch, wrapProcess(launch, process), label, attributes);
}
- // Probably, it is CDI creating a new inferior process
+ // Probably, it is CDI creating a new inferior process
} else {
return new RuntimeProcess(launch, wrapProcess(launch, process), label, attributes);
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProviderInfo.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProviderInfo.java
index ab1b52bc013..6280f3ce023 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProviderInfo.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProviderInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
* provider plug-in).
*/
public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
-
+
private static final String TESTS_RUNNER_FEATURES_ELEMENT = "features"; //$NON-NLS-1$
private static final String TESTS_RUNNER_FEATURE_MULTIPLE_TEST_FILTER_ATTRIBUTE = "multipleTestFilter"; //$NON-NLS-1$
private static final String TESTS_RUNNER_FEATURE_TESTING_TIME_MEASUREMENT_ATTRIBUTE = "testingTimeMeasurement"; //$NON-NLS-1$
@@ -42,7 +42,7 @@ public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
/**
* The constructor.
- *
+ *
* @param element configuration element of the Tests Runner provider plug-ins extension point
*/
public TestsRunnerProviderInfo(IConfigurationElement element) {
@@ -67,29 +67,29 @@ public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
/**
* Instantiates Tests Runner provider plug-in and return its main interface.
- *
+ *
* @note Instantiated Tests Runner provider plug-in objects are not cached
* and are instantiated as much times as
* <code>instantiateTestsRunnerProvider()</code> is called.
- *
+ *
* @return Tests Runner provider plug-in main interface
*/
public ITestsRunnerProvider instantiateTestsRunnerProvider() {
try {
Object object = element.createExecutableExtension(TESTS_RUNNER_CLASS_ATTRIBUTE);
if (object instanceof ITestsRunnerProvider) {
- return (ITestsRunnerProvider)object;
+ return (ITestsRunnerProvider) object;
}
} catch (CoreException e) {
TestsRunnerPlugin.log(e);
}
return null;
}
-
+
/**
* Provides an access to the 'features' node of Tests Runner provider
* plug-in configuration element.
- *
+ *
* @return 'features' configuration element
*/
private IConfigurationElement getFeatures() {
@@ -99,10 +99,10 @@ public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
}
return null;
}
-
+
/**
* Provides an access to the value of the feature with specified name.
- *
+ *
* @param featureName
* @return feature value or null if there is no features described or there
* is no feature with such name
@@ -114,12 +114,12 @@ public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
}
return null;
}
-
+
/**
* Provides an access to the boolean value of the feature with the specified
* name. If the feature with such name cannot be accessed or it contains
* invalid boolean value, the default value will be returned.
- *
+ *
* @param featureName
* @param defaultValue
* @return feature value or null if there is no features described or there
@@ -132,28 +132,28 @@ public class TestsRunnerProviderInfo implements ITestsRunnerProviderInfo {
}
return defaultValue;
}
-
+
@Override
public boolean isAllowedMultipleTestFilter() {
return getBooleanFeatureValue(TESTS_RUNNER_FEATURE_MULTIPLE_TEST_FILTER_ATTRIBUTE, false);
}
-
+
/**
* Returns whether test execution time measurement should be performed by
* the Tests Runner Plug-in.
- *
+ *
* @note It should be used only if testing framework does not provide
* execution time measurement, cause measurement by Tests Runner Plug-in is
* not very precise (it also takes into account output processing & internal
* model building time).
- *
+ *
* @return whether testing time measurement should be done by Tests Runner
* Plug-in
*/
public boolean isAllowedTestingTimeMeasurement() {
return getBooleanFeatureValue(TESTS_RUNNER_FEATURE_TESTING_TIME_MEASUREMENT_ATTRIBUTE, false);
}
-
+
@Override
public boolean isOutputStreamRequired() {
return !isErrorStreamRequired();
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java
index 8640638ca4c..28d425805fa 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/launcher/TestsRunnerProvidersManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,28 +26,29 @@ import org.eclipse.debug.core.ILaunchConfiguration;
* provides the convenient access to it.
*/
public class TestsRunnerProvidersManager {
-
+
/** Tests Runner Plug-ins extension point ID. */
private static final String TESTS_RUNNER_EXTENSION_POINT_ID = "org.eclipse.cdt.testsrunner.TestsRunner"; //$NON-NLS-1$
/** Tests Runner Plug-ins information collection. */
private TestsRunnerProviderInfo[] testsRunnerProviders = null;
-
/**
* Provides access to information about all registered Tests Runner
* Plug-ins.
- *
+ *
* @return array of tests runner plug-ins descriptors
*/
public TestsRunnerProviderInfo[] getTestsRunnersProviderInfo() {
if (testsRunnerProviders == null) {
// Initialize tests runners info
List<TestsRunnerProviderInfo> testsRunnerProvidersList = new ArrayList<TestsRunnerProviderInfo>();
- for (IConfigurationElement element : Platform.getExtensionRegistry().getConfigurationElementsFor(TESTS_RUNNER_EXTENSION_POINT_ID)) {
+ for (IConfigurationElement element : Platform.getExtensionRegistry()
+ .getConfigurationElementsFor(TESTS_RUNNER_EXTENSION_POINT_ID)) {
testsRunnerProvidersList.add(new TestsRunnerProviderInfo(element));
}
- testsRunnerProviders = testsRunnerProvidersList.toArray(new TestsRunnerProviderInfo[testsRunnerProvidersList.size()]);
+ testsRunnerProviders = testsRunnerProvidersList
+ .toArray(new TestsRunnerProviderInfo[testsRunnerProvidersList.size()]);
}
return testsRunnerProviders;
}
@@ -55,18 +56,19 @@ public class TestsRunnerProvidersManager {
/**
* Provides access to information about Tests Runner Plug-in referred in the
* specified launch configuration.
- *
+ *
* @return tests runner plug-in descriptor
*/
public TestsRunnerProviderInfo getTestsRunnerProviderInfo(ILaunchConfiguration launchConf) throws CoreException {
- String testsRunnerId = launchConf.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_RUNNER, (String)null);
+ String testsRunnerId = launchConf.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_RUNNER,
+ (String) null);
return getTestsRunnerProviderInfo(testsRunnerId);
}
-
+
/**
* Provides access to information about Tests Runner Plug-in with the
* specified ID.
- *
+ *
* @return tests runner plug-in descriptor
*/
private TestsRunnerProviderInfo getTestsRunnerProviderInfo(String testsRunnerProviderId) {
@@ -79,5 +81,5 @@ public class TestsRunnerProvidersManager {
}
return null;
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/ITestingSessionsManagerListener.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/ITestingSessionsManagerListener.java
index 54d31b0778b..582feb3ca95 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/ITestingSessionsManagerListener.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/ITestingSessionsManagerListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -17,7 +17,7 @@ import org.eclipse.cdt.testsrunner.model.ITestingSession;
/**
* Testing sessions manager listener is notified of testing sessions management.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -25,9 +25,9 @@ public interface ITestingSessionsManagerListener {
/**
* Notifies the listener that the specified testing session was activated.
- *
+ *
* @param testingSession the activated testing session
*/
void sessionActivated(ITestingSession testingSession);
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java
index fe47b0995db..4ee08dbe835 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -36,12 +36,11 @@ public class TestCase extends TestItem implements ITestCase {
*/
private List<TestMessage> testMessages = new ArrayList<TestMessage>();
-
public TestCase(String name, TestSuite parent) {
super(name, parent);
reset();
}
-
+
@Override
public Status getStatus() {
return status;
@@ -56,7 +55,7 @@ public class TestCase extends TestItem implements ITestCase {
public TestMessage[] getTestMessages() {
return testMessages.toArray(new TestMessage[testMessages.size()]);
}
-
+
@Override
public void visit(IModelVisitor visitor) {
visitor.visit(this);
@@ -77,7 +76,7 @@ public class TestCase extends TestItem implements ITestCase {
/**
* Modifies the status of the test case.
- *
+ *
* @param status new test status
*/
public void setStatus(Status status) {
@@ -86,7 +85,7 @@ public class TestCase extends TestItem implements ITestCase {
/**
* Modifies the execution time of the test case.
- *
+ *
* @param testingTime new test execution time
*/
public void setTestingTime(int testingTime) {
@@ -95,7 +94,7 @@ public class TestCase extends TestItem implements ITestCase {
/**
* Adds a new test message to the test case.
- *
+ *
* @param testMessage message
*/
public void addTestMessage(TestMessage testMessage) {
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestItem.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestItem.java
index 303c2225608..965c6dd1006 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestItem.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,11 +26,10 @@ public abstract class TestItem implements ITestItem {
/** Test item name. */
private final String name;
-
+
/** Item parent test suite. May be <code>null</code> for root test suite. */
private TestSuite parent;
-
public TestItem(String name, TestSuite parent) {
this.name = name;
this.parent = parent;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestLocation.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestLocation.java
index 062de3598ee..3cdb846d153 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestLocation.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestLocation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,7 +26,6 @@ public class TestLocation implements ITestLocation {
/** Stores the line number on which testing object is located. */
private int line;
-
public TestLocation(String file, int line) {
this.file = file;
this.line = line;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestMessage.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestMessage.java
index d57ff314b2b..8ab78405dce 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestMessage.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestMessage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -30,7 +30,6 @@ public class TestMessage implements ITestMessage {
/** Test message text */
private String text;
-
public TestMessage(TestLocation location, Level level, String text) {
this.location = location;
this.level = level;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java
index 6df14bf1d5d..2b4ef8caae7 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestModelManager.java
@@ -40,12 +40,12 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
/**
* Name of the root test suite.
- *
+ *
* @note Root test suite is invisible (only its children are visible), so
* the name is not important.
*/
public static final String ROOT_TEST_SUITE_NAME = "<root>"; //$NON-NLS-1$
-
+
/** Stack of the currently entered (and not existed) test suites. */
private Stack<TestSuite> testSuitesStack = new Stack<TestSuite>();
@@ -54,34 +54,33 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
* collection is not necessary.
*/
private TestCase currentTestCase = null;
-
+
/**
* The mapping of test suite object to the index on which it was inserted to
* the parent.
- *
+ *
* @note Test suites presence in this map means that test suite was visited
* during the testing process (not visited test suites are removed when
* testing is finished cause they are considered as renamed or removed).
* @note Test suite insert position is important for insertion algorithm.
*/
private Map<TestItem, Integer> testSuitesIndex = new HashMap<TestItem, Integer>();
-
+
/** Listeners collection. */
private List<ITestingSessionListener> listeners = new ArrayList<ITestingSessionListener>();
-
+
/** Flag stores whether test execution time should be measured for the session. */
private boolean timeMeasurement = false;
/** Stores the test case start time or 0 there is no currently running test case. */
private long testCaseStartTime = 0;
-
+
/** Instance of the insertion algorithm for test suites. */
private TestSuiteInserter testSuiteInserter = new TestSuiteInserter();
/** Instance of the insertion algorithm for test cases. */
private TestCaseInserter testCaseInserter = new TestCaseInserter();
-
/**
* Builds current tests hierarchy from the other one (copies only necessary
* information).
@@ -116,16 +115,18 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
@Override
- public void visit(ITestMessage testMessage) {}
+ public void visit(ITestMessage testMessage) {
+ }
+
@Override
- public void leave(ITestMessage testMessage) {}
+ public void leave(ITestMessage testMessage) {
+ }
}
-
/**
* Utility class: generalization of insertion algorithm for test suites and
* test cases.
- *
+ *
* <p>
* The algorithm tries to find the place where the new item should be
* inserted at. If the item with such name does not exist in the current top
@@ -133,7 +134,7 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
* already exists (at the next or previous position) then it should be moved
* from there to the current one.
* </p>
- *
+ *
* @param <E> test item type (test suite or test case)
*/
private abstract class TestItemInserter<E extends TestItem> {
@@ -141,49 +142,48 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
/**
* Check whether item has the required type (test suite for suites inserter and
* test case for cases one).
- *
+ *
* @param item test item to check
* @return whether item has the required type
*/
protected abstract boolean isRequiredTestItemType(TestItem item);
-
+
/**
* Creates a new item type with the specified name and parent (test
* suite for suites inserter and test case for cases one).
- *
+ *
* @param name name of the new test item
* @param parent parent for the new test item
* @return new test item
*/
protected abstract E createTestItem(String name, TestSuite parent);
-
+
/**
* Save new test item in the tracking structures (suite in stack, case
* in current variable). Additional operations (e.g. listeners
* notification about item entering) can be done too.
- *
+ *
* @param item new test item
*/
protected abstract void addNewTestItem(E item);
-
/**
* Returns the casted test item if it matches by name and type or
* <code>null</code> if it doesn't.
- *
+ *
* @param item test item to check
* @param name test item name
* @return casted test item or null
*/
@SuppressWarnings("unchecked")
private E checkTestItem(TestItem item, String name) {
- return (isRequiredTestItemType(item) && item.getName().equals(name)) ? (E)item : null;
+ return (isRequiredTestItemType(item) && item.getName().equals(name)) ? (E) item : null;
}
-
+
/**
* Returns the last insert index for the specified test suite. Returns 0
* if test suite was not inserted yet.
- *
+ *
* @param testSuite test suite to look up
* @return insert index or 0
*/
@@ -191,11 +191,11 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
Integer intLastInsertIndex = testSuitesIndex.get(testSuite);
return intLastInsertIndex != null ? intLastInsertIndex : 0;
}
-
+
/**
* Notifies the listeners about children update of the specified test
* suite.
- *
+ *
* @param suite updated test suite
*/
private void notifyAboutChildrenUpdate(ITestSuite suite) {
@@ -203,10 +203,10 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
listener.childrenUpdate(suite);
}
}
-
+
/**
* Inserts the test item by the name.
- *
+ *
* @param name test item name
*/
public void insert(String name) {
@@ -218,11 +218,12 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
// Optimization: Check whether we already pointing to the test suite with required name
try {
newTestItem = checkTestItem(children.get(lastInsertIndex), name);
- } catch (IndexOutOfBoundsException e) {}
+ } catch (IndexOutOfBoundsException e) {
+ }
if (newTestItem != null) {
- testSuitesIndex.put(currTestSuite, lastInsertIndex+1);
+ testSuitesIndex.put(currTestSuite, lastInsertIndex + 1);
}
-
+
// Check whether the suite with required name was later in the hierarchy
if (newTestItem == null) {
for (int childIndex = lastInsertIndex; childIndex < children.size(); childIndex++) {
@@ -233,7 +234,7 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
}
}
-
+
// Search in previous
if (newTestItem == null) {
for (int childIndex = 0; childIndex < lastInsertIndex; childIndex++) {
@@ -247,12 +248,12 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
}
}
-
+
// Add new
if (newTestItem == null) {
newTestItem = createTestItem(name, currTestSuite);
children.add(lastInsertIndex, newTestItem);
- testSuitesIndex.put(currTestSuite, lastInsertIndex+1);
+ testSuitesIndex.put(currTestSuite, lastInsertIndex + 1);
notifyAboutChildrenUpdate(currTestSuite);
}
if (!testSuitesIndex.containsKey(newTestItem)) {
@@ -260,25 +261,24 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
addNewTestItem(newTestItem);
}
-
+
}
-
/**
* Utility class: insertion algorithm specialization for test suites.
*/
private class TestSuiteInserter extends TestItemInserter<TestSuite> {
-
+
@Override
protected boolean isRequiredTestItemType(TestItem item) {
return (item instanceof TestSuite);
}
-
+
@Override
protected TestSuite createTestItem(String name, TestSuite parent) {
return new TestSuite(name, parent);
}
-
+
@Override
protected void addNewTestItem(TestSuite testSuite) {
testSuitesStack.push(testSuite);
@@ -290,27 +290,26 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
}
-
/**
* Utility class: insertion algorithm specialization for test cases.
*/
private class TestCaseInserter extends TestItemInserter<TestCase> {
-
+
@Override
protected boolean isRequiredTestItemType(TestItem item) {
return (item instanceof TestCase);
}
-
+
@Override
protected TestCase createTestItem(String name, TestSuite parent) {
return new TestCase(name, parent);
}
-
+
@Override
protected void addNewTestItem(TestCase testCase) {
currentTestCase = testCase;
testCase.setStatus(ITestItem.Status.Skipped);
-
+
// Notify listeners
for (ITestingSessionListener listener : getListenersCopy()) {
listener.enterTestCase(testCase);
@@ -318,7 +317,6 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
}
-
public TestModelManager(ITestSuite previousTestsHierarchy, boolean timeMeasurement) {
testSuitesStack.push(new TestSuite(ROOT_TEST_SUITE_NAME, null));
if (previousTestsHierarchy != null) {
@@ -347,38 +345,47 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
public void testingFinished() {
// Remove all NotRun-tests and not used test suites (probably they were removed from test module)
getRootSuite().visit(new IModelVisitor() {
-
+
@Override
public void visit(ITestSuite testSuite) {
- List<TestItem> suiteChildren = ((TestSuite)testSuite).getChildrenList();
+ List<TestItem> suiteChildren = ((TestSuite) testSuite).getChildrenList();
for (Iterator<TestItem> it = suiteChildren.iterator(); it.hasNext();) {
TestItem item = it.next();
- if ((item instanceof ITestSuite && !testSuitesIndex.containsKey(item)) ||
- (item instanceof ITestCase && item.getStatus() == ITestItem.Status.NotRun)) {
+ if ((item instanceof ITestSuite && !testSuitesIndex.containsKey(item))
+ || (item instanceof ITestCase && item.getStatus() == ITestItem.Status.NotRun)) {
it.remove();
}
}
}
@Override
- public void visit(ITestMessage testMessage) {}
+ public void visit(ITestMessage testMessage) {
+ }
+
@Override
- public void visit(ITestCase testCase) {}
+ public void visit(ITestCase testCase) {
+ }
+
@Override
- public void leave(ITestSuite testSuite) {}
+ public void leave(ITestSuite testSuite) {
+ }
+
@Override
- public void leave(ITestCase testCase) {}
+ public void leave(ITestCase testCase) {
+ }
+
@Override
- public void leave(ITestMessage testMessage) {}
+ public void leave(ITestMessage testMessage) {
+ }
});
testSuitesIndex.clear();
-
+
// Notify listeners
for (ITestingSessionListener listener : getListenersCopy()) {
listener.testingFinished();
}
}
-
+
@Override
public void enterTestSuite(String name) {
testSuiteInserter.insert(name);
@@ -402,7 +409,6 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
}
}
-
@Override
public void setTestStatus(Status status) {
currentTestCase.setStatus(status);
@@ -418,8 +424,8 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
if (currentTestCase != null) {
// Set test execution time (if time measurement is turned on)
if (timeMeasurement) {
- int testingTime = (int)(System.currentTimeMillis()-testCaseStartTime);
- currentTestCase.setTestingTime(currentTestCase.getTestingTime()+testingTime);
+ int testingTime = (int) (System.currentTimeMillis() - testCaseStartTime);
+ currentTestCase.setTestingTime(currentTestCase.getTestingTime() + testingTime);
testCaseStartTime = 0;
}
TestCase testCase = currentTestCase;
@@ -436,13 +442,12 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
TestLocation location = (file == null || file.isEmpty() || line <= 0) ? null : new TestLocation(file, line);
currentTestCase.addTestMessage(new TestMessage(location, level, text));
}
-
+
@Override
public ITestSuite currentTestSuite() {
return testSuitesStack.peek();
}
-
@Override
public ITestCase currentTestCase() {
return currentTestCase;
@@ -452,7 +457,7 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
public boolean isCurrentlyRunning(ITestItem item) {
return (item == currentTestCase && item != null) || testSuitesStack.contains(item);
}
-
+
@Override
public TestSuite getRootSuite() {
return testSuitesStack.firstElement();
@@ -471,16 +476,16 @@ public class TestModelManager implements ITestModelUpdater, ITestModelAccessor {
listeners.remove(listener);
}
}
-
+
/**
* Copies listeners before notifying them to avoid dead-locks.
- *
+ *
* @return listeners collection copy
*/
private ITestingSessionListener[] getListenersCopy() {
synchronized (listeners) {
return listeners.toArray(new ITestingSessionListener[listeners.size()]);
- }
+ }
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java
index bdf41a1f09f..c8a2911ee57 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -26,12 +26,11 @@ public class TestSuite extends TestItem implements ITestSuite {
/**
* Stores child test suites and test cases.
- *
+ *
* @note Children order is important.
*/
private List<TestItem> children = new ArrayList<TestItem>();
-
-
+
public TestSuite(String name, TestSuite parent) {
super(name, parent);
}
@@ -56,7 +55,7 @@ public class TestSuite extends TestItem implements ITestSuite {
}
return result;
}
-
+
@Override
public boolean hasChildren() {
return !children.isEmpty();
@@ -78,11 +77,11 @@ public class TestSuite extends TestItem implements ITestSuite {
/**
* Returns list of children for the test suite.
- *
+ *
* @return children list
*/
public List<TestItem> getChildrenList() {
return children;
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java
index 8e1575eebe1..ec2f37be2e1 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSession.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -43,99 +43,108 @@ public class TestingSession implements ITestingSession {
/** Launch object the is connected to the tests running. */
private ILaunch launch;
-
+
/** Information about used Tests Runner provider plug-in. */
private TestsRunnerProviderInfo testsRunnerProviderInfo;
/** Main interface to Tests Runner provider plug-in. */
private ITestsRunnerProvider testsRunnerProvider;
-
+
/**
* Test Model manager that is used to fill and update the model for the
* session.
*/
private TestModelManager modelManager;
-
+
/**
* Total tests counter. It is -1 by default, that means that total tests
* count is not available.
- *
+ *
* @see getTotalCounter()
*/
private int totalCounter = -1;
/** Already finished tests counter. */
private int currentCounter = 0;
-
+
/**
* Test counters map by test status. They are used to quickly provide simple
* statistics without model scanning.
- *
+ *
*/
- private Map<ITestItem.Status, Integer> statusCounters = new EnumMap<ITestItem.Status, Integer>(ITestItem.Status.class);
+ private Map<ITestItem.Status, Integer> statusCounters = new EnumMap<ITestItem.Status, Integer>(
+ ITestItem.Status.class);
/**
* The flag stores whether the testing session contains errors at the
* moment.
- *
+ *
* @see hasErrors()
*/
private boolean hasErrors = false;
-
+
/**
* The flag stores whether the testing session was stopped by user.
- *
+ *
* @see wasStopped()
*/
private boolean wasStopped = false;
-
+
/**
* The flag stores whether the testing session has been finished (with or
* without errors).
*/
private boolean finished = false;
-
+
/** Stores current status of the testing session. */
private String statusMessage = ModelMessages.TestingSession_starting_status;
-
+
/** Stores the time when the testing session was created. */
private long startTime;
-
-
+
/**
* Counts the number of the test cases in tests hierarchy.
*/
private class TestCasesCounter implements IModelVisitor {
-
+
public int result = 0;
-
+
@Override
public void visit(ITestCase testCase) {
++result;
}
-
+
@Override
- public void visit(ITestSuite testSuite) {}
+ public void visit(ITestSuite testSuite) {
+ }
+
@Override
- public void visit(ITestMessage testMessage) {}
+ public void visit(ITestMessage testMessage) {
+ }
+
@Override
- public void leave(ITestSuite testSuite) {}
+ public void leave(ITestSuite testSuite) {
+ }
+
@Override
- public void leave(ITestCase testCase) {}
+ public void leave(ITestCase testCase) {
+ }
+
@Override
- public void leave(ITestMessage testMessage) {}
+ public void leave(ITestMessage testMessage) {
+ }
}
-
/**
* The constructor.
- *
+ *
* @param launch connected launch object
* @param testsRunnerProviderInfo the information about the tests runner
* @param previousSession is used to determine total tests count & for tests
* hierarchy reusing if it is considered as similar
*/
- public TestingSession(ILaunch launch, TestsRunnerProviderInfo testsRunnerProviderInfo, TestingSession previousSession) {
+ public TestingSession(ILaunch launch, TestsRunnerProviderInfo testsRunnerProviderInfo,
+ TestingSession previousSession) {
this.launch = launch;
this.testsRunnerProviderInfo = testsRunnerProviderInfo;
this.testsRunnerProvider = testsRunnerProviderInfo.instantiateTestsRunnerProvider();
@@ -147,46 +156,52 @@ public class TestingSession implements ITestingSession {
totalCounter = testCasesCounter.result;
}
ITestSuite rootTestSuite = previousSession != null ? previousSession.getModelAccessor().getRootSuite() : null;
- this.modelManager = new TestModelManager(rootTestSuite, testsRunnerProviderInfo.isAllowedTestingTimeMeasurement());
+ this.modelManager = new TestModelManager(rootTestSuite,
+ testsRunnerProviderInfo.isAllowedTestingTimeMeasurement());
this.modelManager.addChangesListener(new ITestingSessionListener() {
-
+
@Override
- public void testingStarted() {}
-
+ public void testingStarted() {
+ }
+
@Override
public void testingFinished() {
// This is necessary if totalCounter was -1 (tests count was unknown)
// or if tests count was estimated not accurately
totalCounter = currentCounter;
}
-
+
@Override
- public void exitTestSuite(ITestSuite testSuite) {}
-
+ public void exitTestSuite(ITestSuite testSuite) {
+ }
+
@Override
public void exitTestCase(ITestCase testCase) {
// Update testing session info (counters, flags)
Status testStatus = testCase.getStatus();
- statusCounters.put(testStatus, getCount(testStatus)+1);
+ statusCounters.put(testStatus, getCount(testStatus) + 1);
++currentCounter;
if (testStatus.isError())
hasErrors = true;
}
-
+
@Override
- public void enterTestSuite(ITestSuite testSuite) {}
-
+ public void enterTestSuite(ITestSuite testSuite) {
+ }
+
@Override
- public void enterTestCase(ITestCase testCase) {}
-
+ public void enterTestCase(ITestCase testCase) {
+ }
+
@Override
- public void childrenUpdate(ITestSuite parent) {}
+ public void childrenUpdate(ITestSuite parent) {
+ }
});
}
/**
* Starts the processing of the test module output.
- *
+ *
* @param inputStream test module output stream
*/
public void run(InputStream inputStream) {
@@ -196,7 +211,8 @@ public class TestingSession implements ITestingSession {
// If testing session was stopped, the status is set in stop()
if (!wasStopped()) {
double testingTime = getModelAccessor().getRootSuite().getTestingTime();
- statusMessage = MessageFormat.format(ModelMessages.TestingSession_finished_status, testingTime/1000.0);
+ statusMessage = MessageFormat.format(ModelMessages.TestingSession_finished_status,
+ testingTime / 1000.0);
}
} catch (TestingException e) {
// If testing session was stopped, the status is set in stop()
@@ -218,7 +234,7 @@ public class TestingSession implements ITestingSession {
public int getTotalCounter() {
return totalCounter;
}
-
+
@Override
public int getCount(ITestItem.Status status) {
Integer counterValue = statusCounters.get(status);
@@ -244,17 +260,17 @@ public class TestingSession implements ITestingSession {
public ITestModelAccessor getModelAccessor() {
return modelManager;
}
-
+
@Override
public ILaunch getLaunch() {
return launch;
}
-
+
@Override
public TestsRunnerProviderInfo getTestsRunnerProviderInfo() {
return testsRunnerProviderInfo;
}
-
+
@Override
public String getStatusMessage() {
return statusMessage;
@@ -279,5 +295,5 @@ public class TestingSession implements ITestingSession {
}
}
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java
index 7d162150036..1bbe0bc6806 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/model/TestingSessionsManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -31,7 +31,7 @@ import org.eclipse.debug.core.ILaunchConfigurationListener;
* Manages all the testing sessions (creates, activates, stores history).
*/
public class TestingSessionsManager implements ILaunchConfigurationListener {
-
+
/** Tests Runners Plug-ins Manager. */
private TestsRunnerProvidersManager testsRunnersManager;
@@ -40,10 +40,10 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
/** Currently active testing session. */
private TestingSession activeSession;
-
+
/** Listeners collection. */
private List<ITestingSessionsManagerListener> listeners = new ArrayList<ITestingSessionsManagerListener>();
-
+
/** The size limit of the testing sessions history. */
private int historySizeLimit = 10;
@@ -51,11 +51,11 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
this.testsRunnersManager = testsRunnersManager;
DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
}
-
+
/**
* Tries to find the last testing session for the specified launch
* configuration and Tests Runner provide plug-in.
- *
+ *
* <p>
* Usually testing frameworks do not provide the information about tests
* hierarchy and total tests count before the testing is finished. So we try
@@ -68,12 +68,13 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
* </ul>
* This function tries to find a such session.
* </p>
- *
+ *
* @param launchConfiguration required launch configuration
* @param testsRunnerProviderInfo required Tests Runner provide plug-in
* @return testing session or null if not found
*/
- private TestingSession findActualPreviousSession(ILaunchConfiguration launchConfiguration, TestsRunnerProviderInfo testsRunnerProviderInfo) {
+ private TestingSession findActualPreviousSession(ILaunchConfiguration launchConfiguration,
+ TestsRunnerProviderInfo testsRunnerProviderInfo) {
String testsRunnerName = testsRunnerProviderInfo.getName();
for (TestingSession session : sessions) {
// Find the latest testing session that matches the next requirements:
@@ -82,10 +83,9 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
// - should not be stopped by user (the same as terminated)
// - should have the same tests runner
if (session != null) {
- if (launchConfiguration.equals(session.getLaunch().getLaunchConfiguration())
- && session.isFinished()
- && !session.wasStopped()
- && session.getTestsRunnerProviderInfo().getName().equals(testsRunnerName)) {
+ if (launchConfiguration.equals(session.getLaunch().getLaunchConfiguration()) && session.isFinished()
+ && !session.wasStopped()
+ && session.getTestsRunnerProviderInfo().getName().equals(testsRunnerName)) {
return session;
}
}
@@ -95,33 +95,35 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
/**
* Creates a new testing session for the specified launch.
- *
+ *
* @param launch launch
* @return new testing session
*/
public TestingSession newSession(ILaunch launch) throws CoreException {
- TestsRunnerProviderInfo testsRunnerProviderInfo = testsRunnersManager.getTestsRunnerProviderInfo(launch.getLaunchConfiguration());
- TestingSession previousSession = findActualPreviousSession(launch.getLaunchConfiguration(), testsRunnerProviderInfo);
+ TestsRunnerProviderInfo testsRunnerProviderInfo = testsRunnersManager
+ .getTestsRunnerProviderInfo(launch.getLaunchConfiguration());
+ TestingSession previousSession = findActualPreviousSession(launch.getLaunchConfiguration(),
+ testsRunnerProviderInfo);
TestingSession newTestingSession = new TestingSession(launch, testsRunnerProviderInfo, previousSession);
sessions.addFirst(newTestingSession);
setActiveSession(newTestingSession);
truncateHistory();
return newTestingSession;
}
-
+
/**
* Returns the testing sessions history (the first is the newest).
- *
+ *
* @return testing sessions list
*/
public List<? extends ITestingSession> getSessions() {
return sessions;
}
-
+
/**
* Rewrites the testing sessions history with the specified list. Truncates
* the history if necessary.
- *
+ *
* @return testing sessions list
*/
public void setSessions(List<ITestingSession> newSessions) {
@@ -131,28 +133,28 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
}
truncateHistory();
}
-
+
/**
* Returns the testing sessions history size.
- *
+ *
* @return history size
*/
public int getSessionsCount() {
return sessions.size();
}
-
+
/**
* Accesses the currently active testing session.
- *
+ *
* @return testing session
*/
public ITestingSession getActiveSession() {
return activeSession;
}
-
+
/**
* Sets the new active testing session.
- *
+ *
* @param newActiveSession testing session
*/
public void setActiveSession(ITestingSession newActiveSession) {
@@ -164,7 +166,7 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
}
}
}
-
+
/**
* Adds the given listener to this registered listeners collection.
* Has no effect if an identical listener is already registered.
@@ -187,7 +189,7 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
/**
* Returns the size limit of the testing sessions history.
- *
+ *
* @return history size limit
*/
public int getHistorySizeLimit() {
@@ -196,14 +198,14 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
/**
* Sets the size limit of the testing sessions history.
- *
+ *
* @param historySizeLimit new history size limit
*/
public void setHistorySizeLimit(int historySizeLimit) {
this.historySizeLimit = historySizeLimit;
truncateHistory();
}
-
+
/**
* Truncates the history list if it is longer than size limit.
*/
@@ -218,7 +220,7 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
setActiveSession(newActiveSession);
}
}
-
+
/** @since 8.1 */
@Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
@@ -236,8 +238,7 @@ public class TestingSessionsManager implements ILaunchConfigurationListener {
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
for (Iterator<TestingSession> iterator = sessions.iterator(); iterator.hasNext();) {
TestingSession session = iterator.next();
- if (session.getLaunch().getLaunchConfiguration()
- .equals(configuration)) {
+ if (session.getLaunch().getLaunchConfiguration().equals(configuration)) {
iterator.remove();
}
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/CTestingTab.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/CTestingTab.java
index 2d9fa8721bb..cf8f77d0d9b 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/CTestingTab.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/CTestingTab.java
@@ -32,20 +32,19 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
-
/**
* A launch configuration tab that displays and edits different testing options
* (e.g. Tests Runner provider plug-in).
* <p>
* This class may be instantiated. This class is not intended to be subclassed.
* </p>
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
*/
public class CTestingTab extends CLaunchConfigurationTab {
-
+
/**
- * Tab identifier used for ordering of tabs added using the
+ * Tab identifier used for ordering of tabs added using the
* <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
* extension point.
*/
@@ -55,7 +54,7 @@ public class CTestingTab extends CLaunchConfigurationTab {
/** Shows the list of available Tests Runner provider plug-ins. */
private Combo testsRunnerProviderCombo;
-
+
/** Shows the description for the currently selected Tests Runner provider plug-in. */
private Label testsRunnerProviderDescriptionLabel;
@@ -71,40 +70,42 @@ public class CTestingTab extends CLaunchConfigurationTab {
testsRunnerProviderCombo = new Combo(pageComposite, SWT.READ_ONLY | SWT.DROP_DOWN);
testsRunnerProviderCombo.add(UILauncherMessages.CTestingTab_tests_runner_is_not_set);
testsRunnerProviderCombo.setData("0", null); //$NON-NLS-1$
-
+
// Add all the tests runners
- for (TestsRunnerProviderInfo testsRunnerProviderInfo : TestsRunnerPlugin.getDefault().getTestsRunnerProvidersManager().getTestsRunnersProviderInfo()) {
- testsRunnerProviderCombo.setData(Integer.toString(testsRunnerProviderCombo.getItemCount()), testsRunnerProviderInfo);
- testsRunnerProviderCombo.add(testsRunnerProviderInfo.getName());
- }
-
+ for (TestsRunnerProviderInfo testsRunnerProviderInfo : TestsRunnerPlugin.getDefault()
+ .getTestsRunnerProvidersManager().getTestsRunnersProviderInfo()) {
+ testsRunnerProviderCombo.setData(Integer.toString(testsRunnerProviderCombo.getItemCount()),
+ testsRunnerProviderInfo);
+ testsRunnerProviderCombo.add(testsRunnerProviderInfo.getName());
+ }
+
testsRunnerProviderCombo.addModifyListener(new ModifyListener() {
-
+
@Override
public void modifyText(ModifyEvent e) {
testsRunnerProviderDescriptionLabel.setText(getCurrentTestsRunnerDescription());
updateLaunchConfigurationDialog();
}
});
-
- // Create a tests runner description label
+
+ // Create a tests runner description label
testsRunnerProviderDescriptionLabel = new Label(pageComposite, SWT.WRAP);
GridData testsRunnerProviderLabelGD = new GridData(GridData.FILL_BOTH);
testsRunnerProviderLabelGD.horizontalSpan = 2;
testsRunnerProviderLabelGD.horizontalAlignment = GridData.FILL;
testsRunnerProviderDescriptionLabel.setLayoutData(testsRunnerProviderLabelGD);
-
+
GridData pageCompositeGD = new GridData(GridData.FILL_BOTH);
pageCompositeGD.horizontalAlignment = GridData.FILL;
pageCompositeGD.grabExcessHorizontalSpace = true;
pageComposite.setLayoutData(pageCompositeGD);
setControl(pageComposite);
}
-
+
/**
* Returns the information for the currently selected Tests Runner provider
* plug-in.
- *
+ *
* @return Tests Runner provide plug-in information
*/
private ITestsRunnerProviderInfo getCurrentTestsRunnerProviderInfo() {
@@ -114,18 +115,18 @@ public class CTestingTab extends CLaunchConfigurationTab {
/**
* Returns the information for the Tests Runner provide plug-in specified by
* index.
- *
+ *
* @param comboIndex index in combo widget
* @return Tests Runner provide plug-in information
*/
private ITestsRunnerProviderInfo getTestsRunnerProviderInfo(int comboIndex) {
- return (ITestsRunnerProviderInfo)testsRunnerProviderCombo.getData(Integer.toString(comboIndex));
+ return (ITestsRunnerProviderInfo) testsRunnerProviderCombo.getData(Integer.toString(comboIndex));
}
/**
* Returns the description for the currently selected Tests Runner provide
* plug-in.
- *
+ *
* @return the description
*/
private String getCurrentTestsRunnerDescription() {
@@ -151,7 +152,8 @@ public class CTestingTab extends CLaunchConfigurationTab {
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- String testsRunnerId = configuration.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_RUNNER, (String) null);
+ String testsRunnerId = configuration.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_RUNNER,
+ (String) null);
int comboIndex = 0;
for (int i = 1; i < testsRunnerProviderCombo.getItemCount(); i++) {
if (getTestsRunnerProviderInfo(i).getId().equals(testsRunnerId)) {
@@ -160,7 +162,7 @@ public class CTestingTab extends CLaunchConfigurationTab {
}
}
testsRunnerProviderCombo.select(comboIndex);
-
+
} catch (CoreException e) {
TestsRunnerPlugin.log(e);
}
@@ -181,7 +183,7 @@ public class CTestingTab extends CLaunchConfigurationTab {
@Override
public String getName() {
- return UILauncherMessages.CTestingTab_tab_name;
+ return UILauncherMessages.CTestingTab_tab_name;
}
@Override
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/EmptyConfigurationTabGroup.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/EmptyConfigurationTabGroup.java
index f2166240896..9cae64e04f9 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/EmptyConfigurationTabGroup.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/launcher/EmptyConfigurationTabGroup.java
@@ -17,7 +17,6 @@ import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
-
/**
* Represents an empty tab group. Actual tabs are added via the
* <code>org.eclipse.debug.ui.launchConfigurationTabs</code> extension point.
@@ -26,7 +25,7 @@ public class EmptyConfigurationTabGroup extends AbstractLaunchConfigurationTabGr
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- setTabs(new ILaunchConfigurationTab[0]);
+ setTabs(new ILaunchConfigurationTab[0]);
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/CounterPanel.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/CounterPanel.java
index 287edb911df..f4e69b5a685 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/CounterPanel.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/CounterPanel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestingSession;
@@ -25,7 +24,6 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import java.text.MessageFormat;
-
/**
* Shows a simple tests count statics information (run/error/failed).
*/
@@ -33,7 +31,7 @@ public class CounterPanel extends Composite {
/** Testing session to show statistics for. */
private ITestingSession testingSession;
-
+
/** Widget showing the failed tests count. */
private Label failedCounterLabel;
@@ -52,7 +50,6 @@ public class CounterPanel extends Composite {
private final Image errorIcon = TestsRunnerPlugin.createAutoImage("ovr16/failed_counter.gif"); //$NON-NLS-1$
private final Image failureIcon = TestsRunnerPlugin.createAutoImage("ovr16/aborted_counter.gif"); //$NON-NLS-1$
-
public CounterPanel(Composite parent, ITestingSession testingSession) {
super(parent, SWT.WRAP);
GridLayout gridLayout = new GridLayout();
@@ -69,7 +66,7 @@ public class CounterPanel extends Composite {
/**
* Creates counter label widget.
- *
+ *
* @param name widget text prefix
* @param image widget image or <code>null</code>
* @return created label
@@ -93,7 +90,7 @@ public class CounterPanel extends Composite {
/**
* Sets the testing session to show information about.
- *
+ *
* @param testingSession testing session (null is not acceptable)
*/
public void setTestingSession(ITestingSession testingSession) {
@@ -101,7 +98,7 @@ public class CounterPanel extends Composite {
this.hasSkipped = testingSession.getCount(ITestItem.Status.Skipped) != 0;
updateInfoFromSession();
}
-
+
/**
* Updates the information on the panel from the currently set testing
* session.
@@ -112,10 +109,10 @@ public class CounterPanel extends Composite {
setCurrentCounter(testingSession.getCurrentCounter(), testingSession.getCount(ITestItem.Status.Skipped));
redraw();
}
-
+
/**
* Sets a new value for the failed tests counter.
- *
+ *
* @param newValue new counter value
*/
private void setFailedCounter(int newValue) {
@@ -124,7 +121,7 @@ public class CounterPanel extends Composite {
/**
* Sets a new value for the error tests counter.
- *
+ *
* @param newValue new counter value
*/
private void setAbortedCounter(int newValue) {
@@ -133,7 +130,7 @@ public class CounterPanel extends Composite {
/**
* Sets a new value for the run tests counter.
- *
+ *
* @param currentValue new counter value
* @param skippedValue skipped tests counter
*/
@@ -141,10 +138,9 @@ public class CounterPanel extends Composite {
if (!hasSkipped && skippedValue != 0) {
layout();
}
- String runString = (skippedValue == 0)
- ? Integer.toString(currentValue)
+ String runString = (skippedValue == 0) ? Integer.toString(currentValue)
: MessageFormat.format(UIViewMessages.CounterPanel_tests_skipped, currentValue, skippedValue);
currentCounterLabel.setText(runString);
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/DummyUISession.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/DummyUISession.java
index c899f3d9e7e..6c0140c4765 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/DummyUISession.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/DummyUISession.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -35,7 +35,7 @@ public class DummyUISession implements ITestingSession {
public int getTotalCounter() {
return 0;
}
-
+
@Override
public int getCount(ITestItem.Status status) {
return 0;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java
index e3d80dd03e1..791591da6a4 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/MessagesViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -60,7 +60,6 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
-
/**
* Shows the messages for the currently selected items in tests hierarchy (test
* suites or test cases).
@@ -72,40 +71,40 @@ public class MessagesViewer {
*/
public enum LevelFilter {
Info(ISharedImages.IMG_OBJS_INFO_TSK, ITestMessage.Level.Info, ITestMessage.Level.Message),
- Warning(ISharedImages.IMG_OBJS_WARN_TSK, ITestMessage.Level.Warning),
- Error(ISharedImages.IMG_OBJS_ERROR_TSK, ITestMessage.Level.Error, ITestMessage.Level.FatalError, ITestMessage.Level.Exception);
+ Warning(ISharedImages.IMG_OBJS_WARN_TSK, ITestMessage.Level.Warning), Error(ISharedImages.IMG_OBJS_ERROR_TSK,
+ ITestMessage.Level.Error, ITestMessage.Level.FatalError, ITestMessage.Level.Exception);
private String imageId;
- private ITestMessage.Level [] includedLevels;
-
+ private ITestMessage.Level[] includedLevels;
+
LevelFilter(String imageId, ITestMessage.Level... includedLevels) {
this.imageId = imageId;
this.includedLevels = includedLevels;
}
-
+
/**
* The shared image ID corresponding to the message level filter action.
- *
+ *
* @return shared image ID
*/
public String getImageId() {
return imageId;
}
-
+
/**
* The message levels that should be shown if current message level
* filter action is set.
- *
+ *
* @return array of message levels
*/
- public ITestMessage.Level [] getLevels() {
+ public ITestMessage.Level[] getLevels() {
return includedLevels;
}
-
+
/**
* Checks whether the specified message level should be shown if current
* message level filter action is set.
- *
+ *
* @param messageLevel message level to search
* @return <code>true</code> if found
*/
@@ -123,54 +122,58 @@ public class MessagesViewer {
* The content provider for the test messages viewer.
*/
private class MessagesContentProvider implements IStructuredContentProvider {
-
+
/**
* Utility class: recursively collects all the messages of the specified
* test item.
*/
class MessagesCollector implements IModelVisitor {
-
+
/** Collected test messages. */
Collection<ITestMessage> collectedTestMessages;
-
+
/**
* Specifies whether gathering should be done. It is used to skip
* the messages of the passed tests if they should not be shown.
*/
boolean collect = true;
-
+
MessagesCollector(Collection<ITestMessage> testMessages) {
this.collectedTestMessages = testMessages;
}
-
+
@Override
public void visit(ITestMessage testMessage) {
if (collect) {
collectedTestMessages.add(testMessage);
}
}
-
+
@Override
public void visit(ITestCase testCase) {
collect = !showFailedOnly || testCase.getStatus().isError();
}
-
+
@Override
- public void visit(ITestSuite testSuite) {}
+ public void visit(ITestSuite testSuite) {
+ }
@Override
- public void leave(ITestSuite testSuite) {}
+ public void leave(ITestSuite testSuite) {
+ }
@Override
- public void leave(ITestCase testCase) {}
+ public void leave(ITestCase testCase) {
+ }
@Override
- public void leave(ITestMessage testMessage) {}
+ public void leave(ITestMessage testMessage) {
+ }
}
/** Test messages to show in the viewer. */
ITestMessage[] testMessages;
-
+
@Override
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
if (newInput != null) {
@@ -179,20 +182,20 @@ public class MessagesViewer {
testMessages = new ITestMessage[0];
}
}
-
+
@Override
public void dispose() {
}
-
+
@Override
public Object[] getElements(Object parent) {
return testMessages;
}
-
+
/**
* Creates a messages set with a custom comparator. It is used for the
* ordered messages showing.
- *
+ *
* @return set to store the test messages
*/
private TreeSet<ITestMessage> createMessagesSet() {
@@ -203,7 +206,7 @@ public class MessagesViewer {
// Compare messages by location
ITestLocation location1 = message1.getLocation();
ITestLocation location2 = message2.getLocation();
-
+
if (location1 != null && location2 != null) {
// Compare by file name
String file1 = location1.getFile();
@@ -217,19 +220,19 @@ public class MessagesViewer {
int line2 = location2.getLine();
if (line1 < line2) {
return -1;
-
+
} else if (line1 > line2) {
return 1;
}
}
-
+
} else if (location1 == null && location2 != null) {
return -1;
-
+
} else if (location1 != null && location2 == null) {
return 1;
}
-
+
// Compare by message text
String text1 = message1.getText();
String text2 = message2.getText();
@@ -237,11 +240,11 @@ public class MessagesViewer {
}
});
}
-
+
/**
* Creates a list to store the test messages. It is used for the
* unordered messages showing.
- *
+ *
* @return list to store the test messages
*/
private ArrayList<ITestMessage> createMessagesList() {
@@ -251,16 +254,16 @@ public class MessagesViewer {
/**
* Creates a collection to store the test messages depending on whether
* ordering is required.
- *
+ *
* @return collection to store the test messages
*/
private Collection<ITestMessage> createMessagesCollection() {
return orderingMode ? createMessagesSet() : createMessagesList();
}
-
+
/**
* Run messages collecting for the specified test items.
- *
+ *
* @param testItems test items array
*/
private void collectMessages(ITestItem[] testItems) {
@@ -276,11 +279,11 @@ public class MessagesViewer {
* The label provider for the test messages viewer.
*/
private class MessagesLabelProvider extends LabelProvider implements ITableLabelProvider {
-
+
/**
* Returns the full (file path) or short (file name only) file path view
* depending on the filter set.
- *
+ *
* @param location test object location
* @return file path
*/
@@ -292,31 +295,28 @@ public class MessagesViewer {
return filePath;
}
}
-
+
@Override
public String getColumnText(Object obj, int index) {
- ITestMessage message = (ITestMessage)obj;
+ ITestMessage message = (ITestMessage) obj;
ITestLocation location = message.getLocation();
String locationString = ""; //$NON-NLS-1$
if (location != null) {
- locationString = MessageFormat.format(
- UIViewMessages.MessagesViewer_location_format,
- new Object[] { getLocationFile(location), location.getLine() }
- );
+ locationString = MessageFormat.format(UIViewMessages.MessagesViewer_location_format,
+ new Object[] { getLocationFile(location), location.getLine() });
}
- return MessageFormat.format(UIViewMessages.MessagesViewer_message_format,
- locationString, message.getLevel(), message.getText()
- );
+ return MessageFormat.format(UIViewMessages.MessagesViewer_message_format, locationString,
+ message.getLevel(), message.getText());
}
-
+
@Override
public Image getColumnImage(Object obj, int index) {
return getImage(obj);
}
-
+
@Override
public Image getImage(Object obj) {
- Level level = ((ITestMessage)obj).getLevel();
+ Level level = ((ITestMessage) obj).getLevel();
String imageId = ISharedImages.IMG_OBJ_ELEMENT;
for (LevelFilter levelFilter : LevelFilter.values()) {
if (levelFilter.isIncluded(level)) {
@@ -327,7 +327,7 @@ public class MessagesViewer {
return PlatformUI.getWorkbench().getSharedImages().getImage(imageId);
}
}
-
+
/**
* Filters the required test messages by level.
*/
@@ -335,20 +335,19 @@ public class MessagesViewer {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- return acceptedMessageLevels.contains(((ITestMessage)element).getLevel());
+ return acceptedMessageLevels.contains(((ITestMessage) element).getLevel());
}
}
-
/** Main widget. */
private TableViewer tableViewer;
-
+
private IViewSite viewSite;
-
+
// Context menu actions
private OpenInEditorAction openInEditorAction;
private Action copyAction;
-
+
/** Specifies whether only messages for failed tests should be shown. */
private boolean showFailedOnly = false;
@@ -357,16 +356,14 @@ public class MessagesViewer {
* paths).
*/
private boolean showFileNameOnly = false;
-
+
/** The set of message level to show the messages with. */
private Set<ITestMessage.Level> acceptedMessageLevels = new HashSet<ITestMessage.Level>();
-
+
/** Specifies whether test messages ordering is on or off. */
private boolean orderingMode = false;
-
- public MessagesViewer(Composite parent,
- TestingSessionsManager sessionsManager, IWorkbench workbench,
+ public MessagesViewer(Composite parent, TestingSessionsManager sessionsManager, IWorkbench workbench,
IViewSite viewSite, Clipboard clipboard) {
this.viewSite = viewSite;
tableViewer = new TableViewer(parent, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
@@ -383,15 +380,14 @@ public class MessagesViewer {
}
/**
- * Initializes the viewer context menu.
- *
+ * Initializes the viewer context menu.
+ *
* @param viewSite view
* @param sessionsManager testing sessions manager
* @param workbench workbench
* @param clipboard clipboard
*/
- private void initContextMenu(IViewSite viewSite,
- TestingSessionsManager sessionsManager, IWorkbench workbench,
+ private void initContextMenu(IViewSite viewSite, TestingSessionsManager sessionsManager, IWorkbench workbench,
Clipboard clipboard) {
openInEditorAction = new OpenInEditorAction(tableViewer, sessionsManager, workbench);
copyAction = new CopySelectedMessagesAction(tableViewer, clipboard);
@@ -411,7 +407,7 @@ public class MessagesViewer {
menuMgr.add(copyAction);
configureCopy();
}
-
+
/**
* Configures the view copy action which should be run on CTRL+C. We have to
* track widget focus to select the actual action because we have a few
@@ -420,20 +416,20 @@ public class MessagesViewer {
*/
private void configureCopy() {
getTableViewer().getTable().addFocusListener(new FocusListener() {
- IAction viewCopyHandler;
+ IAction viewCopyHandler;
- @Override
+ @Override
public void focusLost(FocusEvent e) {
- if (viewCopyHandler != null) {
- switchTo(viewCopyHandler);
- }
+ if (viewCopyHandler != null) {
+ switchTo(viewCopyHandler);
+ }
}
@Override
public void focusGained(FocusEvent e) {
switchTo(copyAction);
}
-
+
private void switchTo(IAction copyAction) {
IActionBars actionBars = viewSite.getActionBars();
viewCopyHandler = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
@@ -442,10 +438,10 @@ public class MessagesViewer {
}
});
}
-
+
/**
* Handles the context menu showing.
- *
+ *
* @param manager context menu manager
*/
private void handleMenuAboutToShow(IMenuManager manager) {
@@ -456,22 +452,22 @@ public class MessagesViewer {
/**
* Provides access to the main widget of the messages viewer.
- *
+ *
* @return main widget of the messages viewer
*/
public TableViewer getTableViewer() {
return tableViewer;
}
-
+
/**
* Sets the test items for which the messages should be shown.
- *
+ *
* @param testItems test items array
*/
public void showItemsMessages(ITestItem[] testItems) {
tableViewer.setInput(testItems);
}
-
+
/**
* Forces the messages recollecting. It is used after message filters
* change.
@@ -483,16 +479,16 @@ public class MessagesViewer {
/**
* Returns whether the messages only for the failed tests should be shown.
- *
+ *
* @return filter state
*/
public boolean getShowFailedOnly() {
return showFailedOnly;
}
-
+
/**
* Sets whether the messages only for the failed tests should be shown.
- *
+ *
* @param showFailedOnly new filter state
*/
public void setShowFailedOnly(boolean showFailedOnly) {
@@ -504,16 +500,16 @@ public class MessagesViewer {
/**
* Returns whether short or long view for file paths should be shown.
- *
+ *
* @return filter state
*/
public boolean getShowFileNameOnly() {
return showFileNameOnly;
}
-
+
/**
* Sets whether short or long view for file paths should be shown.
- *
+ *
* @param showFileNameOnly new filter state
*/
public void setShowFileNameOnly(boolean showFileNameOnly) {
@@ -525,16 +521,16 @@ public class MessagesViewer {
/**
* Returns whether test messages should be ordered by location.
- *
+ *
* @return messages ordering state
*/
public boolean getOrderingMode() {
return orderingMode;
}
-
+
/**
* Sets whether test messages should be ordered by location.
- *
+ *
* @param orderingMode new messages ordering state
*/
public void setOrderingMode(boolean orderingMode) {
@@ -546,7 +542,7 @@ public class MessagesViewer {
/**
* Adds the filter message level filters by the message filter action level.
- *
+ *
* @param levelFilter message filter action level
* @param refresh specifies whether viewer should be refreshed after filter
* update (small optimization: avoid many updates on initialization)
@@ -563,7 +559,7 @@ public class MessagesViewer {
/**
* Removed the filter message level filters by the message filter action
* level.
- *
+ *
* @param levelFilter message filter action level
*/
public void removeLevelFilter(LevelFilter levelFilter) {
@@ -572,5 +568,5 @@ public class MessagesViewer {
}
tableViewer.refresh();
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressBar.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressBar.java
index 9adcc376006..5056563ec84 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressBar.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressBar.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Display;
* A progress bar with a red/green indication for testing success or failure.
*/
public class ProgressBar extends Canvas {
-
+
/** Default bar width */
private static final int DEFAULT_WIDTH = 160;
@@ -42,10 +42,10 @@ public class ProgressBar extends Canvas {
/** Testing session to show progress bar for. */
private ITestingSession testingSession;
-
- /** Current bar width. */
+
+ /** Current bar width. */
private int colorBarWidth;
-
+
/** The bar color when everything is OK (no tests failed and no testing errors). */
private Color okColor;
@@ -55,7 +55,6 @@ public class ProgressBar extends Canvas {
/** The bar color when the testing session was stopped by user. */
private Color stoppedColor;
-
public ProgressBar(Composite parent, ITestingSession testingSession) {
super(parent, SWT.NONE);
@@ -87,17 +86,17 @@ public class ProgressBar extends Canvas {
});
setTestingSession(testingSession);
}
-
+
/**
* Sets the testing session to show information about.
- *
+ *
* @param testingSession testing session (null is not acceptable)
*/
public void setTestingSession(ITestingSession testingSession) {
this.testingSession = testingSession;
updateInfoFromSession();
}
-
+
/**
* Updates the progress from the currently set testing session.
*/
@@ -108,7 +107,7 @@ public class ProgressBar extends Canvas {
/**
* Sets the color of the progress bar depending on the testing session.
- *
+ *
* @param gc gc
*/
private void setStatusColor(GC gc) {
@@ -122,7 +121,7 @@ public class ProgressBar extends Canvas {
/**
* Calculate the width of the progress rectangle in a widget.
- *
+ *
* @note If total tests count is known it is used to determine width of the
* progress rectangle. If it isn't the width of progress rectangle is set to
* the half of a widget.
@@ -131,9 +130,10 @@ public class ProgressBar extends Canvas {
Rectangle r = getClientArea();
int newColorBarWidth;
if (testingSession.getTotalCounter() > 0) {
- newColorBarWidth = testingSession.getCurrentCounter()*(r.width-2)/testingSession.getTotalCounter();
+ newColorBarWidth = testingSession.getCurrentCounter() * (r.width - 2) / testingSession.getTotalCounter();
} else {
- newColorBarWidth = testingSession.getCurrentCounter() > 0 ? (r.width-2)/2 : (testingSession.isFinished() ? r.width-2 : 0);
+ newColorBarWidth = testingSession.getCurrentCounter() > 0 ? (r.width - 2) / 2
+ : (testingSession.isFinished() ? r.width - 2 : 0);
}
colorBarWidth = Math.max(0, newColorBarWidth);
}
@@ -143,17 +143,17 @@ public class ProgressBar extends Canvas {
*/
private void drawBevelRect(GC gc, int x, int y, int w, int h, Color topleft, Color bottomright) {
gc.setForeground(topleft);
- gc.drawLine(x, y, x+w-1, y);
- gc.drawLine(x, y, x, y+h-1);
+ gc.drawLine(x, y, x + w - 1, y);
+ gc.drawLine(x, y, x, y + h - 1);
gc.setForeground(bottomright);
- gc.drawLine(x+w, y, x+w, y+h);
- gc.drawLine(x, y+h, x+w, y+h);
+ gc.drawLine(x + w, y, x + w, y + h);
+ gc.drawLine(x, y + h, x + w, y + h);
}
/**
* Handles paint event and redraws the widget if necessary.
- *
+ *
* @param event paint event
*/
private void paint(PaintEvent event) {
@@ -162,13 +162,13 @@ public class ProgressBar extends Canvas {
Rectangle rect = getClientArea();
gc.fillRectangle(rect);
- drawBevelRect(gc, rect.x, rect.y, rect.width-1, rect.height-1,
- disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
- disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
+ drawBevelRect(gc, rect.x, rect.y, rect.width - 1, rect.height - 1,
+ disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW),
+ disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
setStatusColor(gc);
- colorBarWidth = Math.min(rect.width-2, colorBarWidth);
- gc.fillRectangle(1, 1, colorBarWidth, rect.height-2);
+ colorBarWidth = Math.min(rect.width - 2, colorBarWidth);
+ gc.fillRectangle(1, 1, colorBarWidth, rect.height - 2);
}
@Override
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressCountPanel.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressCountPanel.java
index 5fcb1becba3..67d7acb5c2c 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressCountPanel.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ProgressCountPanel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -27,7 +27,7 @@ public class ProgressCountPanel extends Composite {
/** Child widget: counter panel. */
private CounterPanel counterPanel;
-
+
/** Child widget: red/green progress bar */
private ProgressBar progressBar;
@@ -38,7 +38,6 @@ public class ProgressCountPanel extends Composite {
*/
private DummyUISession dummyUISession = new DummyUISession();
-
public ProgressCountPanel(Composite parent, ResultsView.Orientation currOrientation) {
super(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -46,19 +45,17 @@ public class ProgressCountPanel extends Composite {
setPanelOrientation(currOrientation);
counterPanel = new CounterPanel(this, dummyUISession);
- counterPanel.setLayoutData(
- new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ counterPanel.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
progressBar = new ProgressBar(this, dummyUISession);
- progressBar.setLayoutData(
- new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ progressBar.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
// Data for parent (view's) layout
setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
}
-
+
/**
* Sets the testing session to show information about.
- *
+ *
* @param testingSession testing session or null to set default empty
* session
*/
@@ -67,7 +64,7 @@ public class ProgressCountPanel extends Composite {
counterPanel.setTestingSession(newSession);
progressBar.setTestingSession(newSession);
}
-
+
/**
* Updates the information on the panel from the currently set testing
* session.
@@ -79,12 +76,12 @@ public class ProgressCountPanel extends Composite {
/**
* Sets the widget orientation.
- *
+ *
* @param orientation new widget orientation (vertical or horizontal; auto
* is not supported)
*/
public void setPanelOrientation(ResultsView.Orientation orientation) {
- ((GridLayout)getLayout()).numColumns = (orientation == ResultsView.Orientation.Horizontal) ? 2 : 1;
+ ((GridLayout) getLayout()).numColumns = (orientation == ResultsView.Orientation.Horizontal) ? 2 : 1;
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsPanel.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsPanel.java
index b962bb7c24c..a7b1c55f6ad 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsPanel.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsPanel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -49,7 +49,7 @@ public class ResultsPanel {
/** Parent for the child widgets (messages & tests hierarchy viewer). */
private SashForm sashForm;
-
+
/** Child widget: messages viewer. */
private MessagesViewer messagesViewer;
@@ -70,8 +70,8 @@ public class ResultsPanel {
Action warningFilterAction;
Action infoFilterAction;
-
- public ResultsPanel(Composite parent, TestingSessionsManager sessionsManager, IWorkbench workbench, IViewSite site, Clipboard clipboard) {
+ public ResultsPanel(Composite parent, TestingSessionsManager sessionsManager, IWorkbench workbench, IViewSite site,
+ Clipboard clipboard) {
sashForm = new SashForm(parent, SWT.VERTICAL);
// Configure tests hierarchy viewer
@@ -82,8 +82,10 @@ public class ResultsPanel {
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) {
return new Point(1, 1); // (0, 0) does not work with super-intelligent ViewForm
}
+
@Override
- protected void layout(Composite composite, boolean flushCache) {}
+ protected void layout(Composite composite, boolean flushCache) {
+ }
});
top.setTopLeft(empty); // makes ViewForm draw the horizontal separator line ...
testsHierarchyViewer = new TestsHierarchyViewer(top, site, clipboard);
@@ -118,25 +120,25 @@ public class ResultsPanel {
bottom.setTopCenter(rightMessagesToolBar);
bottom.setContent(messagesViewer.getTableViewer().getControl());
- sashForm.setWeights(new int[]{50, 50});
-
+ sashForm.setWeights(new int[] { 50, 50 });
+
testsHierarchyViewer.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
handleTestItemSelected();
}
});
-
+
// Initialize default value
setShowFailedOnly(false);
-
+
// Data for parent (view's) layout
sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
}
-
+
/**
* Provides access to the tests hierarchy viewer.
- *
+ *
* @return tests hierarchy viewer
*/
public TestsHierarchyViewer getTestsHierarchyViewer() {
@@ -145,7 +147,7 @@ public class ResultsPanel {
/**
* Provides access to the messages viewer.
- *
+ *
* @return messages viewer
*/
public MessagesViewer getMessagesViewer() {
@@ -158,11 +160,11 @@ public class ResultsPanel {
* items.
*/
private void handleTestItemSelected() {
- IStructuredSelection selection = (IStructuredSelection)testsHierarchyViewer.getTreeViewer().getSelection();
+ IStructuredSelection selection = (IStructuredSelection) testsHierarchyViewer.getTreeViewer().getSelection();
ITestItem[] testItems = new ITestItem[selection.size()];
int index = 0;
for (Iterator<?> it = selection.iterator(); it.hasNext();) {
- testItems[index] = (ITestItem)it.next();
+ testItems[index] = (ITestItem) it.next();
++index;
}
messagesViewer.showItemsMessages(testItems);
@@ -170,7 +172,7 @@ public class ResultsPanel {
/**
* Sets the widget orientation.
- *
+ *
* @param orientation new widget orientation (vertical or horizontal; auto
* is not supported)
*/
@@ -181,26 +183,26 @@ public class ResultsPanel {
/**
* Returns whether only failed tests (and messages for them) should be
* shown.
- *
+ *
* @return filter state
*/
public boolean getShowFailedOnly() {
return messagesViewer.getShowFailedOnly();
}
-
+
/**
* Sets whether only failed tests (and messages for them) should be shown.
- *
+ *
* @param showFailedOnly new filter state
*/
public void setShowFailedOnly(boolean showFailedOnly) {
testsHierarchyViewer.setShowFailedOnly(showFailedOnly);
messagesViewer.setShowFailedOnly(showFailedOnly);
}
-
+
/**
* Restores the value of the checkable action.
- *
+ *
* @param memento previously saved state to restore the action value from
* @param key tag name that is used to restore the value
* @param action action to restore
@@ -215,14 +217,14 @@ public class ResultsPanel {
/**
* Restores the state of the widget.
- *
+ *
* @param memento previously saved state
*/
public void restoreState(IMemento memento) {
Integer weight0 = memento.getInteger(TAG_WEIGHT0);
Integer weight1 = memento.getInteger(TAG_WEIGHT1);
if (weight0 != null && weight1 != null) {
- sashForm.setWeights(new int[] {weight0, weight1});
+ sashForm.setWeights(new int[] { weight0, weight1 });
}
restoreActionChecked(memento, TAG_MESSAGES_ORDERING_ACTION, messagesOrderingAction);
restoreActionChecked(memento, TAG_ERROR_FILTER_ACTION, errorFilterAction);
@@ -232,7 +234,7 @@ public class ResultsPanel {
/**
* Saves the state of the widget.
- *
+ *
* @param memento where to save the state
*/
public void saveState(IMemento memento) {
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsView.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsView.java
index 20e2534200d..03bb3134084 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsView.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/ResultsView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -54,34 +54,32 @@ public class ResultsView extends ViewPart {
/**
* Represents view orientation
- *
+ *
* @note <code>Auto</code> state may be not acceptable for some methods (see
* their comments for details).
*/
public enum Orientation {
- Horizontal,
- Vertical,
- Auto,
+ Horizontal, Vertical, Auto,
}
-
+
/** View parent. */
private Composite parent;
-
+
/** Child widget: statistics viewer. */
private ProgressCountPanel progressCountPanel;
-
+
/** Tests hierarchy and message viewer. */
private ResultsPanel resultsPanel;
-
+
/** User interface updater instance. */
private UIUpdater uiUpdater;
-
+
/** The reference to the testing sessions manager instance. */
private TestingSessionsManager sessionsManager;
-
+
/** Shows whether the results view was disposed. */
private boolean isDisposed = false;
-
+
// Toolbar & view menu actions
private Action nextAction;
private Action previousAction;
@@ -99,18 +97,18 @@ public class ResultsView extends ViewPart {
* The current orientation preference (Horizontal, Vertical, Auto).
*/
private Orientation orientation = Orientation.Auto;
-
+
/**
* The current view orientation (Horizontal or Vertical).
*/
private Orientation currentOrientation;
-
+
/**
* Previously saved state. It is used to store the same state if the view
* was not opened.
*/
private IMemento memento;
-
+
// Persistence tags
static final String TAG_ORIENTATION = "orientation"; //$NON-NLS-1$
static final String TAG_SHOW_FAILED_ONLY = "showFailedOnly"; //$NON-NLS-1$
@@ -119,8 +117,7 @@ public class ResultsView extends ViewPart {
static final String TAG_SCROLL_LOCK = "scrollLock"; //$NON-NLS-1$
static final String TAG_SHOW_FILE_NAME_ONLY_ACTION = "showFileNameOnly"; //$NON-NLS-1$
static final String TAG_HISTORY_SIZE = "history_size"; //$NON-NLS-1$
-
-
+
@Override
public void createPartControl(Composite parent) {
sessionsManager = TestsRunnerPlugin.getDefault().getTestingSessionsManager();
@@ -138,17 +135,18 @@ public class ResultsView extends ViewPart {
resultsPanel = new ResultsPanel(parent, sessionsManager, workbench, getViewSite(), clipboard);
uiUpdater = new UIUpdater(this, resultsPanel.getTestsHierarchyViewer(), progressCountPanel, sessionsManager);
configureActionsBars();
-
+
parent.addControlListener(new ControlListener() {
@Override
public void controlMoved(ControlEvent e) {
}
+
@Override
public void controlResized(ControlEvent e) {
computeOrientation();
}
});
-
+
restoreState(memento);
uiUpdater.reapplyActiveSession();
}
@@ -166,10 +164,9 @@ public class ResultsView extends ViewPart {
// Create common action
toggleOrientationActions = new ToggleOrientationAction[] {
- new ToggleOrientationAction(this, Orientation.Vertical),
- new ToggleOrientationAction(this, Orientation.Horizontal),
- new ToggleOrientationAction(this, Orientation.Auto),
- };
+ new ToggleOrientationAction(this, Orientation.Vertical),
+ new ToggleOrientationAction(this, Orientation.Horizontal),
+ new ToggleOrientationAction(this, Orientation.Auto), };
nextAction = new ShowNextFailureAction(resultsPanel.getTestsHierarchyViewer());
nextAction.setEnabled(false);
@@ -178,7 +175,7 @@ public class ResultsView extends ViewPart {
previousAction = new ShowPreviousFailureAction(resultsPanel.getTestsHierarchyViewer());
previousAction.setEnabled(false);
actionBars.setGlobalActionHandler(ActionFactory.PREVIOUS.getId(), previousAction);
-
+
showFailedOnly = new ShowFailedOnlyAction(resultsPanel);
showTestsInHierarchyAction = new ShowTestsInHierarchyAction(resultsPanel.getTestsHierarchyViewer());
showTimeAction = new ShowTimeAction(resultsPanel.getTestsHierarchyViewer());
@@ -188,9 +185,9 @@ public class ResultsView extends ViewPart {
rerunAction.setEnabled(false);
stopAction = new StopAction(sessionsManager);
stopAction.setEnabled(false);
-
+
historyAction = new HistoryDropDownAction(sessionsManager, parent.getShell());
-
+
// Configure toolbar
IToolBarManager toolBar = actionBars.getToolBarManager();
toolBar.add(nextAction);
@@ -201,7 +198,7 @@ public class ResultsView extends ViewPart {
toolBar.add(rerunAction);
toolBar.add(stopAction);
toolBar.add(historyAction);
-
+
// Configure view menu
IMenuManager viewMenu = actionBars.getMenuManager();
viewMenu.add(showTestsInHierarchyAction);
@@ -224,17 +221,17 @@ public class ResultsView extends ViewPart {
uiUpdater.dispose();
}
}
-
+
/**
* Changes the view orientation
- *
+ *
* @param orientation new view orientation (Horizontal, Vertical, Auto)
*/
public void setOrientation(Orientation orientation) {
this.orientation = orientation;
computeOrientation();
}
-
+
/**
* Checks whether actual orientation is changed and changes orientation of
* the child widgets.
@@ -251,22 +248,22 @@ public class ResultsView extends ViewPart {
parent.layout();
}
}
-
+
/**
* Recalculates actual view orientation depending on the specified by user
* orientation value and current view size.
- *
+ *
* @param orientation by user specified orientation
* @return actual orientation
*/
private Orientation getActualOrientation() {
switch (orientation) {
- case Horizontal:
- case Vertical:
- return orientation;
- case Auto:
- Point size = parent.getSize();
- return (size.x > size.y) ? Orientation.Horizontal : Orientation.Vertical;
+ case Horizontal:
+ case Vertical:
+ return orientation;
+ case Auto:
+ Point size = parent.getSize();
+ return (size.x > size.y) ? Orientation.Horizontal : Orientation.Vertical;
}
return null;
}
@@ -285,22 +282,22 @@ public class ResultsView extends ViewPart {
/**
* Changes the view caption.
- *
+ *
* @param message new view caption
*/
public void setCaption(String message) {
setContentDescription(message);
}
-
+
@Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
this.memento = memento;
}
-
+
/**
* Restores the value of the checkable action.
- *
+ *
* @param memento previously saved state to restore the action value from
* @param key tag name that is used to restore the value
* @param action action to restore
@@ -315,7 +312,7 @@ public class ResultsView extends ViewPart {
/**
* Restores the state of the view.
- *
+ *
* @param memento previously saved state
*/
private void restoreState(IMemento memento) {
@@ -341,12 +338,12 @@ public class ResultsView extends ViewPart {
public void saveState(IMemento memento) {
//Keep the old state;
if (parent == null) {
- if (this.memento != null) {
+ if (this.memento != null) {
memento.putMemento(this.memento);
}
return;
}
-
+
memento.putInteger(TAG_ORIENTATION, orientation.ordinal());
resultsPanel.saveState(memento);
memento.putBoolean(TAG_SHOW_FAILED_ONLY, showFailedOnly.isChecked());
@@ -359,11 +356,11 @@ public class ResultsView extends ViewPart {
/**
* Returns whether the view was disposed.
- *
+ *
* @return true if the view was disposed
*/
public boolean isDisposed() {
return isDisposed;
}
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java
index bff2188943a..8642f8f2982 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestPathUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -32,13 +32,13 @@ public class TestPathUtils {
/** The delimiter between parts of human readable test path. */
private static final String TEST_PATH_DELIMITER = "."; //$NON-NLS-1$
-
+
/**
* Returns the human readable path to the item in test hierarchy (e.g.
* MySuite.MyInnerSuite.MyTest1).
- *
+ *
* @param testItem test item (test suite or test case)
- *
+ *
* @return path to test item
*/
public static String getTestItemPath(ITestItem testItem) {
@@ -49,7 +49,7 @@ public class TestPathUtils {
testItem = testItem.getParent();
}
if (!parentItems.isEmpty()) {
- for (int i = parentItems.size()-2/* exclude unnamed root test suite */; i >= 0; --i) {
+ for (int i = parentItems.size() - 2/* exclude unnamed root test suite */; i >= 0; --i) {
itemPath.append(parentItems.get(i).getName());
if (i != 0) {
itemPath.append(TEST_PATH_DELIMITER);
@@ -58,42 +58,42 @@ public class TestPathUtils {
}
return itemPath.toString();
}
-
+
/**
* Unpack the paths from the string list.
- *
+ *
* @param testPaths packed test paths
* @return array of test paths
- *
+ *
* @see packTestPaths()
*/
public static String[][] unpackTestPaths(String[] testPaths) {
- String [][] result = new String[testPaths.length][];
+ String[][] result = new String[testPaths.length][];
for (int i = 0; i < result.length; i++) {
result[i] = testPaths[i].split(TEST_PATH_PART_DELIMITER);
}
return result;
}
-
+
/**
* Pack the paths to specified test items to string list.
- *
+ *
* @param testItems test items to pack
* @return string list
- *
+ *
* @see unpackTestPaths()
*/
public static String[] packTestPaths(ITestItem[] testItems) {
- String [] result = new String[testItems.length];
+ String[] result = new String[testItems.length];
List<String> testPath = new ArrayList<String>();
-
+
for (int itemIdx = 0; itemIdx < testItems.length; itemIdx++) {
// Collect test path parts (in reverse order)
testPath.clear();
ITestItem item = testItems[itemIdx];
while (item != null) {
// Exclude root test suite
- if (item.getParent()!= null) {
+ if (item.getParent() != null) {
testPath.add(item.getName());
}
item = item.getParent();
@@ -101,7 +101,7 @@ public class TestPathUtils {
// Join path parts into the only string
StringBuilder sb = new StringBuilder();
boolean needDelimiter = false;
- for (int pathPartIdx = testPath.size()-1; pathPartIdx >= 0; pathPartIdx--) {
+ for (int pathPartIdx = testPath.size() - 1; pathPartIdx >= 0; pathPartIdx--) {
if (needDelimiter) {
sb.append(TEST_PATH_PART_DELIMITER);
} else {
@@ -113,6 +113,5 @@ public class TestPathUtils {
}
return result;
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java
index 14c11f1c332..2177dc2e740 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/TestsHierarchyViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -61,7 +61,7 @@ import org.eclipse.ui.actions.ActionFactory;
* Shows the tests hierarchy in a flat or hierarchical view.
*/
public class TestsHierarchyViewer {
-
+
/**
* The content provider for the tests hierarchy viewer.
*/
@@ -70,30 +70,39 @@ public class TestsHierarchyViewer {
/**
* Utility class: recursively collects all the test cases of the
* specified test item.
- *
+ *
* It is used for flat view of tests hierarchy.
*/
private class TestCasesCollector implements IModelVisitor {
-
+
public List<ITestCase> testCases = new ArrayList<ITestCase>();
-
+
@Override
public void visit(ITestCase testCase) {
testCases.add(testCase);
}
-
+
@Override
- public void visit(ITestMessage testMessage) {}
+ public void visit(ITestMessage testMessage) {
+ }
+
@Override
- public void visit(ITestSuite testSuite) {}
+ public void visit(ITestSuite testSuite) {
+ }
+
@Override
- public void leave(ITestSuite testSuite) {}
+ public void leave(ITestSuite testSuite) {
+ }
+
@Override
- public void leave(ITestCase testCase) {}
+ public void leave(ITestCase testCase) {
+ }
+
@Override
- public void leave(ITestMessage testMessage) {}
+ public void leave(ITestMessage testMessage) {
+ }
}
-
+
@Override
public Object[] getChildren(Object parentElement) {
return ((ITestItem) parentElement).getChildren();
@@ -105,7 +114,7 @@ public class TestsHierarchyViewer {
return getChildren(rootTestSuite);
} else {
TestCasesCollector testCasesCollector = new TestCasesCollector();
- ((ITestItem)rootTestSuite).visit(testCasesCollector);
+ ((ITestItem) rootTestSuite).visit(testCasesCollector);
return testCasesCollector.testCases.toArray();
}
}
@@ -121,10 +130,12 @@ public class TestsHierarchyViewer {
}
@Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
@Override
- public void dispose() {}
+ public void dispose() {
+ }
}
/**
@@ -141,7 +152,7 @@ public class TestsHierarchyViewer {
testCaseImages.put(ITestItem.Status.Failed, TestsRunnerPlugin.createAutoImage("obj16/test_failed.gif")); //$NON-NLS-1$
testCaseImages.put(ITestItem.Status.Aborted, TestsRunnerPlugin.createAutoImage("obj16/test_aborted.gif")); //$NON-NLS-1$
}
-
+
/** Running test case image (overrides the test case status image). */
private Image testCaseRunImage = TestsRunnerPlugin.createAutoImage("obj16/test_run.gif"); //$NON-NLS-1$
@@ -153,45 +164,45 @@ public class TestsHierarchyViewer {
testSuiteImages.put(ITestItem.Status.Skipped, TestsRunnerPlugin.createAutoImage("obj16/tsuite_notrun.gif")); //$NON-NLS-1$
testSuiteImages.put(ITestItem.Status.Passed, TestsRunnerPlugin.createAutoImage("obj16/tsuite_passed.gif")); //$NON-NLS-1$
testSuiteImages.put(ITestItem.Status.Failed, TestsRunnerPlugin.createAutoImage("obj16/tsuite_failed.gif")); //$NON-NLS-1$
- testSuiteImages.put(ITestItem.Status.Aborted, TestsRunnerPlugin.createAutoImage("obj16/tsuite_aborted.gif")); //$NON-NLS-1$
+ testSuiteImages.put(ITestItem.Status.Aborted,
+ TestsRunnerPlugin.createAutoImage("obj16/tsuite_aborted.gif")); //$NON-NLS-1$
}
/** Running test suite image (overrides the test suite status image). */
private Image testSuiteRunImage = TestsRunnerPlugin.createAutoImage("obj16/tsuite_run.gif"); //$NON-NLS-1$
-
+
/** Small optimization: the last test item cache */
private ITestItem lastTestItemCache = null;
/** Small optimization: test path for the last test item is cache */
private String lastTestItemPathCache = null;
-
- @Override
+ @Override
public Image getImage(Object element) {
- Map<ITestItem.Status, Image> imagesMap = null;
- Image runImage = null;
- if (element instanceof ITestCase) {
- imagesMap = testCaseImages;
- runImage = testCaseRunImage;
-
- } else if (element instanceof ITestSuite) {
- imagesMap = testSuiteImages;
- runImage = testSuiteRunImage;
- }
- if (imagesMap != null) {
- ITestItem testItem = (ITestItem)element;
+ Map<ITestItem.Status, Image> imagesMap = null;
+ Image runImage = null;
+ if (element instanceof ITestCase) {
+ imagesMap = testCaseImages;
+ runImage = testCaseRunImage;
+
+ } else if (element instanceof ITestSuite) {
+ imagesMap = testSuiteImages;
+ runImage = testSuiteRunImage;
+ }
+ if (imagesMap != null) {
+ ITestItem testItem = (ITestItem) element;
if (testingSession.getModelAccessor().isCurrentlyRunning(testItem)) {
return runImage;
}
return imagesMap.get(testItem.getStatus());
- }
-
- return null;
- }
+ }
+
+ return null;
+ }
@Override
public String getText(Object element) {
- ITestItem testItem = (ITestItem)element;
+ ITestItem testItem = (ITestItem) element;
StringBuilder sb = new StringBuilder();
sb.append(testItem.getName());
if (!showTestsHierarchy) {
@@ -205,27 +216,29 @@ public class TestsHierarchyViewer {
@Override
public StyledString getStyledText(Object element) {
- ITestItem testItem = (ITestItem)element;
+ ITestItem testItem = (ITestItem) element;
StringBuilder labelBuf = new StringBuilder();
labelBuf.append(testItem.getName());
StyledString name = new StyledString(labelBuf.toString());
if (!showTestsHierarchy) {
appendTestItemPath(labelBuf, testItem);
- name = StyledCellLabelProvider.styleDecoratedString(labelBuf.toString(), StyledString.QUALIFIER_STYLER, name);
+ name = StyledCellLabelProvider.styleDecoratedString(labelBuf.toString(), StyledString.QUALIFIER_STYLER,
+ name);
}
if (showTime) {
String time = getTestingTimeString(element);
labelBuf.append(time);
- name = StyledCellLabelProvider.styleDecoratedString(labelBuf.toString(), StyledString.COUNTER_STYLER, name);
+ name = StyledCellLabelProvider.styleDecoratedString(labelBuf.toString(), StyledString.COUNTER_STYLER,
+ name);
}
return name;
}
-
+
/**
* Appends path to the parent of the specified test item. Also
* implements caching of the last path (cause the test item parent is
* often the same).
- *
+ *
* @param sb string builder to append test item path to
* @param testItem specified test item
*/
@@ -235,26 +248,25 @@ public class TestsHierarchyViewer {
lastTestItemCache = testItemParent;
lastTestItemPathCache = TestPathUtils.getTestItemPath(lastTestItemCache);
}
- sb.append(MessageFormat.format(
- UIViewMessages.TestsHierarchyViewer_test_path_format,
- new Object[] { lastTestItemPathCache }
- ));
+ sb.append(MessageFormat.format(UIViewMessages.TestsHierarchyViewer_test_path_format,
+ new Object[] { lastTestItemPathCache }));
}
-
+
/**
* Returns the execution time suffix for the test item.
- *
+ *
* @param element test item
* @return execution time suffix
*/
private String getTestingTimeString(Object element) {
return (element instanceof ITestItem)
- ? MessageFormat.format(UIViewMessages.TestsHierarchyViewer_test_time_format, Double.toString(((ITestItem)element).getTestingTime()/1000.0))
- : ""; //$NON-NLS-1$
+ ? MessageFormat.format(UIViewMessages.TestsHierarchyViewer_test_time_format,
+ Double.toString(((ITestItem) element).getTestingTime() / 1000.0))
+ : ""; //$NON-NLS-1$
}
-
+
}
-
+
/**
* Filters passed test cases and test suites.
*/
@@ -262,28 +274,28 @@ public class TestsHierarchyViewer {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- return ((ITestItem)element).getStatus().isError();
+ return ((ITestItem) element).getStatus().isError();
}
}
/** Testing session to show hierarchy of. */
private ITestingSession testingSession;
-
+
/** Main widget. */
private TreeViewer treeViewer;
-
+
/** Specifies whether test items execution time should be shown in hierarchy. */
private boolean showTime = true;
/** Specifies whether tests hierarchy should be shown in flat or hierarchical view. */
private boolean showTestsHierarchy = true;
-
+
/** Failed only tree filter instance. Created on first demand. */
private FailedOnlyFilter failedOnlyFilter = null;
-
+
/** System clipboard access to provide copy operations. */
private Clipboard clipboard;
-
+
// Context menu actions
private Action expandAllAction;
private Action collapseAllAction;
@@ -291,7 +303,6 @@ public class TestsHierarchyViewer {
private RelaunchSelectedAction rerunAction;
private RelaunchSelectedAction redebugAction;
-
public TestsHierarchyViewer(Composite parent, IViewSite viewSite, Clipboard clipboard) {
this.clipboard = clipboard;
treeViewer = new TreeViewer(parent, SWT.V_SCROLL | SWT.MULTI);
@@ -299,10 +310,10 @@ public class TestsHierarchyViewer {
treeViewer.setLabelProvider(new ColoringLabelProvider(new TestLabelProvider()));
initContextMenu(viewSite);
}
-
+
/**
- * Initializes the viewer context menu.
- *
+ * Initializes the viewer context menu.
+ *
* @param viewSite view
*/
private void initContextMenu(IViewSite viewSite) {
@@ -335,16 +346,17 @@ public class TestsHierarchyViewer {
actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
actionBars.updateActionBars();
}
-
+
/**
* Handles the context menu showing.
- *
+ *
* @param manager context menu manager
*/
private void handleMenuAboutToShow(IMenuManager manager) {
- IStructuredSelection selection = (IStructuredSelection)treeViewer.getSelection();
- boolean isRelaunchEnabledForSelection = !selection.isEmpty() &&
- (testingSession.getTestsRunnerProviderInfo().isAllowedMultipleTestFilter() || (selection.size() == 1));
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ boolean isRelaunchEnabledForSelection = !selection.isEmpty()
+ && (testingSession.getTestsRunnerProviderInfo().isAllowedMultipleTestFilter()
+ || (selection.size() == 1));
rerunAction.setEnabled(isRelaunchEnabledForSelection);
rerunAction.setTestingSession(testingSession);
redebugAction.setEnabled(isRelaunchEnabledForSelection);
@@ -358,7 +370,7 @@ public class TestsHierarchyViewer {
/**
* Sets the testing session to show.
- *
+ *
* @param testingSession testing session or null to set default empty
* session
*/
@@ -366,10 +378,10 @@ public class TestsHierarchyViewer {
this.testingSession = testingSession;
treeViewer.setInput(testingSession != null ? testingSession.getModelAccessor().getRootSuite() : null);
}
-
+
/**
* Provides access to the main widget of the tests hierarchy viewer.
- *
+ *
* @return main widget of the tests hierarchy viewer
*/
public TreeViewer getTreeViewer() {
@@ -382,18 +394,18 @@ public class TestsHierarchyViewer {
public void showNextFailure() {
showFailure(true);
}
-
+
/**
* Move the selection to the previous failed test case.
*/
public void showPreviousFailure() {
showFailure(false);
}
-
+
/**
* Common implementation for movement the selection to the next or previous
* failed test case.
- *
+ *
* @param next true if the next failed test case should be selected and false otherwise
*/
private void showFailure(boolean next) {
@@ -402,7 +414,7 @@ public class TestsHierarchyViewer {
ITestItem failedItem;
if (selected == null) {
- ITestItem rootSuite = (ITestItem)treeViewer.getInput();
+ ITestItem rootSuite = (ITestItem) treeViewer.getInput();
// For next element we should also check its children, for previous shouldn't.
failedItem = findFailedImpl(rootSuite, null, next, next);
} else {
@@ -413,13 +425,13 @@ public class TestsHierarchyViewer {
if (failedItem != null)
getTreeViewer().setSelection(new StructuredSelection(failedItem), true);
}
-
+
/**
* Returns the next or previous failed test case relatively to the
* <code>currItem</code> that should be a child of <code>parentItem</code>.
* If the such item was not found through the children, it steps up to the
* parent and continues search.
- *
+ *
* @param parentItem parent test item to the current one
* @param currItem current item search should be started from or null if
* there is no any
@@ -429,7 +441,8 @@ public class TestsHierarchyViewer {
* through the children for the current item
* @return found item or null
*/
- private ITestItem findFailedImpl(ITestItem parentItem, ITestItem currItem, boolean next, boolean checkCurrentChild) {
+ private ITestItem findFailedImpl(ITestItem parentItem, ITestItem currItem, boolean next,
+ boolean checkCurrentChild) {
ITestItem result = findFailedChild(parentItem, currItem, next, checkCurrentChild);
if (result != null) {
return result;
@@ -441,13 +454,13 @@ public class TestsHierarchyViewer {
}
return null;
}
-
+
/**
* Returns the next or previous failed test case relatively to the
* <code>currItem</code> that should be a child of <code>parentItem</code>.
* Note that unlike <code>findFailedImpl()</code> this method search only
* through the children items.
- *
+ *
* @param parentItem parent test item to the current one
* @param currItem current item search should be started from or null if
* there is no any
@@ -457,11 +470,12 @@ public class TestsHierarchyViewer {
* through the children for the current item
* @return found item or null
*/
- private ITestItem findFailedChild(ITestItem parentItem, ITestItem currItem, boolean next, boolean checkCurrentChild) {
+ private ITestItem findFailedChild(ITestItem parentItem, ITestItem currItem, boolean next,
+ boolean checkCurrentChild) {
ITestItem[] children = parentItem.getChildren();
boolean doSearch = (currItem == null);
int increment = next ? 1 : -1;
- int startIndex = next ? 0 : children.length-1;
+ int startIndex = next ? 0 : children.length - 1;
int endIndex = next ? children.length : -1;
for (int index = startIndex; index != endIndex; index += increment) {
ITestItem item = children[index];
@@ -493,7 +507,7 @@ public class TestsHierarchyViewer {
/**
* Returns whether test items execution time should be shown in tests
* hierarchy.
- *
+ *
* @return true if time should be shown and false otherwise
*/
public boolean showTime() {
@@ -503,7 +517,7 @@ public class TestsHierarchyViewer {
/**
* Sets whether test items execution time should be shown in tests
* hierarchy. Updates tests hierarchy viewer if the view is changed.
- *
+ *
* @param showTime true if time is shown and false otherwise
*/
public void setShowTime(boolean showTime) {
@@ -512,10 +526,10 @@ public class TestsHierarchyViewer {
getTreeViewer().refresh();
}
}
-
+
/**
* Sets whether only failed tests should be shown.
- *
+ *
* @param showFailedOnly new filter state
*/
public void setShowFailedOnly(boolean showFailedOnly) {
@@ -533,7 +547,7 @@ public class TestsHierarchyViewer {
/**
* Returns whether tests hierarchy should be shown in flat or hierarchical
* mode.
- *
+ *
* @return tests hierarchy view mode
*/
public boolean showTestsHierarchy() {
@@ -543,7 +557,7 @@ public class TestsHierarchyViewer {
/**
* Sets whether tests hierarchy should be shown in flat or hierarchical
* mode. Updates tests hierarchy viewer if the view is changed.
- *
+ *
* @param showTestsHierarchy true if tests hierarchy is shown in
* hierarchical mode and false otherwise
*/
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java
index 6e8e8d30b76..6c76e7cc4c6 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/UIUpdater.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -38,49 +38,48 @@ import org.eclipse.ui.progress.UIJob;
* periodically. It allows to significantly improve the UI performance.
*/
public class UIUpdater {
-
+
/** Access to the results showing view. */
private ResultsView resultsView;
-
+
/** Access to the tests hierarchy showing widget. */
private TestsHierarchyViewer testsHierarchyViewer;
/** Access to the statistics showing widget. */
private ProgressCountPanel progressCountPanel;
-
+
/** Listener for the changes in active testing session. */
private ITestingSessionListener sessionListener;
-
+
/**
* Specifies whether tests hierarchy scrolling should be done during the
* testing process.
*/
private boolean autoScroll = true;
-
+
/** Access to the testing sessions manager. */
private TestingSessionsManager sessionsManager;
-
+
/** Listener to handle active testing session change. */
private TestingSessionsManagerListener sessionsManagerListener;
-
+
/** Reference to the active testing session. */
ITestingSession testingSession;
-
+
/** Storage for the UI changes that should be done on update. */
UIChangesCache uiChangesCache = new UIChangesCache();
-
+
/** A job that makes an UI update periodically. */
UpdateUIJob updateUIJob = null;
-
+
/** Time interval over which the UI should be updated. */
private static final int REFRESH_INTERVAL = 200;
-
-
- /**
+
+ /**
* Storage for the UI changes that should be done on update.
*/
private class UIChangesCache {
-
+
/**
* Specifies whether Progress Counter Panel should be updated during the
* next UI update.
@@ -98,26 +97,25 @@ public class UIUpdater {
* next UI update.
*/
private ITestItem testItemForNewViewCaption;
-
+
/**
* Set of tree objects on which <code>refresh()</code> should be called
* during the next UI update.
*/
- private Set<Object> treeItemsToRefresh = new HashSet<Object>();
+ private Set<Object> treeItemsToRefresh = new HashSet<Object>();
/**
* Set of tree objects on which <code>update()</code> should be called
* during the next UI update.
*/
- private Set<Object> treeItemsToUpdate = new HashSet<Object>();
+ private Set<Object> treeItemsToUpdate = new HashSet<Object>();
+
+ /** Tree object that should be revealed during the next UI update. */
+ private Object treeItemToReveal;
- /** Tree object that should be revealed during the next UI update. */
- private Object treeItemToReveal;
-
- /** Map of tree objects that should be expanded or collapsed to their new states. */
+ /** Map of tree objects that should be expanded or collapsed to their new states. */
private Map<Object, Boolean> treeItemsToExpand = new LinkedHashMap<Object, Boolean>();
-
-
+
UIChangesCache() {
resetChanges();
}
@@ -130,7 +128,7 @@ public class UIUpdater {
needProgressCountPanelUpdate = true;
}
}
-
+
/**
* Schedules the view actions update during the next UI update.
*/
@@ -139,11 +137,11 @@ public class UIUpdater {
needActionsUpdate = true;
}
}
-
+
/**
* Schedules the view caption update to the path to specified test item
* during the next UI update.
- *
+ *
* @param testItem specified test item
*/
public void scheduleViewCaptionChange(ITestItem testItem) {
@@ -151,11 +149,11 @@ public class UIUpdater {
testItemForNewViewCaption = testItem;
}
}
-
+
/**
* Schedules the <code>update()</code> call for the specified tree
* object during the next UI update.
- *
+ *
* @param item tree object to update
*/
public void scheduleTreeItemUpdate(Object item) {
@@ -163,11 +161,11 @@ public class UIUpdater {
treeItemsToUpdate.add(item);
}
}
-
+
/**
* Schedules the revealing of the specified tree object. Overrides
* the previously specified tree object to reveal (if any).
- *
+ *
* @param item tree object to reveal
*/
public void scheduleTreeItemReveal(Object item) {
@@ -175,11 +173,11 @@ public class UIUpdater {
treeItemToReveal = item;
}
}
-
+
/**
* Schedules the expanding or collapsing of the specified tree object.
* Overrides the previous state for the same tree object (if any).
- *
+ *
* @param item tree object to expand or collapse
* @param expandedState true if the node is expanded, and false if
* collapsed
@@ -189,11 +187,11 @@ public class UIUpdater {
treeItemsToExpand.put(item, expandedState);
}
}
-
+
/**
* Schedules the <code>refresh()</code> call for the specified tree
* object during the next UI update.
- *
+ *
* @param item tree object to refresh
*/
public void scheduleTreeItemRefresh(Object item) {
@@ -201,8 +199,7 @@ public class UIUpdater {
treeItemsToRefresh.add(item);
}
}
-
-
+
/**
* Apply any scheduled changes to UI.
*/
@@ -219,13 +216,9 @@ public class UIUpdater {
}
// View caption update
if (testItemForNewViewCaption != null) {
- resultsView.setCaption(
- MessageFormat.format(
- UIViewMessages.UIUpdater_view_caption_format,
- testItemForNewViewCaption.getName(),
- TestPathUtils.getTestItemPath(testItemForNewViewCaption.getParent())
- )
- );
+ resultsView.setCaption(MessageFormat.format(UIViewMessages.UIUpdater_view_caption_format,
+ testItemForNewViewCaption.getName(),
+ TestPathUtils.getTestItemPath(testItemForNewViewCaption.getParent())));
}
// Tree view update
if (!treeItemsToRefresh.isEmpty()) {
@@ -244,7 +237,7 @@ public class UIUpdater {
treeViewer.setExpandedState(entry.getKey(), entry.getValue());
}
}
- // All changes are applied, remove them
+ // All changes are applied, remove them
resetChangesImpl();
}
}
@@ -257,7 +250,7 @@ public class UIUpdater {
resetChangesImpl();
}
}
-
+
/**
* Reset all the scheduled changes to UI. Note, this method is not
* synchronized so it should be used carefully
@@ -272,7 +265,6 @@ public class UIUpdater {
}
}
-
/**
* A job that makes an UI update periodically.
*/
@@ -294,14 +286,14 @@ public class UIUpdater {
}
return Status.OK_STATUS;
}
-
+
/**
* Schedule self for running after time interval.
*/
public void scheduleSelf() {
schedule(REFRESH_INTERVAL);
}
-
+
/**
* Sets the flag that prevents planning this job again.
*/
@@ -316,15 +308,14 @@ public class UIUpdater {
}
-
/**
* Listener for the changes in active testing session.
*/
private class SessionListener implements ITestingSessionListener {
-
+
/**
* Common implementation for test case and test suite entering.
- *
+ *
* @param testItem test case or test suite
*/
private void enterTestItem(ITestItem testItem) {
@@ -334,12 +325,12 @@ public class UIUpdater {
uiChangesCache.scheduleTreeItemReveal(testItem);
}
}
-
+
@Override
public void enterTestSuite(ITestSuite testSuite) {
enterTestItem(testSuite);
}
-
+
@Override
public void exitTestSuite(ITestSuite testSuite) {
uiChangesCache.scheduleTreeItemUpdate(testSuite);
@@ -347,19 +338,19 @@ public class UIUpdater {
uiChangesCache.scheduleTreeItemExpand(testSuite, false);
}
}
-
+
@Override
public void enterTestCase(ITestCase testCase) {
enterTestItem(testCase);
}
-
+
@Override
public void exitTestCase(ITestCase testCase) {
uiChangesCache.scheduleActionsUpdate();
uiChangesCache.scheduleProgressCountPanelUpdate();
uiChangesCache.scheduleTreeItemUpdate(testCase);
}
-
+
@Override
public void childrenUpdate(ITestSuite parent) {
uiChangesCache.scheduleTreeItemRefresh(parent);
@@ -369,7 +360,7 @@ public class UIUpdater {
public void testingStarted() {
resultsView.updateActionsFromSession();
Display.getDefault().syncExec(new Runnable() {
-
+
@Override
public void run() {
resultsView.setCaption(testingSession.getStatusMessage());
@@ -385,7 +376,7 @@ public class UIUpdater {
stopUpdateUIJob();
resultsView.updateActionsFromSession();
Display.getDefault().syncExec(new Runnable() {
-
+
@Override
public void run() {
uiChangesCache.applyChanges();
@@ -399,25 +390,24 @@ public class UIUpdater {
}
}
-
/**
* Listener to handle active testing session change.
*/
private class TestingSessionsManagerListener implements ITestingSessionsManagerListener {
-
+
@Override
public void sessionActivated(ITestingSession newTestingSession) {
if (testingSession != newTestingSession) {
stopUpdateUIJob();
uiChangesCache.resetChanges();
-
+
unsubscribeFromSessionEvent();
testingSession = newTestingSession;
subscribeToSessionEvent();
-
+
resultsView.updateActionsFromSession();
Display.getDefault().syncExec(new Runnable() {
-
+
@Override
public void run() {
progressCountPanel.setTestingSession(testingSession);
@@ -432,8 +422,8 @@ public class UIUpdater {
}
}
-
- public UIUpdater(ResultsView resultsView, TestsHierarchyViewer testsHierarchyViewer, ProgressCountPanel progressCountPanel, TestingSessionsManager sessionsManager) {
+ public UIUpdater(ResultsView resultsView, TestsHierarchyViewer testsHierarchyViewer,
+ ProgressCountPanel progressCountPanel, TestingSessionsManager sessionsManager) {
this.resultsView = resultsView;
this.testsHierarchyViewer = testsHierarchyViewer;
this.progressCountPanel = progressCountPanel;
@@ -446,17 +436,17 @@ public class UIUpdater {
/**
* Returns whether tests hierarchy scrolling should be done during the
* testing process.
- *
+ *
* @return auto scroll state
*/
public boolean getAutoScroll() {
return autoScroll;
}
-
+
/**
* Sets whether whether tests hierarchy scrolling should be done during the
* testing process.
- *
+ *
* @param autoScroll new filter state
*/
public void setAutoScroll(boolean autoScroll) {
@@ -470,7 +460,7 @@ public class UIUpdater {
unsubscribeFromSessionEvent();
sessionsManager.removeListener(sessionsManagerListener);
}
-
+
/**
* Subscribes to the events of currently set testing session.
*/
@@ -488,7 +478,7 @@ public class UIUpdater {
testingSession.getModelAccessor().removeChangesListener(sessionListener);
}
}
-
+
/**
* Starts the UI updating job. Stops the previously running (if any).
*/
@@ -498,7 +488,7 @@ public class UIUpdater {
updateUIJob = new UpdateUIJob();
updateUIJob.scheduleSelf();
}
-
+
/**
* Stops the UI updating job (if any).
*/
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedMessagesAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedMessagesAction.java
index dd73b7d50a5..6206ec24fac 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedMessagesAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedMessagesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import java.util.Iterator;
import org.eclipse.jface.action.Action;
@@ -33,7 +32,6 @@ public class CopySelectedMessagesAction extends Action {
private Clipboard clipboard;
private TableViewer tableViewer;
-
public CopySelectedMessagesAction(TableViewer tableViewer, Clipboard clipboard) {
super(ActionsMessages.CopySelectedMessagesAction_text);
setToolTipText(ActionsMessages.CopySelectedMessagesAction_tooltip);
@@ -44,8 +42,8 @@ public class CopySelectedMessagesAction extends Action {
@Override
public void run() {
- ITableLabelProvider labelProvider = (ITableLabelProvider)tableViewer.getLabelProvider();
- IStructuredSelection selection = (IStructuredSelection)tableViewer.getSelection();
+ ITableLabelProvider labelProvider = (ITableLabelProvider) tableViewer.getLabelProvider();
+ IStructuredSelection selection = (IStructuredSelection) tableViewer.getSelection();
if (!selection.isEmpty()) {
StringBuilder sb = new StringBuilder();
boolean needEOL = false;
@@ -58,11 +56,8 @@ public class CopySelectedMessagesAction extends Action {
}
sb.append(labelProvider.getColumnText(item, 0));
}
- clipboard.setContents(
- new String[]{ sb.toString() },
- new Transfer[]{ TextTransfer.getInstance() });
+ clipboard.setContents(new String[] { sb.toString() }, new Transfer[] { TextTransfer.getInstance() });
}
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedTestsAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedTestsAction.java
index 0b0a0533353..5526fc3e52e 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedTestsAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/CopySelectedTestsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import java.util.Iterator;
import org.eclipse.cdt.testsrunner.internal.ui.view.TestPathUtils;
@@ -35,7 +34,6 @@ public class CopySelectedTestsAction extends Action {
private TreeViewer treeViewer;
private Clipboard clipboard;
-
public CopySelectedTestsAction(TreeViewer treeViewer, Clipboard clipboard) {
super(ActionsMessages.CopySelectedTestsAction_text);
setToolTipText(ActionsMessages.CopySelectedTestsAction_tooltip);
@@ -46,7 +44,7 @@ public class CopySelectedTestsAction extends Action {
@Override
public void run() {
- IStructuredSelection selection = (IStructuredSelection)treeViewer.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
if (!selection.isEmpty()) {
StringBuilder sb = new StringBuilder();
boolean needEOL = false;
@@ -56,13 +54,10 @@ public class CopySelectedTestsAction extends Action {
} else {
needEOL = true;
}
- sb.append(TestPathUtils.getTestItemPath((ITestItem)it.next()));
+ sb.append(TestPathUtils.getTestItemPath((ITestItem) it.next()));
}
- clipboard.setContents(
- new String[]{ sb.toString() },
- new Transfer[]{ TextTransfer.getInstance() });
+ clipboard.setContents(new String[] { sb.toString() }, new Transfer[] { TextTransfer.getInstance() });
}
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java
index 0874c95f012..620604e7e15 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/HistoryDropDownAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
@@ -51,14 +50,14 @@ import org.eclipse.swt.widgets.Shell;
* Shows the testing sessions history in drop down list.
*/
public class HistoryDropDownAction extends Action {
-
+
/**
* The dialog for testing sessions history management. Allows to browse,
* activate and remove the selected testing sessions and to set testing
* sessions history size limit.
*/
private class HistoryListDialog extends StatusDialog {
-
+
/** Max value for the history size limit that may be set via the dialog. */
private static final int MAX_HISTORY_SIZE_LIMIT = 100;
@@ -67,14 +66,13 @@ public class HistoryDropDownAction extends Action {
/** String field that allows to set testing sessions history size limit. */
private StringDialogField historySizeLimitField;
-
+
/** Currently set testing sessions history size limit. */
private int historySizeLimit;
/** The currently selected active testing session. */
private ITestingSession resultActiveSession;
-
/**
* Label provider for the dialog testing sessions list.
*/
@@ -82,12 +80,11 @@ public class HistoryDropDownAction extends Action {
@Override
public String getText(Object element) {
- return ((ITestingSession)element).getName();
+ return ((ITestingSession) element).getName();
}
}
-
private HistoryListDialog(Shell shell) {
super(shell);
setHelpAvailable(false);
@@ -111,6 +108,7 @@ public class HistoryDropDownAction extends Action {
public void customButtonPressed(ListDialogField<ITestingSession> field, int index) {
doCustomButtonPressed(index);
}
+
@Override
public void selectionChanged(ListDialogField<ITestingSession> field) {
doSelectionChanged();
@@ -121,7 +119,8 @@ public class HistoryDropDownAction extends Action {
doDoubleClicked();
}
};
- String[] buttonLabels = new String[] { ActionsMessages.HistoryAction_dialog_button_remove, ActionsMessages.HistoryAction_dialog_button_remove_all };
+ String[] buttonLabels = new String[] { ActionsMessages.HistoryAction_dialog_button_remove,
+ ActionsMessages.HistoryAction_dialog_button_remove_all };
LabelProvider labelProvider = new TestRunLabelProvider();
historyList = new ListDialogField<ITestingSession>(adapter, buttonLabels, labelProvider);
historyList.setLabelText(ActionsMessages.HistoryAction_dialog_list_title);
@@ -149,11 +148,10 @@ public class HistoryDropDownAction extends Action {
} catch (NumberFormatException e) {
valid = false;
}
- IStatus status = valid ? StatusInfo.OK_STATUS : new StatusInfo(IStatus.ERROR,
- MessageFormat.format(ActionsMessages.HistoryAction_dialog_limit_label_error,
- Integer.toString(MAX_HISTORY_SIZE_LIMIT)
- )
- );
+ IStatus status = valid ? StatusInfo.OK_STATUS
+ : new StatusInfo(IStatus.ERROR,
+ MessageFormat.format(ActionsMessages.HistoryAction_dialog_limit_label_error,
+ Integer.toString(MAX_HISTORY_SIZE_LIMIT)));
updateStatus(status);
}
});
@@ -170,7 +168,9 @@ public class HistoryDropDownAction extends Action {
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
inner.setFont(composite.getFont());
- LayoutUtil.doDefaultLayout(inner, new DialogField[] { historyList, new org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator() }, true);
+ LayoutUtil.doDefaultLayout(inner,
+ new DialogField[] { historyList, new org.eclipse.cdt.internal.ui.wizards.dialogfields.Separator() },
+ true);
LayoutUtil.setHeightHint(historyList.getListControl(null), convertHeightInCharsToPixels(12));
LayoutUtil.setHorizontalGrabbing(historyList.getListControl(null));
@@ -184,22 +184,22 @@ public class HistoryDropDownAction extends Action {
}
/**
- * Processes dialog custom button pressing.
- *
+ * Processes dialog custom button pressing.
+ *
* @param index index of the button
*/
private void doCustomButtonPressed(int index) {
switch (index) {
- case 0: // remove
- historyList.removeElements(historyList.getSelectedElements());
- historyList.selectFirstElement();
- break;
-
- case 1: // remove all
- historyList.removeAllElements();
- break;
- default:
- break;
+ case 0: // remove
+ historyList.removeElements(historyList.getSelectedElements());
+ historyList.selectFirstElement();
+ break;
+
+ case 1: // remove all
+ historyList.removeAllElements();
+ break;
+ default:
+ break;
}
}
@@ -225,7 +225,7 @@ public class HistoryDropDownAction extends Action {
/**
* Provides access to the active session currently selected by user.
- *
+ *
* @return testing session
*/
public ITestingSession getResultActiveSession() {
@@ -234,7 +234,7 @@ public class HistoryDropDownAction extends Action {
/**
* Provides access to the testing sessions history list edited by user.
- *
+ *
* @return list of testing sessions
*/
public List<ITestingSession> getResultSessions() {
@@ -243,7 +243,7 @@ public class HistoryDropDownAction extends Action {
/**
* Provides access to value of history size limit specified by user.
- *
+ *
* @return history size limit
*/
public int getResultHistorySizeLimit() {
@@ -251,12 +251,11 @@ public class HistoryDropDownAction extends Action {
}
}
-
/**
- * Represents a testing sessions history item.
+ * Represents a testing sessions history item.
*/
private class HistoryAction extends Action {
-
+
/** Testing session of the history item. */
private final ITestingSession testingSession;
@@ -268,7 +267,8 @@ public class HistoryDropDownAction extends Action {
String label = testingSession.getName();
if (testingSessionIndex < 10) {
// Add the numerical accelerator
- label = new StringBuilder().append('&').append(testingSessionIndex).append(' ').append(label).toString();
+ label = new StringBuilder().append('&').append(testingSessionIndex).append(' ').append(label)
+ .toString();
}
setText(label);
}
@@ -280,8 +280,7 @@ public class HistoryDropDownAction extends Action {
}
}
}
-
-
+
/**
* Provides access to the history list management dialog.
*/
@@ -298,13 +297,12 @@ public class HistoryDropDownAction extends Action {
}
}
}
-
-
+
/**
* Removes the terminated testing sessions from the history list.
*/
private class ClearAction extends Action {
-
+
public ClearAction() {
setText(ActionsMessages.HistoryAction_history_item_clear_text);
@@ -333,7 +331,6 @@ public class HistoryDropDownAction extends Action {
}
}
-
/**
* Represents the testing sessions history menu factory.
*/
@@ -365,13 +362,13 @@ public class HistoryDropDownAction extends Action {
private boolean addHistoryItems(IMenuManager manager) {
boolean checkOthers = true;
-
+
int sessionsCount = testingSessionsManager.getSessionsCount();
if (sessionsCount == 0) {
return false;
}
int menuItemsCount = Math.min(sessionsCount, RESULTS_IN_DROP_DOWN_MENU);
-
+
ITestingSession activeSession = testingSessionsManager.getActiveSession();
int testingSessionIndex = 0;
for (ITestingSession testingSession : testingSessionsManager.getSessions()) {
@@ -387,7 +384,7 @@ public class HistoryDropDownAction extends Action {
manager.add(action);
testingSessionIndex++;
}
-
+
return checkOthers;
}
});
@@ -404,21 +401,19 @@ public class HistoryDropDownAction extends Action {
}
}
}
-
-
+
/** Defines how many history items should be showed in drop down history menu. */
public static final int RESULTS_IN_DROP_DOWN_MENU = 10;
/** Accessor to the Testing Sessions Plug-in Manager. */
private TestingSessionsManager testingSessionsManager;
-
+
/** Required for the history dialog. */
private Shell shell;
-
+
/** Drop down menu */
private Menu menu;
-
public HistoryDropDownAction(TestingSessionsManager testingSessionsManager, Shell shell) {
super(ActionsMessages.HistoryAction_history_text);
setToolTipText(ActionsMessages.HistoryAction_history_tooltip);
@@ -441,11 +436,10 @@ public class HistoryDropDownAction extends Action {
testingSessionsManager.setSessions(dialog.getResultSessions());
}
}
-
+
@Override
public void run() {
runHistoryDialog();
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessageLevelFilterAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessageLevelFilterAction.java
index 5c8d21f1eb9..2b2a155f301 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessageLevelFilterAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessageLevelFilterAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.ui.view.MessagesViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;
@@ -26,9 +25,9 @@ public class MessageLevelFilterAction extends Action {
private MessagesViewer.LevelFilter levelFilter;
private MessagesViewer messagesViewer;
-
-
- public MessageLevelFilterAction(MessagesViewer messagePanel, MessagesViewer.LevelFilter levelFilter, boolean checked) {
+
+ public MessageLevelFilterAction(MessagesViewer messagePanel, MessagesViewer.LevelFilter levelFilter,
+ boolean checked) {
super("", AS_CHECK_BOX); //$NON-NLS-1$
this.levelFilter = levelFilter;
this.messagesViewer = messagePanel;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessagesOrderingAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessagesOrderingAction.java
index d5c7146c844..9666e5d60b6 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessagesOrderingAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/MessagesOrderingAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.MessagesViewer;
import org.eclipse.jface.action.Action;
@@ -25,7 +24,6 @@ public class MessagesOrderingAction extends Action {
private MessagesViewer messagesViewer;
-
public MessagesOrderingAction(MessagesViewer messagesViewer) {
super("", AS_CHECK_BOX); //$NON-NLS-1$
this.messagesViewer = messagesViewer;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/OpenInEditorAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/OpenInEditorAction.java
index 26c6bdecefd..f522fedb958 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/OpenInEditorAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/OpenInEditorAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import java.net.URI;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
@@ -63,8 +62,8 @@ public class OpenInEditorAction extends Action {
private TestingSessionsManager testingSessionsManager;
private IWorkbench workbench;
-
- public OpenInEditorAction(TableViewer tableViewer, TestingSessionsManager testingSessionsManager, IWorkbench workbench) {
+ public OpenInEditorAction(TableViewer tableViewer, TestingSessionsManager testingSessionsManager,
+ IWorkbench workbench) {
super(ActionsMessages.OpenInEditorAction_text);
this.messagesViewer = tableViewer;
this.testingSessionsManager = testingSessionsManager;
@@ -74,9 +73,9 @@ public class OpenInEditorAction extends Action {
@Override
public void run() {
- Object selectedObject = ((IStructuredSelection)messagesViewer.getSelection()).getFirstElement();
+ Object selectedObject = ((IStructuredSelection) messagesViewer.getSelection()).getFirstElement();
if (selectedObject != null && selectedObject instanceof ITestMessage) {
- ITestLocation messageLocation = ((ITestMessage)selectedObject).getLocation();
+ ITestLocation messageLocation = ((ITestMessage) selectedObject).getLocation();
if (messageLocation != null) {
ILaunch launch = testingSessionsManager.getActiveSession().getLaunch();
lookupSource(messageLocation, launch);
@@ -104,14 +103,15 @@ public class OpenInEditorAction extends Action {
sourceLocator.initializeDefaults(config);
} else {
sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
- String memento = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String) null);
+ String memento = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO,
+ (String) null);
if (memento == null) {
sourceLocator.initializeDefaults(config);
} else {
sourceLocator.initializeFromMemento(memento);
}
}
-
+
// replace old source locator
locator = sourceLocator;
launch.setSourceLocator(sourceLocator);
@@ -130,14 +130,15 @@ public class OpenInEditorAction extends Action {
TestsRunnerPlugin.log(e);
}
}
-
+
// NOTE: This method is copied from Linux Tools Project (http://www.eclipse.org/linuxtools).
// Valgrind Support Plugin is implementing similar functionality so it is just reused.
// See also org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java
- private void openEditorAndSelect(ISourceLookupResult result, int line) throws PartInitException, BadLocationException {
+ private void openEditorAndSelect(ISourceLookupResult result, int line)
+ throws PartInitException, BadLocationException {
IEditorInput input = result.getEditorInput();
String editorID = result.getEditorId();
-
+
if (input == null || editorID == null) {
// Consult the CDT DebugModelPresentation
Object sourceElement = result.getSourceElement();
@@ -153,8 +154,9 @@ public class OpenInEditorAction extends Action {
sourceElement = files[0];
}
}
-
- IDebugModelPresentation pres = DebugUITools.newDebugModelPresentation(CDebugCorePlugin.getUniqueIdentifier());
+
+ IDebugModelPresentation pres = DebugUITools
+ .newDebugModelPresentation(CDebugCorePlugin.getUniqueIdentifier());
input = pres.getEditorInput(sourceElement);
editorID = pres.getEditorId(input, sourceElement);
pres.dispose();
@@ -179,6 +181,5 @@ public class OpenInEditorAction extends Action {
}
}
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RedebugSelectedAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RedebugSelectedAction.java
index 9ebadde3fd9..1156a34af82 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RedebugSelectedAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RedebugSelectedAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.model.ITestingSession;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.viewers.TreeViewer;
@@ -34,6 +33,5 @@ public class RedebugSelectedAction extends RelaunchSelectedAction {
protected String getLaunchMode() {
return ILaunchManager.DEBUG_MODE;
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RelaunchSelectedAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RelaunchSelectedAction.java
index 00d9a8b887c..668ee16b2c5 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RelaunchSelectedAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RelaunchSelectedAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -40,7 +39,6 @@ public abstract class RelaunchSelectedAction extends Action {
private ITestingSession testingSession;
private TreeViewer treeViewer;
-
public RelaunchSelectedAction(ITestingSession testingSession, TreeViewer treeViewer) {
this.testingSession = testingSession;
this.treeViewer = treeViewer;
@@ -48,7 +46,7 @@ public abstract class RelaunchSelectedAction extends Action {
/**
* Returns the launch mode that should be use to run selected test item.
- *
+ *
* @return launch mode
*/
protected abstract String getLaunchMode();
@@ -69,18 +67,18 @@ public abstract class RelaunchSelectedAction extends Action {
}
setEnabled(false);
}
-
+
/**
* Returns the currently selected items of test hierarchy.
- *
+ *
* @return array of test items
*/
private ITestItem[] getSelectedTestItems() {
- IStructuredSelection selection = (IStructuredSelection)treeViewer.getSelection();
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
ITestItem[] result = new ITestItem[selection.size()];
int resultIndex = 0;
for (Iterator<?> it = selection.iterator(); it.hasNext();) {
- result[resultIndex] = (ITestItem)it.next();
+ result[resultIndex] = (ITestItem) it.next();
++resultIndex;
}
return result;
@@ -88,12 +86,11 @@ public abstract class RelaunchSelectedAction extends Action {
/**
* Sets actual testing session.
- *
+ *
* @param testingSession testing session
*/
public void setTestingSession(ITestingSession testingSession) {
this.testingSession = testingSession;
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunAction.java
index e249a700196..5f84536c967 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.model.TestingSessionsManager;
import org.eclipse.cdt.testsrunner.model.ITestingSession;
@@ -28,7 +27,6 @@ public class RerunAction extends Action {
private TestingSessionsManager testingSessionsManager;
-
public RerunAction(TestingSessionsManager testingSessionsManager) {
super(ActionsMessages.RerunAction_text);
setToolTipText(ActionsMessages.RerunAction_tooltip);
@@ -48,6 +46,5 @@ public class RerunAction extends Action {
setEnabled(false);
}
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunSelectedAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunSelectedAction.java
index 33981b3ca17..fc9a0933edb 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunSelectedAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/RerunSelectedAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.model.ITestingSession;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jface.viewers.TreeViewer;
@@ -34,6 +33,5 @@ public class RerunSelectedAction extends RelaunchSelectedAction {
protected String getLaunchMode() {
return ILaunchManager.RUN_MODE;
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ScrollLockAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ScrollLockAction.java
index 33400fb07e3..58efabfac58 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ScrollLockAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ScrollLockAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.UIUpdater;
import org.eclipse.jface.action.Action;
@@ -25,7 +24,6 @@ public class ScrollLockAction extends Action {
private UIUpdater modelSyncronizer;
-
public ScrollLockAction(UIUpdater modelSyncronizer) {
super(ActionsMessages.ScrollLockAction_name);
this.modelSyncronizer = modelSyncronizer;
@@ -41,4 +39,3 @@ public class ScrollLockAction extends Action {
modelSyncronizer.setAutoScroll(!isChecked());
}
}
-
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFailedOnlyAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFailedOnlyAction.java
index d8ca0d713bc..274295b4ca1 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFailedOnlyAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFailedOnlyAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.ResultsPanel;
import org.eclipse.jface.action.Action;
@@ -25,7 +24,6 @@ public class ShowFailedOnlyAction extends Action {
private ResultsPanel resultsPanel;
-
public ShowFailedOnlyAction(ResultsPanel resultsPanel) {
super("", AS_CHECK_BOX); //$NON-NLS-1$
this.resultsPanel = resultsPanel;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFileNameOnlyAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFileNameOnlyAction.java
index 527d2f2d4d8..9c151533e16 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFileNameOnlyAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowFileNameOnlyAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.ui.view.MessagesViewer;
import org.eclipse.jface.action.Action;
@@ -25,9 +24,8 @@ public class ShowFileNameOnlyAction extends Action {
private MessagesViewer messagesViewer;
-
public ShowFileNameOnlyAction(MessagesViewer messagesViewer) {
- super(ActionsMessages.ShowFileNameOnlyAction_text, AS_CHECK_BOX);
+ super(ActionsMessages.ShowFileNameOnlyAction_text, AS_CHECK_BOX);
this.messagesViewer = messagesViewer;
setToolTipText(ActionsMessages.ShowFileNameOnlyAction_tooltip);
setChecked(messagesViewer.getShowFileNameOnly());
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowNextFailureAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowNextFailureAction.java
index 701412657eb..48a5dbf4078 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowNextFailureAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowNextFailureAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.TestsHierarchyViewer;
import org.eclipse.jface.action.Action;
@@ -40,4 +39,3 @@ public class ShowNextFailureAction extends Action {
testsHierarchyViewer.showNextFailure();
}
}
-
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowPreviousFailureAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowPreviousFailureAction.java
index f12f850a0f4..f1d2223614e 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowPreviousFailureAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowPreviousFailureAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.TestsHierarchyViewer;
import org.eclipse.jface.action.Action;
@@ -40,4 +39,3 @@ public class ShowPreviousFailureAction extends Action {
testsHierarchyViewer.showPreviousFailure();
}
}
-
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTestsInHierarchyAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTestsInHierarchyAction.java
index dc95f4773a8..53d85157408 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTestsInHierarchyAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTestsInHierarchyAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.TestsHierarchyViewer;
import org.eclipse.jface.action.Action;
@@ -26,7 +25,6 @@ public class ShowTestsInHierarchyAction extends Action {
private TestsHierarchyViewer testsHierarchyViewer;
-
public ShowTestsInHierarchyAction(TestsHierarchyViewer testsHierarchyViewer) {
super(ActionsMessages.ShowTestsInHierarchyAction_text, AS_CHECK_BOX);
this.testsHierarchyViewer = testsHierarchyViewer;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTimeAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTimeAction.java
index 9e8dfa88d83..9ad68506cd7 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTimeAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ShowTimeAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.ui.view.TestsHierarchyViewer;
import org.eclipse.jface.action.Action;
@@ -24,7 +23,6 @@ public class ShowTimeAction extends Action {
private TestsHierarchyViewer testsHierarchyViewer;
-
public ShowTimeAction(TestsHierarchyViewer testsHierarchyViewer) {
super(ActionsMessages.ShowTimeAction_text, AS_CHECK_BOX);
this.testsHierarchyViewer = testsHierarchyViewer;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/StopAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/StopAction.java
index 37e03e7709e..c4aab1799d2 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/StopAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/StopAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.model.TestingSessionsManager;
import org.eclipse.cdt.testsrunner.model.ITestingSession;
@@ -26,7 +25,6 @@ public class StopAction extends Action {
private TestingSessionsManager testingSessionsManager;
-
public StopAction(TestingSessionsManager testingSessionsManager) {
super(ActionsMessages.StopAction_text);
setToolTipText(ActionsMessages.StopAction_tooltip);
@@ -44,6 +42,5 @@ public class StopAction extends Action {
}
setEnabled(false);
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyCollapseAllAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyCollapseAllAction.java
index d4f32c4eb45..71c6330174c 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyCollapseAllAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyCollapseAllAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.AbstractTreeViewer;
@@ -24,7 +23,6 @@ public class TestsHierarchyCollapseAllAction extends Action {
private AbstractTreeViewer testsHierarchyTreeViewer;
-
public TestsHierarchyCollapseAllAction(AbstractTreeViewer testsHierarchyTreeViewer) {
setText(ActionsMessages.TestsHierarchyCollapseAllAction_text);
setToolTipText(ActionsMessages.TestsHierarchyCollapseAllAction_tooltip);
@@ -32,9 +30,8 @@ public class TestsHierarchyCollapseAllAction extends Action {
}
@Override
- public void run(){
+ public void run() {
testsHierarchyTreeViewer.collapseAll();
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyExpandAllAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyExpandAllAction.java
index dae685daf21..d53740a152f 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyExpandAllAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/TestsHierarchyExpandAllAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.AbstractTreeViewer;
@@ -24,7 +23,6 @@ public class TestsHierarchyExpandAllAction extends Action {
private AbstractTreeViewer testsHierarchyTreeViewer;
-
public TestsHierarchyExpandAllAction(AbstractTreeViewer testsHierarchyTreeViewer) {
setText(ActionsMessages.TestsHierarchyExpandAllAction_text);
setToolTipText(ActionsMessages.TestsHierarchyExpandAllAction_tooltip);
@@ -32,9 +30,8 @@ public class TestsHierarchyExpandAllAction extends Action {
}
@Override
- public void run(){
+ public void run() {
testsHierarchyTreeViewer.expandAll();
}
-
-}
+}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ToggleOrientationAction.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ToggleOrientationAction.java
index 4b2177c4ea5..d6b951aaf86 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ToggleOrientationAction.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/internal/ui/view/actions/ToggleOrientationAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.ui.view.actions;
-
import org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin;
import org.eclipse.cdt.testsrunner.internal.ui.view.ResultsView;
import org.eclipse.jface.action.Action;
@@ -26,7 +25,6 @@ public class ToggleOrientationAction extends Action {
private ResultsView resultsView;
private ResultsView.Orientation orientation;
-
public ToggleOrientationAction(ResultsView resultsView, ResultsView.Orientation orientation) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
this.resultsView = resultsView;
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java
index 4c7a983564f..efd2be596be 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/BaseTestsLaunchDelegate.java
@@ -51,58 +51,60 @@ import org.eclipse.ui.PartInitException;
* factory (to handle testing process IO streams).
*/
public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegate {
-
+
/** Stores the changes made to the launch configuration. */
private Map<String, String> changesToLaunchConfiguration = new HashMap<String, String>();
+ @Override
+ public ILaunch getLaunch(ILaunchConfiguration config, String mode) throws CoreException {
+ return getPreferredDelegate(config, mode).getLaunch(config, mode);
+ }
+
+ @Override
+ public boolean buildForLaunch(ILaunchConfiguration config, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ return getPreferredDelegate(config, mode).buildForLaunch(config, mode, monitor);
+ }
+
+ @Override
+ public boolean finalLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ return getPreferredDelegate(config, mode).finalLaunchCheck(config, mode, monitor);
+ }
@Override
- public ILaunch getLaunch(ILaunchConfiguration config, String mode) throws CoreException {
- return getPreferredDelegate(config, mode).getLaunch(config, mode);
- }
-
- @Override
- public boolean buildForLaunch(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException {
- return getPreferredDelegate(config, mode).buildForLaunch(config, mode, monitor);
- }
-
- @Override
- public boolean finalLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException {
- return getPreferredDelegate(config, mode).finalLaunchCheck(config, mode, monitor);
- }
-
- @Override
- public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor) throws CoreException {
- return getPreferredDelegate(config, mode).preLaunchCheck(config, mode, monitor);
+ public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ return getPreferredDelegate(config, mode).preLaunchCheck(config, mode, monitor);
}
-
+
@Override
- public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
-
+ public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+
if (mode.equals(ILaunchManager.RUN_MODE) || mode.equals(ILaunchManager.DEBUG_MODE)) {
- // NOTE: The modified working copy of launch configuration cannot be passed directly
+ // NOTE: The modified working copy of launch configuration cannot be passed directly
// to the preferred delegate because in this case the LaunchHistory will not work
// properly (and the rerun last launched configuration action will fail). So we
// just modify the existing configuration and revert all the changes back after
// the launch is done.
-
+
try {
- // Changes launch configuration a bit and redirect it to the preferred C/C++ Application Launch delegate
+ // Changes launch configuration a bit and redirect it to the preferred C/C++ Application Launch delegate
updatedLaunchConfiguration(config);
getPreferredDelegate(config, mode).launch(config, mode, launch, monitor);
- }
- finally {
+ } finally {
revertChangedToLaunchConfiguration(config);
}
activateTestingView();
}
}
-
+
/**
* Revert the changes to launch configuration previously made with
* <code>updatedLaunchConfigurationAttribute()</code>.
- *
+ *
* @param config launch configuration to revert
*/
private void revertChangedToLaunchConfiguration(ILaunchConfiguration config) throws CoreException {
@@ -113,25 +115,26 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
configWC.doSave();
changesToLaunchConfiguration.clear();
}
-
+
/**
* Saves the current value of the specified attribute (to be reverted later)
* and update its value in launch configuration.
- *
+ *
* @param config launch configuration which attribute should be updated
* @param attributeName attribute name
* @param value new value of the specified attribute
*/
- private void updatedLaunchConfigurationAttribute(ILaunchConfigurationWorkingCopy config, String attributeName, String value) throws CoreException {
+ private void updatedLaunchConfigurationAttribute(ILaunchConfigurationWorkingCopy config, String attributeName,
+ String value) throws CoreException {
changesToLaunchConfiguration.put(attributeName, config.getAttribute(attributeName, "")); //$NON-NLS-1$
config.setAttribute(attributeName, value);
}
-
+
/**
* Makes the necessary changes to the launch configuration before passing it
* to the underlying delegate. Currently, updates the program arguments with
* the value that was obtained from Tests Runner provider plug-in.
- *
+ *
* @param config launch configuration
*/
private void updatedLaunchConfiguration(ILaunchConfiguration config) throws CoreException {
@@ -140,29 +143,27 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
setProgramArguments(configWC);
configWC.doSave();
}
-
+
/**
* Updates the program arguments with the value that was obtained from Tests
* Runner provider plug-in.
- *
+ *
* @param config launch configuration
*/
private void setProgramArguments(ILaunchConfigurationWorkingCopy config) throws CoreException {
- List<?> packedTestsFilter = config.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_FILTER, Collections.EMPTY_LIST);
- String [][] testsFilter = TestPathUtils.unpackTestPaths(packedTestsFilter.toArray(new String[packedTestsFilter.size()]));
+ List<?> packedTestsFilter = config.getAttribute(ITestsLaunchConfigurationConstants.ATTR_TESTS_FILTER,
+ Collections.EMPTY_LIST);
+ String[][] testsFilter = TestPathUtils
+ .unpackTestPaths(packedTestsFilter.toArray(new String[packedTestsFilter.size()]));
- // Configure test module run parameters with a Tests Runner
+ // Configure test module run parameters with a Tests Runner
String[] params = null;
try {
params = getTestsRunner(config).getAdditionalLaunchParameters(testsFilter);
-
+
} catch (TestingException e) {
throw new CoreException(
- new Status(
- IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(),
- e.getLocalizedMessage(), null
- )
- );
+ new Status(IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(), e.getLocalizedMessage(), null));
}
// Rewrite ATTR_PROGRAM_ARGUMENTS attribute of launch configuration
@@ -173,34 +174,28 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
sb.append(' ');
sb.append(param);
}
- updatedLaunchConfigurationAttribute(config, ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, sb.toString());
+ updatedLaunchConfigurationAttribute(config, ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
+ sb.toString());
}
}
-
+
/**
* Resolves Tests Runner provider plug-in interface by the value written in
* launch configuration.
- *
+ *
* @param config launch configuration
*/
private ITestsRunnerProvider getTestsRunner(ILaunchConfiguration config) throws CoreException {
- TestsRunnerProviderInfo testsRunnerProviderInfo = TestsRunnerPlugin.getDefault().getTestsRunnerProvidersManager().getTestsRunnerProviderInfo(config);
+ TestsRunnerProviderInfo testsRunnerProviderInfo = TestsRunnerPlugin.getDefault()
+ .getTestsRunnerProvidersManager().getTestsRunnerProviderInfo(config);
if (testsRunnerProviderInfo == null) {
- throw new CoreException(
- new Status(
- IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(),
- LauncherMessages.BaseTestsLaunchDelegate_invalid_tests_runner, null
- )
- );
+ throw new CoreException(new Status(IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(),
+ LauncherMessages.BaseTestsLaunchDelegate_invalid_tests_runner, null));
}
ITestsRunnerProvider testsRunnerProvider = testsRunnerProviderInfo.instantiateTestsRunnerProvider();
if (testsRunnerProvider == null) {
- throw new CoreException(
- new Status(
- IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(),
- LauncherMessages.BaseTestsLaunchDelegate_tests_runner_load_failed, null
- )
- );
+ throw new CoreException(new Status(IStatus.ERROR, TestsRunnerPlugin.getUniqueIdentifier(),
+ LauncherMessages.BaseTestsLaunchDelegate_tests_runner_load_failed, null));
}
return testsRunnerProvider;
}
@@ -209,34 +204,35 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
* Resolves the preferred launch delegate for the specified configuration to
* launch C/C++ Local Application in the specified mode. The preferred
* launch delegate ID is taken from <code>getPreferredDelegateId()</code>.
- *
+ *
* @param config launch configuration
* @param mode mode
* @return launch delegate
*/
- private ILaunchConfigurationDelegate2 getPreferredDelegate(ILaunchConfiguration config, String mode) throws CoreException {
- ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType localCfg =
- launchMgr.getLaunchConfigurationType(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP);
- Set<String> modes = config.getModes();
- modes.add(mode);
- String preferredDelegateId = getPreferredDelegateId();
+ private ILaunchConfigurationDelegate2 getPreferredDelegate(ILaunchConfiguration config, String mode)
+ throws CoreException {
+ ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType localCfg = launchMgr
+ .getLaunchConfigurationType(ICDTLaunchConfigurationConstants.ID_LAUNCH_C_APP);
+ Set<String> modes = config.getModes();
+ modes.add(mode);
+ String preferredDelegateId = getPreferredDelegateId();
for (ILaunchDelegate delegate : localCfg.getDelegates(modes)) {
if (preferredDelegateId.equals(delegate.getId())) {
return (ILaunchConfigurationDelegate2) delegate.getDelegate();
}
}
return null;
- }
+ }
/**
* Returns the launch delegate id which should be used to redirect the
* launch.
- *
+ *
* @return launch delegate ID
*/
- public abstract String getPreferredDelegateId();
-
+ public abstract String getPreferredDelegateId();
+
/**
* Activates the view showing testing results.
*/
@@ -245,9 +241,12 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
@Override
public void run() {
try {
- IWorkbenchWindow activeWindow = TestsRunnerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- IViewPart view = activeWindow.getActivePage().showView(ITestsRunnerConstants.TESTS_RUNNER_RESULTS_VIEW_ID);
- TestsRunnerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(view);
+ IWorkbenchWindow activeWindow = TestsRunnerPlugin.getDefault().getWorkbench()
+ .getActiveWorkbenchWindow();
+ IViewPart view = activeWindow.getActivePage()
+ .showView(ITestsRunnerConstants.TESTS_RUNNER_RESULTS_VIEW_ID);
+ TestsRunnerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+ .activate(view);
} catch (PartInitException e) {
TestsRunnerPlugin.log(e);
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerConstants.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerConstants.java
index ff84aee4e29..66b28c6121c 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerConstants.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Anton Gorenkov
+ * Copyright (c) 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -30,14 +30,14 @@ public interface ITestsRunnerConstants {
* Specifies the default launch delegate for a Tests Run session.
*/
public static final String PREFERRED_RUN_TESTS_LAUNCH_DELEGATE = "org.eclipse.cdt.testsrunner.launch.runTests"; //$NON-NLS-1$
-
- /**
+
+ /**
* Specifies the default launch delegate for a Tests Debug session.
*/
- public static final String PREFERRED_DEBUG_TESTS_LAUNCH_DELEGATE = "org.eclipse.cdt.testsrunner.launch.dsf.runTests"; //$NON-NLS-1$
+ public static final String PREFERRED_DEBUG_TESTS_LAUNCH_DELEGATE = "org.eclipse.cdt.testsrunner.launch.dsf.runTests"; //$NON-NLS-1$
- /**
+ /**
* Specifies the ID of the Tests Runner main view for browsing results.
*/
- public static final String TESTS_RUNNER_RESULTS_VIEW_ID = "org.eclipse.cdt.testsrunner.resultsview"; //$NON-NLS-1$
+ public static final String TESTS_RUNNER_RESULTS_VIEW_ID = "org.eclipse.cdt.testsrunner.resultsview"; //$NON-NLS-1$
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProvider.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProvider.java
index a48d6374518..e11164f4433 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProvider.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -18,10 +18,9 @@ import java.io.InputStream;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.TestingException;
-
/**
* The interface for a Tests Runner provider plug-in.
- *
+ *
* <p>
* Clients may implement this interface.
* </p>
@@ -35,7 +34,7 @@ public interface ITestsRunnerProvider {
* <code>null</code>, it contains the paths to the test suites and test
* cases that should be run during the testing process, so the proper
* filters should be generated too.
- *
+ *
* @param testPaths the array of test paths
* @return parameters list
* @throws TestingException if test parameters cannot be generated
@@ -46,12 +45,12 @@ public interface ITestsRunnerProvider {
* Starts the processing of testing results by Tests Runner Plug-in. The
* input data are provided via the stream. They should be converted to the
* commands for the Model Updater.
- *
+ *
* @param modelUpdater model updater instance
* @param inputStream test model output or error data stream
* @throws TestingException if there are errors during the testing process
* or in data stream
*/
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException;
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProviderInfo.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProviderInfo.java
index 5ccdc9b8b84..7b533556038 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProviderInfo.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/launcher/ITestsRunnerProviderInfo.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,12 +16,12 @@ package org.eclipse.cdt.testsrunner.launcher;
/**
* Describes the Tests Runner input provider plug-in, its requirements and
* features provided.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITestsRunnerProviderInfo {
-
+
/**
* Returns the user readable name of the Tests Runner provider plug-in.
*
@@ -47,25 +47,25 @@ public interface ITestsRunnerProviderInfo {
* Returns whether Tests Runner provider plug-in allows to add a filter for
* running a few custom test cases or test suites at a time (e.g. Google
* Test and Qt Test allow it, but Boost.Test doesn't).
- *
+ *
* @return whether multiple filter is supported
*/
public boolean isAllowedMultipleTestFilter();
-
+
/**
* Returns whether Tests Runner provider plug-in requires to handle standard
* output stream of the testing process.
- *
+ *
* @return whether output stream is required
*/
public boolean isOutputStreamRequired();
-
+
/**
* Returns whether Tests Runner provider plug-in requires to handle standard
* error stream of the testing process.
- *
+ *
* @return whether error stream is required
*/
public boolean isErrorStreamRequired();
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/IModelVisitor.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/IModelVisitor.java
index b17f820cc0d..0d9f6495965 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/IModelVisitor.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/IModelVisitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,22 +15,22 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Interface to the visitor through the test model.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IModelVisitor {
public void visit(ITestSuite testSuite);
-
+
public void leave(ITestSuite testSuite);
-
+
public void visit(ITestCase testCase);
-
+
public void leave(ITestCase testCase);
-
+
public void visit(ITestMessage testMessage);
-
+
public void leave(ITestMessage testMessage);
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestCase.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestCase.java
index a88aed809a7..50ccee0b0d2 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestCase.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,10 +15,10 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Interface to the test case (test) of the test hierarchy.
- *
+ *
* Test cases stores the name, status, testing time and messages.
* Also has the reference to the parent test suite (if any).
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -26,7 +26,7 @@ public interface ITestCase extends ITestItem {
/**
* Returns test messages that were produced during the test case running.
- *
+ *
* @return array of test messages
*/
public ITestMessage[] getTestMessages();
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestItem.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestItem.java
index f420f1c8330..ad6dbe442de 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestItem.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestItem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Base interface to the structural item of test hierarchy (test suite or test
* case).
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -24,32 +24,28 @@ public interface ITestItem {
/**
* Represents status of the test item.
- *
+ *
* @note Order of values is significant (cause enumeration values comparison
* is necessary)
*/
public enum Status {
- NotRun,
- Skipped,
- Passed,
- Failed,
- Aborted;
+ NotRun, Skipped, Passed, Failed, Aborted;
public boolean isError() {
return (this == Failed) || (this == Aborted);
}
}
-
+
/**
* @return name of the test item.
*/
public String getName();
-
+
/**
* Returns status of the test item.
* For test case it is its own status.
* For test suite it is the greatest status of all its children.
- *
+ *
* @return test item status
*/
public Status getStatus();
@@ -58,23 +54,23 @@ public interface ITestItem {
* Returns execution time (in milliseconds) of the test item.
* For test case it is its own execution time.
* For test suite it is the sum of execution time of all its children.
- *
+ *
* @return item execution time (in milliseconds)
*/
public int getTestingTime();
/**
- * Returns parent of the current test item or null if not available
+ * Returns parent of the current test item or null if not available
* (e.g. it is a root test suite).
- *
+ *
* @return parent or null
*/
public ITestSuite getParent();
-
+
/**
* Returns <code>true</code> if test item has children.
* Always returns <code>false</code> for test cases.
- *
+ *
* @return true if has children
*/
public boolean hasChildren();
@@ -83,14 +79,14 @@ public interface ITestItem {
* Returns all the children of the test item.
* For test case always returns empty array.
* For test suite returns all child test suites and test cases.
- *
+ *
* @return array of test item children
*/
public ITestItem[] getChildren();
-
+
/**
* Visitor pattern support for the tests hierarchy.
- *
+ *
* @param visitor - any object that supports visitor interface
*/
public void visit(IModelVisitor visitor);
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestLocation.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestLocation.java
index bcb60a1edd3..919badc3be0 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestLocation.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestLocation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Describes the location of the test object.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -23,14 +23,14 @@ public interface ITestLocation {
/**
* Returns the file name in which testing object is located.
- *
+ *
* @return file name
*/
public String getFile();
/**
* Returns the line number on which testing object is located.
- *
+ *
* @return line number
*/
public int getLine();
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestMessage.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestMessage.java
index ba0cdd8d9cf..e236ea17bbc 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestMessage.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestMessage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Describes the message that was produced during the testing process.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -25,49 +25,46 @@ public interface ITestMessage {
* The level of the test message.
*/
public enum Level {
- Info(ModelMessages.MessageLevel_info),
- Message(ModelMessages.MessageLevel_message),
- Warning(ModelMessages.MessageLevel_warning),
- Error(ModelMessages.MessageLevel_error),
- FatalError(ModelMessages.MessageLevel_fatal_error),
- Exception(ModelMessages.MessageLevel_exception);
-
+ Info(ModelMessages.MessageLevel_info), Message(ModelMessages.MessageLevel_message),
+ Warning(ModelMessages.MessageLevel_warning), Error(ModelMessages.MessageLevel_error),
+ FatalError(ModelMessages.MessageLevel_fatal_error), Exception(ModelMessages.MessageLevel_exception);
+
String stringRepr;
-
+
Level(String stringRepr) {
this.stringRepr = stringRepr;
}
-
+
@Override
public String toString() {
return stringRepr;
}
}
-
+
/**
* Returns the location of the test message.
- *
+ *
* @return message location
*/
public ITestLocation getLocation();
/**
* Returns the level of the test message.
- *
+ *
* @return message level
*/
public Level getLevel();
/**
* Returns the text of the test message.
- *
+ *
* @return message text
*/
public String getText();
/**
* Visitor pattern support for the tests hierarchy.
- *
+ *
* @param visitor - any object that supports visitor interface
*/
public void visit(IModelVisitor visitor);
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelAccessor.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelAccessor.java
index 7668b45dc04..387b32b1ffd 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelAccessor.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelAccessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Provides an access to the tests model.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -23,19 +23,19 @@ public interface ITestModelAccessor {
/**
* Checks whether the specified testing item (case or suite) is running now.
- *
+ *
* @param item the interested item
* @return whether the item is running now
*/
public boolean isCurrentlyRunning(ITestItem item);
-
+
/**
* Provides access to the root test suite.
*
* @return root test suite
*/
public ITestSuite getRootSuite();
-
+
/**
* Adds the given listener to this registered listeners collection.
* Has no effect if an identical listener is already registered.
@@ -51,5 +51,5 @@ public interface ITestModelAccessor {
* @param listener the listener to remove
*/
public void removeChangesListener(ITestingSessionListener listener);
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelUpdater.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelUpdater.java
index ad267563bce..063434feeef 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelUpdater.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestModelUpdater.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,7 +16,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* The interface to easily build or update testing model.
* It is intended to use from the Tests Runner provider plug-in.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -24,74 +24,73 @@ public interface ITestModelUpdater {
/**
* Specifies that a new test suite has been started.
- *
+ *
* @param name the name of the started test suite
*/
public void enterTestSuite(String name);
-
+
/**
* Specifies that the last test suite has been finished.
* Automatically exists from the currently running test case (if any).
*/
public void exitTestSuite();
-
+
/**
* Specifies that a new test case has been started.
- *
+ *
* @param name the name of the started test case
*/
public void enterTestCase(String name);
-
+
/**
* Sets the status of the currently running test case.
* The exception is thrown if no test case is running.
- *
+ *
* @param status new test status
*/
public void setTestStatus(ITestItem.Status status);
-
+
/**
* Sets the execution time of the currently running test case.
* If the execution time has already been set, it will be overridden.
* The exception is thrown if no test case is running.
- *
+ *
* @param testingTime test execution time
*/
public void setTestingTime(int testingTime);
-
+
/**
* Specifies that the currently running test case has been finished.
- * The test execution time is set if Tests Runner provider plug-in
+ * The test execution time is set if Tests Runner provider plug-in
* requires time measurement.
*/
public void exitTestCase();
-
+
/**
* Add a new testing message connected to the currently running test case.
- *
+ *
* @param file message file name
* @param line message line number
* @param level message level
* @param text message text
- *
+ *
* @note If file name is <code>null</code> or empty or if line number is
* negative or 0 then message location will not be set.
*/
public void addTestMessage(String file, int line, ITestMessage.Level level, String text);
-
-
+
/**
* Access the top most currently running test suite object.
- *
+ *
* @return top most test suite
*/
public ITestSuite currentTestSuite();
-
+
/**
* Access the currently running test case object.
- *
+ *
* @return top most test case
*/
public ITestCase currentTestCase();
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestSuite.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestSuite.java
index 44c74787ef8..7918ae97a75 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestSuite.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -17,7 +17,7 @@ package org.eclipse.cdt.testsrunner.model;
* Interface to the test suite of the tests hierarchy.
* Test suites group the test cases and the other test suites.
* They also provides group operations (e.g. status or execution time access).
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSession.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSession.java
index b821c00c21c..8b7069c6e77 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSession.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSession.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -16,10 +16,9 @@ package org.eclipse.cdt.testsrunner.model;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProviderInfo;
import org.eclipse.debug.core.ILaunch;
-
/**
* Stores the information about tests running.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -34,24 +33,24 @@ public interface ITestingSession {
/**
* Returns the total tests count (if available).
- *
+ *
* @note Usually testing frameworks do not provide the information about
* total tests count (at least Boost.Test, Google Test and Qt Test do not).
* So the total tests count from previous launch of the same test module is
* used instead. That is why, it is unavailable for the first run and it may
* be not accurate. When testing is finished the total tests count is
* updated to the accurate value.
- *
+ *
* @return total tests count or -1 if unavailable
*/
public int getTotalCounter();
-
+
/**
* Returns the count tests with the specified status at the moment.
- *
+ *
* @note Tests count with the specified status may change if testing session
* is not terminated.
- *
+ *
* @param status the required status
* @return tests count with status 'status'
*/
@@ -62,21 +61,21 @@ public interface ITestingSession {
* Testing session may contain errors if one of its tests failed or if there
* were some errors during tests running (e.g. test module cannot be
* launched or output parsing failed).
- *
+ *
* @return whether the testing session contains errors
*/
public boolean hasErrors();
/**
* Returns whether the testing session was stopped by user.
- *
+ *
* @note Testing session is not considered as stopped when it was terminated
* by the <code>ILaunch.terminate()</code> method (e.g. when user clicks on
* 'Stop' button of the 'Console' or 'Debug' view). In this case it will be
* considered as finished (probably, with errors cause not all output was
* obtained from launched process). To stop testing session properly the
* <code>stop()</code> method should be used.
- *
+ *
* @return whether the testing session was stopped
*/
public boolean wasStopped();
@@ -84,29 +83,29 @@ public interface ITestingSession {
/**
* Returns whether the testing session has been finished (with or without
* errors).
- *
+ *
* @return whether the testing session has been finished
*/
public boolean isFinished();
-
+
/**
* Returns the testing model accessor that is associated with this session.
- *
+ *
* @return testing model accessor
*/
public ITestModelAccessor getModelAccessor();
/**
* Returns the launch that is associated with this testing session.
- *
+ *
* @return launch
*/
public ILaunch getLaunch();
-
+
/**
* Returns the information about the tests runner which was used to launch
* this testing session.
- *
+ *
* @return tests runner information
*/
public ITestsRunnerProviderInfo getTestsRunnerProviderInfo();
@@ -114,7 +113,7 @@ public interface ITestingSession {
/**
* Returns the current status message for the current testing session. It
* may contain error, some session information or simple statistics.
- *
+ *
* @return text status of the testing session
*/
public String getStatusMessage();
@@ -122,7 +121,7 @@ public interface ITestingSession {
/**
* Returns the name of the current testing session. Usually it contains
* launch configuration name with some additional information.
- *
+ *
* @return testing session name
*/
public String getName();
@@ -133,6 +132,5 @@ public interface ITestingSession {
* cannot been terminated.
*/
public void stop();
-
+
}
-
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSessionListener.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSessionListener.java
index a70cc9e20fb..153fa448e69 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSessionListener.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/ITestingSessionListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -15,7 +15,7 @@ package org.eclipse.cdt.testsrunner.model;
/**
* Testing session listener is notified of testing process going.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -27,21 +27,21 @@ public interface ITestingSessionListener {
* @param testSuite the started test suite
*/
public void enterTestSuite(ITestSuite testSuite);
-
+
/**
* Notifies the listener that the test suite running is finished.
*
* @param testSuite the finished test suite
*/
public void exitTestSuite(ITestSuite testSuite);
-
+
/**
* Notifies the listener that the new test case running is started.
*
* @param testCase the started test case
*/
public void enterTestCase(ITestCase testCase);
-
+
/**
* Notifies the listener that the test case running is finished.
*
@@ -51,11 +51,11 @@ public interface ITestingSessionListener {
/**
* Notifies the listener that the children of the test suite were updated.
- *
+ *
* @param testSuite the test suite which require children update
*/
public void childrenUpdate(ITestSuite testSuite);
-
+
/**
* Notifies the listener that the testing process is started.
*/
@@ -65,5 +65,5 @@ public interface ITestingSessionListener {
* Notifies the listener that the testing process is finished.
*/
public void testingFinished();
-
+
}
diff --git a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/TestingException.java b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/TestingException.java
index 742a7f0bebc..4a499b400cd 100644
--- a/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/TestingException.java
+++ b/testsrunner/org.eclipse.cdt.testsrunner/src/org/eclipse/cdt/testsrunner/model/TestingException.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Anton Gorenkov
+ * Copyright (c) 2011, 2012 Anton Gorenkov
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,19 +13,18 @@
*******************************************************************************/
package org.eclipse.cdt.testsrunner.model;
-
/**
* Represents a failure in the Tests Runner operations.
*/
public class TestingException extends Exception {
- /**
- * Constructs an exception with the given descriptive message.
- *
- * @param msg Description of the occurred exception.
- */
- public TestingException(String msg) {
- super(msg);
- }
+ /**
+ * Constructs an exception with the given descriptive message.
+ *
+ * @param msg Description of the occurred exception.
+ */
+ public TestingException(String msg) {
+ super(msg);
+ }
}

Back to the top