Commit cba88fbe authored by Kristof Szabados's avatar Kristof Szabados
Browse files

pre-release style improvement: remove trailing whitespaces


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent a364454e
......@@ -13,7 +13,7 @@ import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle.
*
*
* @author Kristof Szabados
*/
public final class Activator extends AbstractUIPlugin {
......@@ -38,7 +38,7 @@ public final class Activator extends AbstractUIPlugin {
/**
* Sets the default singleton instance of this plug-in,
* that later can be used to access plug-in specific preference settings.
*
*
* @param activator the single instance of this plug-in class.
* */
private static void setDefault(final Activator activator) {
......
......@@ -9,7 +9,7 @@ package org.eclipse.titan.executor;
/**
* Contains the data describing a Host Controller.
*
*
* @author Kristof Szabados
* */
public final class HostController implements Cloneable {
......
......@@ -14,7 +14,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore;
* This class stores constants and functions that make it possible for the executor plug-in the reach some settings from the Designer plug-in.
* <p>
* It is important to note that it is a valid case when the designer plug-in is not installed together with the executor plug-in.
*
*
* @author Kristof Szabados
* */
public final class DesignerHelper {
......
......@@ -23,7 +23,7 @@ import java.util.Map;
/**
* This class has utility functions to help handling environmental variables.
*
*
* @author Kristof Szabados
* */
public final class EnvironmentHelper {
......@@ -66,7 +66,7 @@ public final class EnvironmentHelper {
* @return the original hashmap of environment variables that were updated.
* */
public static Map<String, String> resolveVariables(final Map<String, String> originalVariables,
final Map<String, String> additionalVariables) throws CoreException {
final Map<String, String> additionalVariables) throws CoreException {
final IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
for (Map.Entry<String, String> variable : additionalVariables.entrySet()) {
if (null != variable.getValue()) {
......
......@@ -98,15 +98,15 @@ import static org.eclipse.titan.executor.properties.FieldEditorPropertyPage.getO
* This is a base class to build the Executors on.
* <p>
* It tries to hide all of the launchConfiguration handling and HC starting issues from the specific Executors
*
*
* @author Kristof Szabados
* @author Arpad Lovassy
*/
public abstract class BaseExecutor {
//TODO: implement
protected static final boolean CREATE_TEMP_CFG = false;
public static final String PADDEDDATETIMEFORMAT = "%1$tF %1$tH:%1$tM:%1$tS.%1$tL000";
public static final String DATETIMEFORMAT = "%1$tF %1$tH:%1$tM:%1$tS.%2$06d";
......@@ -168,7 +168,7 @@ public abstract class BaseExecutor {
* @author Arpad Lovassy
*/
protected class EmptyExecutionRunnable implements Runnable {
public EmptyExecutionRunnable() {}
@Override
......@@ -176,7 +176,7 @@ public abstract class BaseExecutor {
MessageDialog.openError( new Shell( Display.getDefault() ), EMPTY_EXECUTION_FAILED_TITLE, EMPTY_EXECUTION_FAILED_TEXT );
}
}
/**
* Initializes the Executor with data extracted from the provided launch configuration.
*
......@@ -230,7 +230,7 @@ public abstract class BaseExecutor {
lastTimeSelectionTime = configuration.getAttribute("lastTimeSelectionTime", 1);
int tempLastSelectionType = configuration.getAttribute("lastTimeSelectionType", 0);
lastTimeSelectionType = ExecutableType.getExecutableType(tempLastSelectionType);
List<String> hostNames = configuration.getAttribute(HOSTNAMES, (ArrayList<String>) null);
List<String> hostWorkingDirectories = configuration.getAttribute(HOSTWORKINGDIRECTORIES, (ArrayList<String>) null);
List<String> hostExecutables = configuration.getAttribute(HOSTEXECUTABLES, (ArrayList<String>) null);
......@@ -266,7 +266,7 @@ public abstract class BaseExecutor {
availableTestcases.add(testcase);
}
}
}
}
}
......@@ -485,7 +485,7 @@ public abstract class BaseExecutor {
public final void startHostControllers() {
if (hostControllers == null || hostControllers.isEmpty()) {
addNotification(new Notification((new Formatter()).format(PADDEDDATETIMEFORMAT, new Date()).toString(), "", "",
NO_HOSTCONTROLLER_SPECIFIED));
NO_HOSTCONTROLLER_SPECIFIED));
return;
}
ProcessBuilder pb = new ProcessBuilder();
......@@ -598,9 +598,9 @@ public abstract class BaseExecutor {
public MenuManager createMenu(final MenuManager manager) {
return manager;
}
protected abstract String getDefaultLogFileName();
/**
* @return the relative directory path of the default log file from the preferences
*/
......@@ -615,13 +615,13 @@ public abstract class BaseExecutor {
PreferenceConstants.EXECUTOR_PREFERENCE_PAGE_ID, PreferenceConstants.LOG_FOLDER_PATH_NAME);
}
return null;
*/
*/
// log files are created in the bin (actual) directory
// until temporary cfg file creation is fixed:
// - ../log/MyExample-%n.log file is set as LogFile if it's not provided by the input cfg file
return ".";
}
/**
* @return the relative path of the log dir (from the cfg file, or the default from the preferences)
*/
......@@ -631,10 +631,10 @@ public abstract class BaseExecutor {
String parent = file.getParent();
return parent != null ? parent : "";
}
return this.getDefaultLogFileDir();
}
/**
* Creates the content of the configuration file
* @return the generated cfg string
......@@ -652,7 +652,7 @@ public abstract class BaseExecutor {
}
return builder.toString();
}
/**
* Reads the configuration file producing a configuration file handler.
*
......@@ -662,7 +662,7 @@ public abstract class BaseExecutor {
if (isNullOrEmpty(configFilePath)) {
return null;
}
final ConfigFileHandler configHandler = new ConfigFileHandler();
configHandler.readFromFile(configFilePath);
Map<String, String> env = appendEnvironmentalVariables ? new HashMap<String, String>( System.getenv() ) : new HashMap<String, String>();
......@@ -674,7 +674,7 @@ public abstract class BaseExecutor {
ErrorReporter.logExceptionStackTrace(e);
}
}
configHandler.setEnvMap(env);
configHandler.processASTs();
logFileNameDefined = configHandler.isLogFileNameDefined();
......@@ -690,19 +690,19 @@ public abstract class BaseExecutor {
if ( !isDeleteLogFilesSet( preferenceStore ) ) {
return;
}
String workingDirRelative = getLogDir();
if ( workingDirRelative == null ) {
return;
}
String logFileFolder = workingdirectoryPath + File.separator + workingDirRelative + File.separator;
Path path = new Path(logFileFolder);
IContainer folder = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
if (folder == null || !folder.exists()) {
return;
}
final StringBuilder filesThatCanNotBeDeleted = new StringBuilder();
try {
for (IResource resource : folder.members()) {
......@@ -720,11 +720,11 @@ public abstract class BaseExecutor {
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error while deleting log files", "The log folder is not accessible.");
}
if (filesThatCanNotBeDeleted.length() > 0) {
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error while deleting log files",
"The following log files can not be deleted:\n" + filesThatCanNotBeDeleted.toString());
"Error while deleting log files",
"The following log files can not be deleted:\n" + filesThatCanNotBeDeleted.toString());
}
}
......@@ -745,7 +745,7 @@ public abstract class BaseExecutor {
* Merges the generated log files together.
*/
protected void mergeLogFiles() {
if (logFilesMerged) {
if (logFilesMerged) {
return;
} else {
logFilesMerged = true;
......@@ -754,20 +754,20 @@ public abstract class BaseExecutor {
if ( !isAutomaticMergeEnabled( preferenceStore ) ) {
return;
}
String workingDirRelative = getLogDir();
if ( workingDirRelative == null ) {
return;
}
String logFileFolder = workingdirectoryPath + File.separator + workingDirRelative + File.separator;
Path path = new Path(logFileFolder);
IContainer folder = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(path);
if (folder == null || !folder.exists()) {
return;
}
List<IFile> filesToMerge = new ArrayList<IFile>();
try {
folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
......@@ -783,9 +783,9 @@ public abstract class BaseExecutor {
}
}
} catch (CoreException e) {
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error while merging log files",
"The log folder "+logFileFolder+ " is not accessible.");
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error while merging log files",
"The log folder "+logFileFolder+ " is not accessible.");
}
MergeLog mergeLog = new MergeLog();
......@@ -805,7 +805,7 @@ public abstract class BaseExecutor {
if (isNullOrEmpty(cfgString)) {
return;
}
if (!keepTemporarilyGeneratedConfigFiles && null != temporalConfigFile && temporalConfigFile.exists()) {
boolean result = temporalConfigFile.delete();
if (!result) {
......
......@@ -36,7 +36,7 @@ import org.eclipse.titan.executor.Activator;
/**
* This class creates the dialog presenting the user with the selection of executable elements.
*
*
* @author Kristof Szabados
* */
public final class ExecuteDialog extends Dialog {
......
......@@ -14,7 +14,7 @@ import java.util.List;
/**
* Simple content provider for the execute dialog.
*
*
* @author Kristof Szabados
* */
public final class ExecuteDialogContentProvider implements ITreeContentProvider {
......
......@@ -33,7 +33,7 @@ import java.util.Formatter;
/**
* Connects to the a started Host Controllers and redirects its output to the notification view and the TITANConsole.
*
*
* @author Kristof Szabados
* */
public final class HostJob extends Job {
......
......@@ -13,7 +13,7 @@ import java.util.List;
* This interface represents a tree branch, that can have leafs under itself.
* <p>
* Extends tree leaf, allowing to store tree branches in tree branches.
*
*
* @author Kristof Szabados
* */
public interface ITreeBranch extends ITreeLeaf {
......
......@@ -48,7 +48,7 @@ public abstract class LaunchShortcut implements ILaunchShortcut {
* @param configFilePath the path of the configuration file.
* */
public abstract boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration,
final IProject project, final String configFilePath);
final IProject project, final String configFilePath);
protected ILaunchConfigurationWorkingCopy getWorkingCopy(final IProject project, IFile file, final String mode) {
......@@ -140,7 +140,7 @@ public abstract class LaunchShortcut implements ILaunchShortcut {
ErrorReporter.parallelErrorDisplayInMessageDialog(
"An error was found while creating the default launch configuration for project "
+ project.getName(),
"Config file not found in project " + project.getName());
"Config file not found in project " + project.getName());
return;
}
} else {
......
......@@ -46,8 +46,8 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut {
* @param configFilePath the path of the configuration file.
* */
public abstract boolean initLaunchConfiguration(final ILaunchConfigurationWorkingCopy configuration,
final IProject project, final String configFilePath);
final IProject project, final String configFilePath);
protected ILaunchConfigurationWorkingCopy getWorkingCopy(final IProject project, IFile file, final String mode) {
try {
......@@ -120,7 +120,7 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut {
ErrorReporter.logError("Config file not found"); // Is it necessary???
return;
}
final IFile file = (IFile) selections[0];
final IProject project = file.getProject();
......@@ -138,7 +138,7 @@ public abstract class LaunchShortcutConfig implements ILaunchShortcut {
if (result) {
result = HostControllersTab.initLaunchConfiguration(wc);
}
if (result) {
wc.setMappedResources(new IResource[] {project, file});
wc.setAttribute(EXECUTECONFIGFILEONLAUNCH, true);
......
......@@ -38,7 +38,7 @@ public final class SeverityResolver {
"MATCHING_MMSUCCESS", "MATCHING_MMUNSUCC", "MATCHING_PROBLEM", "MATCHING_UNQUALIFIED",
"DEBUG_ENCDEC", "DEBUG_TESTPORT", "DEBUG_UNQUALIFIED",
"NUMBER_OF_LOGSEVERITIES",
"LOG_ALL_IMPORTANT" };
"LOG_ALL_IMPORTANT" };
private static final String UNKNOWN_SEVERITY = "Unknown";
......
......@@ -12,7 +12,7 @@ import java.util.List;
/**
* Represents a branch of a tree.
*
*
* @author Kristof Szabados
* */
public class TreeBranch extends TreeLeaf implements ITreeBranch {
......
......@@ -62,7 +62,7 @@ import org.eclipse.ui.console.MessageConsoleStream;
/**
* This executor handles the execution of tests compiled in a parallel mode, via directly connecting to the MainController written in C++.
*
*
* @author Kristof Szabados
* */
public final class JniExecutor extends BaseExecutor implements IJNICallback {
......@@ -535,7 +535,7 @@ public final class JniExecutor extends BaseExecutor implements IJNICallback {
} else {
Throwable exception = configHandler.parseExceptions().get(configHandler.parseExceptions().size() - 1);
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error while processing the configuration file",
"Error while processing the configuration file",
exception.getMessage() + "\n Please refer to the Error Log view for further information.");
}
return;
......@@ -565,7 +565,7 @@ public final class JniExecutor extends BaseExecutor implements IJNICallback {
if (localAddress != null && !EMPTY_STRING.equals(localAddress) && 0 == tcpport) {
addNotification(new Notification((new Formatter()).format(PADDEDDATETIMEFORMAT, new Date()).toString(), EMPTY_STRING, EMPTY_STRING,
"If LocalAddress is specified you must also set the TCPPort in the configuration file: " + configFilePath));
ErrorReporter.parallelErrorDisplayInMessageDialog(
"Error in the configuration",
"If LocalAddress is specified you must also set the TCPPort in the configuration file: " + configFilePath);
......
......@@ -58,7 +58,7 @@ public final class LaunchConfigurationDelegate extends TitanLaunchConfigurationD
+ "Only one instance can be running at any time.", null);
throw new CoreException(status);
}
showExecutionPerspective();
final JniExecutor executor = new JniExecutor(arg0);
executor.startSession(arg2);
......
......@@ -15,7 +15,7 @@ import org.eclipse.titan.executor.tabpages.maincontroller.JNIMainControllerTab;
* @author Kristof Szabados
* */
public final class LaunchShortcut extends org.eclipse.titan.executor.executors.LaunchShortcut {
@Override
protected String getConfigurationId() {
return "org.eclipse.titan.executor.executors.jni.LaunchConfigurationDelegate";
......
......@@ -13,7 +13,7 @@ import org.eclipse.titan.common.logging.ErrorReporter;
* This thread is used to stimulate the mctr_cli executor timely, to ask the real Main Controller for information.
* <p>
* On this way the even if the mctr_cli losses sync with the Main Controller, it will be able to recover it within a user defined timeout limit.
*
*
* @author Kristof Szabados
* */
public final class BackgroundThread extends Thread {
......
......@@ -65,11 +65,11 @@ import org.eclipse.ui.console.MessageConsoleStream;
/**
* This executor handles the execution of tests compiled in a parallel mode, connecting to the MainController via command line.
*
*
* @author Kristof Szabados
* */
public final class CliExecutor extends BaseExecutor {
private static final String EXTERNAL_TERMINATION = "Execution terminated from outside";
private Action automaticExecution, startHC, cmtc, smtc, emtc, exit, info;
......@@ -112,7 +112,7 @@ public final class CliExecutor extends BaseExecutor {
private final Matcher hcConnectedMatcher = HC_CONNECTED_PATTERN.matcher("");
private static final Pattern ERROR_STARTUP_PATTERN = Pattern.compile("Error: (.+)");
private static final String MTC_CREATED = " MTC is created.";
private static final String TEST_EXECUTION_FINISHED = " Test execution finished.";
private static final String EXECUTE_SECTION_FINISHED = " Execution of [EXECUTE] section finished.";
......@@ -455,7 +455,7 @@ public final class CliExecutor extends BaseExecutor {
/**
* Initializes and displays a dialog to the user. If the user selected an
* executable element, it is also started here.
*
*
* @param automaticExecution tells if the configuration file shall be automatically selected for execution,
* or shall the user be able to select something.
* */
......@@ -725,7 +725,7 @@ public final class CliExecutor extends BaseExecutor {
* Processes the host controller related part of the mctr_cli's answer to the info command.
* <p>
* @see #processInfoOutput(BufferedReader)
*
*
* @param stdout the output of the process to be parsed.
* @param root the main controller element to add the host controller data to.
* */
......@@ -783,7 +783,7 @@ public final class CliExecutor extends BaseExecutor {
* Processes the component related part of the mctr_cli's answer to the info command.
* <p>
* @see #processInfoOutputHC(BufferedReader, MainControllerElement)
*
*
* @param stdout the output of the process to be parsed.
* @param host the host to add the component data to.
* */
......@@ -831,15 +831,15 @@ public final class CliExecutor extends BaseExecutor {
}
/**
* Processes the welcome screen.
* This is needed as sometimes the process already forgets about this information,
* Processes the welcome screen.
* This is needed as sometimes the process already forgets about this information,
* when the listeners get installed.
* It waits for main controller output lines and returns if it received any of these messages:
* <li>Listening on TCP port ...
* <li>Listening on IP address ... and TCP port ...
* <li>Error: ...
* It stores the IP address and TCP port gathered from the message
*
*
* @param stdout the output of the process to be parsed.
* */
private void processWelcomeScreen(final BufferedReader stdout) {
......@@ -867,7 +867,7 @@ public final class CliExecutor extends BaseExecutor {
started = true;
suspectedLastState = JniExecutor.MC_LISTENING;
} else {
line = stdout.readLine();
line = stdout.readLine();
}
}
}
......
......@@ -17,14 +17,14 @@ import org.eclipse.titan.executor.executors.TitanLaunchConfigurationDelegate;
* @author Kristof Szabados
* */
public final class LaunchConfigurationDelegate extends
TitanLaunchConfigurationDelegate {
TitanLaunchConfigurationDelegate {
@Override
public void launch(final ILaunchConfiguration arg0, final String arg1, final ILaunch arg2,
final IProgressMonitor arg3) throws CoreException {
showExecutionPerspective();
CliExecutor executor = new CliExecutor(arg0);
executor.startSession(arg2);
}
......
......@@ -21,7 +21,7 @@ public final class LaunchShortcut extends org.eclipse.titan.executor.executors.L
}
@Override
protected String getDialogTitle() {
protected String getDialogTitle() {
return "Select (parallel) mctr_cli mode execution configuration";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment