Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-01-25 06:06:21 -0500
committerUwe Stieber2013-01-25 06:06:57 -0500
commitd64077bd618263ff6a07f30c63b6a29c597607c9 (patch)
tree310f28f6f6a526ba8d94eafdfcb0e0352027e3d0
parent301bf1940b24b9e90d4e06f6a9b3debea13b7199 (diff)
downloadorg.eclipse.tcf-d64077bd618263ff6a07f30c63b6a29c597607c9.tar.gz
org.eclipse.tcf-d64077bd618263ff6a07f30c63b6a29c597607c9.tar.xz
org.eclipse.tcf-d64077bd618263ff6a07f30c63b6a29c597607c9.zip
Target Explorer: Allow to run Eclipse (TCF) diagnostics tests from the System Manager tree directly
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml111
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java249
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsCommandHandler.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsLoopCommandHandler.java24
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/.options1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java7
15 files changed, 432 insertions, 40 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java
index 1d7b28842..bb2b30ff7 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java
@@ -27,7 +27,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
-class TestErrorsDialog extends Dialog {
+public class TestErrorsDialog extends Dialog {
private static final int
SIZING_TEXT_WIDTH = 600,
@@ -37,7 +37,7 @@ class TestErrorsDialog extends Dialog {
private Image image;
private Text text;
- TestErrorsDialog(Shell parent, Image image, Collection<Throwable> errors) {
+ public TestErrorsDialog(Shell parent, Image image, Collection<Throwable> errors) {
super(parent);
this.image = image;
this.errors = errors;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
index 46b5da008..3701eee37 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/META-INF/MANIFEST.MF
@@ -7,16 +7,16 @@ Bundle-Activator: org.eclipse.tcf.te.tcf.launch.ui.activator.UIPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.debug.ui;bundle-version="3.8.1",
- org.eclipse.ui;bundle-version="3.8.0",
- org.eclipse.ui.forms;bundle-version="3.5.200",
- org.eclipse.ui.navigator;bundle-version="3.5.200",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.300",
org.eclipse.tcf.core;bundle-version="1.1.0",
+ org.eclipse.tcf.debug;bundle-version="1.1.0",
+ org.eclipse.tcf.debug.ui;bundle-version="1.1.0",
+ org.eclipse.tcf.te.launch.core;bundle-version="1.1.0",
+ org.eclipse.tcf.te.launch.ui;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime;bundle-version="1.1.0",
+ org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime.model;bundle-version="1.1.0",
+ org.eclipse.tcf.te.runtime.persistence;bundle-version="1.1.0",
org.eclipse.tcf.te.runtime.services;bundle-version="1.1.0",
- org.eclipse.tcf.te.launch.core;bundle-version="1.1.0",
- org.eclipse.tcf.te.launch.ui;bundle-version="1.1.0",
org.eclipse.tcf.te.tcf.core;bundle-version="1.1.0",
org.eclipse.tcf.te.tcf.filesystem.core;bundle-version="1.1.0",
org.eclipse.tcf.te.tcf.filesystem.ui;bundle-version="1.1.0",
@@ -28,9 +28,10 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.tcf.te.ui.forms;bundle-version="1.1.0",
org.eclipse.tcf.te.ui.swt;bundle-version="1.1.0",
org.eclipse.tcf.te.ui.views;bundle-version="1.1.0",
- org.eclipse.tcf.debug.ui;bundle-version="1.1.0",
- org.eclipse.tcf.te.runtime.concurrent;bundle-version="1.1.0",
- org.eclipse.tcf.te.runtime.persistence;bundle-version="1.1.0"
+ org.eclipse.ui;bundle-version="3.8.0",
+ org.eclipse.ui.forms;bundle-version="3.5.200",
+ org.eclipse.ui.navigator;bundle-version="3.5.200",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.300"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -39,6 +40,7 @@ Export-Package: org.eclipse.tcf.te.tcf.launch.ui.activator;x-internal:=true,
org.eclipse.tcf.te.tcf.launch.ui.editor,
org.eclipse.tcf.te.tcf.launch.ui.editor.tabs,
org.eclipse.tcf.te.tcf.launch.ui.filetransfer,
+ org.eclipse.tcf.te.tcf.launch.ui.handler,
org.eclipse.tcf.te.tcf.launch.ui.help,
org.eclipse.tcf.te.tcf.launch.ui.internal.services;x-internal:=true,
org.eclipse.tcf.te.tcf.launch.ui.launchcontext,
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
index 93e45fddd..5edf607ce 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.properties
@@ -24,6 +24,17 @@ Command.showInDebugView.description=Show the selection in the Debug View.
LauchTree.name=Launches
-LaunchShortcutHandler.Remote.App.run.name=Run Remote Application
-LaunchShortcutHandler.Remote.App.debug.name=Debug Remote Application
LaunchShortcut.Remote.App.name=Remote Application
+
+command.run.name=Run Remote Application
+command.debug.name=Debug Remote Application
+
+menu.diagnostics.label=Diagnostics
+
+command.runtests.name=Run Diagnostics Tests Command
+command.runtests.label=Run Tests
+command.runtests.tooltip=Run Diagnostics Tests on the selected Peer
+
+command.runtestsloop.name=Run Diagnostics Tests Loop Command
+command.runtestsloop.label=Run Tests Loop
+command.runtestsloop.tooltip=Run Diagnostics Tests in a loop on the selected Peer
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
index eb06ec1b6..19b20b551 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/plugin.xml
@@ -172,13 +172,13 @@
<extension point="org.eclipse.ui.menus">
<!-- Project explorer menu contributions -->
<menuContribution locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?before=additions">
- <separator name="org.eclipse.tcf.te.tcf.ui.launch.remote.app.launch" visible="true"/>
+ <separator name="org.eclipse.tcf.te.tcf.launch.ui.remote.app.launch" visible="true"/>
<command
- commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.run"
disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/run_exc.gif"
icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/run_exc.gif"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.run"
- label="%LaunchShortcutHandler.Remote.App.run.name"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.run"
+ label="%command.run.name"
style="push">
<visibleWhen checkEnabled="false">
<with variable="selection">
@@ -203,11 +203,11 @@
</visibleWhen>
</command>
<command
- commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.debug"
disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/debug_exc.gif"
icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/debug_exc.gif"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.debug"
- label="%LaunchShortcutHandler.Remote.App.debug.name"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.debug"
+ label="%command.debug.name"
style="push">
<visibleWhen checkEnabled="false">
<with variable="selection">
@@ -232,18 +232,18 @@
</visibleWhen>
</command>
</menuContribution>
+
<!-- Target explorer menu contributions -->
<menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?before=additions">
- <separator name="org.eclipse.tcf.te.tcf.ui.launch.remote.app.launch" visible="true"/>
+ <separator name="org.eclipse.tcf.te.tcf.launch.ui.remote.app.launch" visible="true"/>
<command
- commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.run"
disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/run_exc.gif"
icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/run_exc.gif"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.run"
- label="%LaunchShortcutHandler.Remote.App.run.name"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.run"
+ label="%command.run.name"
style="push">
<visibleWhen checkEnabled="false">
- <with variable="selection">
<with variable="selection">
<iterate
operator="and"
@@ -255,18 +255,16 @@
args="run"/>
</iterate>
</with>
- </with>
</visibleWhen>
</command>
<command
- commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.debug"
disabledIcon="platform:/plugin/org.eclipse.debug.ui/icons/full/dtool16/debug_exc.gif"
icon="platform:/plugin/org.eclipse.debug.ui/icons/full/etool16/debug_exc.gif"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.debug"
- label="%LaunchShortcutHandler.Remote.App.debug.name"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.debug"
+ label="%command.debug.name"
style="push">
<visibleWhen checkEnabled="false">
- <with variable="selection">
<with variable="selection">
<iterate
operator="and"
@@ -278,27 +276,71 @@
args="debug"/>
</iterate>
</with>
- </with>
</visibleWhen>
</command>
</menuContribution>
+
+ <menuContribution locationURI="popup:org.eclipse.tcf.te.ui.views.View#Popup?after=group.connection">
+ <menu
+ id="org.eclipse.tcf.te.tcf.launch.ui.menu.diagnostics"
+ label="%menu.diagnostics.label">
+ <command
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.command.runtests"
+ id="org.eclipse.tcf.te.tcf.launch.ui.commands.runtests"
+ label="%command.runtests.label"
+ tooltip="%command.runtests.tooltip">
+ </command>
+ <command
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.command.runtestsloop"
+ id="org.eclipse.tcf.te.tcf.launch.ui.commands.runtestsloop"
+ label="%command.runtestsloop.label"
+ tooltip="%command.runtestsloop.tooltip">
+ </command>
+ <separator name="additions"/>
+
+ <visibleWhen checkEnabled="false">
+ <with variable="selection">
+ <count value="1"/>
+ <iterate operator="and" ifEmpty="false">
+ <adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
+ <test property="org.eclipse.tcf.te.tcf.locator.hasRemoteService" value="Diagnostics"/>
+ </adapt>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
</extension>
<!-- Command contributions -->
<extension point="org.eclipse.ui.commands">
<command
categoryId="org.eclipse.tcf.te.ui.commands.category"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run"
- name="%LaunchShortcutHandler.Remote.App.run.name"/>
+ helpContextId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command_Run"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.run"
+ name="%command.run.name"/>
+ <command
+ categoryId="org.eclipse.tcf.te.ui.commands.category"
+ helpContextId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command_RunDebug"
+ id="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.debug"
+ name="%command.debug.name"/>
+
+ <!-- "Eclipse Diagnostics Tests" related commands -->
<command
categoryId="org.eclipse.tcf.te.ui.commands.category"
- id="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug"
- name="%LaunchShortcutHandler.Remote.App.debug.name"/>
+ helpContextId="org.eclipse.tcf.te.tcf.launch.ui.command_RunTests"
+ id="org.eclipse.tcf.te.tcf.launch.ui.command.runtests"
+ name="%command.runtests.name"/>
+ <command
+ categoryId="org.eclipse.tcf.te.ui.commands.category"
+ helpContextId="org.eclipse.tcf.te.tcf.launch.ui.command_RunTestsLoop"
+ id="org.eclipse.tcf.te.tcf.launch.ui.command.runtestsloop"
+ name="%command.runtestsloop.name"/>
</extension>
<!-- Handler contributions -->
<extension point="org.eclipse.ui.handlers">
- <handler commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.run">
+ <handler commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.run">
<class class="org.eclipse.tcf.te.launch.ui.handler.LaunchShortcutHandler">
<parameter name="mode" value="run"/>
<parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
@@ -325,7 +367,7 @@
</with>
</enabledWhen>
</handler>
- <handler commandId="org.eclipse.tcf.te.tcf.ui.launch.remote.app.command.debug">
+ <handler commandId="org.eclipse.tcf.te.tcf.launch.ui.remote.app.command.debug">
<class class="org.eclipse.tcf.te.launch.ui.handler.LaunchShortcutHandler">
<parameter name="mode" value="debug"/>
<parameter name="typeId" value="org.eclipse.tcf.te.tcf.launch.type.remote.app"/>
@@ -352,6 +394,27 @@
</with>
</enabledWhen>
</handler>
+
+ <!-- "Eclipse Diagnostics Tests" related handler -->
+ <handler
+ class="org.eclipse.tcf.te.tcf.launch.ui.handler.RunTestsCommandHandler"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.command.runtests">
+ <activeWhen>
+ <with variable="activePartId">
+ <equals value="org.eclipse.tcf.te.ui.views.View"/>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <handler
+ class="org.eclipse.tcf.te.tcf.launch.ui.handler.RunTestsLoopCommandHandler"
+ commandId="org.eclipse.tcf.te.tcf.launch.ui.command.runtestsloop">
+ <activeWhen>
+ <with variable="activePartId">
+ <equals value="org.eclipse.tcf.te.ui.views.View"/>
+ </with>
+ </activeWhen>
+ </handler>
</extension>
<!-- Property section contributions -->
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
index 957f5ced8..84b493d43 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/AbstractTcfLaunchTabContainerEditorPage.java
@@ -48,7 +48,7 @@ public abstract class AbstractTcfLaunchTabContainerEditorPage extends AbstractLa
* @param peerModel The peer model.
* @return The launch configuration.
*/
- public ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerModel peerModel) {
+ public static ILaunchConfigurationWorkingCopy getLaunchConfig(final IPeerModel peerModel) {
ILaunchConfigurationWorkingCopy wc = null;
if (peerModel != null) {
IPropertiesAccessService service = ServiceManager.getInstance().getService(peerModel, IPropertiesAccessService.class);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
index 8f25546d0..ea9df2020 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/MemoryMapTab.java
@@ -102,7 +102,7 @@ public class MemoryMapTab extends TCFMemoryMapTab {
@Override
protected void updateLaunchConfigurationDialog() {
super.updateLaunchConfigurationDialog();
- performApply(parentEditorPage.getLaunchConfig(parentEditorPage.getPeerModel(parentEditorPage.getEditorInput())));
+ performApply(AbstractTcfLaunchTabContainerEditorPage.getLaunchConfig(parentEditorPage.getPeerModel(parentEditorPage.getEditorInput())));
parentEditorPage.checkLaunchConfigDirty();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
index 22a423ac8..82ccf9911 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
@@ -51,7 +51,7 @@ public class PathMapTab extends TCFPathMapTab {
@Override
protected void updateLaunchConfigurationDialog() {
super.updateLaunchConfigurationDialog();
- performApply(parentEditorPage.getLaunchConfig(parentEditorPage.getPeerModel(parentEditorPage.getEditorInput())));
+ performApply(AbstractTcfLaunchTabContainerEditorPage.getLaunchConfig(parentEditorPage.getPeerModel(parentEditorPage.getEditorInput())));
parentEditorPage.checkLaunchConfigDirty();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java
new file mode 100644
index 000000000..3e70051a3
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/AbstractDiagnosticsCommandHandler.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.handler;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate;
+import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate.PathMapRule;
+import org.eclipse.tcf.internal.debug.tests.TCFTestSuite;
+import org.eclipse.tcf.internal.debug.ui.ImageCache;
+import org.eclipse.tcf.internal.debug.ui.launch.TestErrorsDialog;
+import org.eclipse.tcf.protocol.IPeer;
+import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.services.IDiagnostics;
+import org.eclipse.tcf.services.IMemoryMap;
+import org.eclipse.tcf.services.IPathMap;
+import org.eclipse.tcf.te.tcf.launch.ui.editor.AbstractTcfLaunchTabContainerEditorPage;
+import org.eclipse.tcf.te.tcf.launch.ui.nls.Messages;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelPeerNodeQueryService;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Abstract diagnostics command handler implementation.
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractDiagnosticsCommandHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the active shell
+ final Shell shell = HandlerUtil.getActiveShell(event);
+ // Get the selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
+ Iterator<?> iterator = ((IStructuredSelection)selection).iterator();
+ while (iterator.hasNext()) {
+ Object element = iterator.next();
+
+ // The selected element must be of type IPeerModel
+ if (element instanceof IPeerModel) {
+ final IPeerModel node = (IPeerModel)element;
+
+ ILocatorModelPeerNodeQueryService service = node.getModel().getService(ILocatorModelPeerNodeQueryService.class);
+ String remoteServices = service != null ? service.queryRemoteServices(node) : null;
+
+ if (remoteServices != null && remoteServices.contains(IDiagnostics.NAME)) {
+ runDiagnostics(node, shell);
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns if or if not the tests runs as tests loop.
+ *
+ * @return <code>True</code> to run the tests as loop, <code>false</code> otherwise.
+ */
+ protected abstract boolean runAsLoop();
+
+ /**
+ * Run the diagnostics tests.
+ *
+ * @param peer The peer. Must not be <code>null</code>.
+ * @param parentShell The parent shell. Must not be <code>null</code>.
+ */
+ /* default */ void runDiagnostics(IPeerModel node, Shell parentShell) {
+ Assert.isNotNull(node);
+ Assert.isNotNull(parentShell);
+
+ final Shell shell = new Shell(parentShell, SWT.TITLE | SWT.PRIMARY_MODAL);
+ GridLayout layout = new GridLayout();
+ layout.verticalSpacing = 0;
+ layout.numColumns = 2;
+ shell.setLayout(layout);
+ shell.setText(Messages.AbstractDiagnosticsCommandHandler_progress_title);
+ CLabel label = new CLabel(shell, SWT.NONE);
+ label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
+ label.setText(Messages.AbstractDiagnosticsCommandHandler_progress_title);
+ final TCFTestSuite[] test = new TCFTestSuite[1];
+ Button button_cancel = new Button(shell, SWT.PUSH);
+ button_cancel.setText(Messages.AbstractDiagnosticsCommandHandler_progress_button_cancel);
+ button_cancel.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
+ button_cancel.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ if (test[0] != null) test[0].cancel();
+ }
+ });
+ }
+ });
+ SWTFactory.createVerticalSpacer(shell, 0);
+ ProgressBar bar = new ProgressBar(shell, SWT.HORIZONTAL);
+ bar.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
+ shell.setDefaultButton(button_cancel);
+ shell.pack();
+ shell.setSize(483, shell.getSize().y);
+ Rectangle rc0 = parentShell.getBounds();
+ Rectangle rc1 = shell.getBounds();
+ shell.setLocation(rc0.x + (rc0.width - rc1.width) / 2, rc0.y + (rc0.height - rc1.height) / 2);
+ shell.setVisible(true);
+
+ ILaunchConfigurationWorkingCopy wc = AbstractTcfLaunchTabContainerEditorPage.getLaunchConfig(node);
+ runDiagnostics(node.getPeer(), runAsLoop(), test, shell, label, bar, wc);
+ }
+
+ /**
+ * Run the diagnostics tests.
+ *
+ * @param peer The peer. Must not be <code>null</code>.
+ * @param loop <code>True</code> to run the tests as tests loop, <code>false</code> otherwise.
+ * @param test The current test suite holder. Must not be <code>null</code>.
+ * @param shell The shell. Must not be <code>null</code>.
+ * @param label The label. Must not be <code>null</code>.
+ * @param bar The progress bar. Must not be <code>null</code>.
+ * @param wc The launch configuration working copy to get the path map and memory map from. Must not be <code>null</code>.
+ */
+ /* default */ void runDiagnostics(final IPeer peer, final boolean loop, final TCFTestSuite[] test,
+ final Shell shell, final CLabel label, final ProgressBar bar,
+ final ILaunchConfigurationWorkingCopy wc) {
+ Assert.isNotNull(peer);
+ Assert.isNotNull(test);
+ Assert.isNotNull(shell);
+ Assert.isNotNull(label);
+ Assert.isNotNull(bar);
+
+ final Display display = shell != null ? shell.getDisplay() : PlatformUI.getWorkbench().getDisplay();
+
+ final TCFTestSuite.TestListener done = new TCFTestSuite.TestListener() {
+ /* default */ String last_text = ""; //$NON-NLS-1$
+ /* default */ int last_count = 0;
+ /* default */ int last_total = 0;
+ @Override
+ public void progress(final String label_text, final int count_done, final int count_total) {
+ assert test[0] != null;
+ if ((label_text == null || last_text.equals(label_text)) &&
+ last_total == count_total &&
+ (count_done - last_count) / (float)count_total < 0.02f) return;
+ if (label_text != null) last_text = label_text;
+ last_total = count_total;
+ last_count = count_done;
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ label.setText(last_text);
+ bar.setMinimum(0);
+ bar.setMaximum(last_total);
+ bar.setSelection(last_count);
+ }
+ });
+ }
+ @Override
+ public void done(final Collection<Throwable> errors) {
+ assert test[0] != null;
+ final boolean b = test[0].isCanceled();
+ test[0] = null;
+ display.asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (errors.size() > 0) {
+ shell.dispose();
+ new TestErrorsDialog(shell,
+ ImageCache.getImage(ImageCache.IMG_TCF), errors).open();
+ }
+ else if (loop && !b) {
+ runDiagnostics(peer, true, test, shell, label, bar, wc);
+ }
+ else {
+ shell.dispose();
+ }
+ }
+ });
+ }
+ };
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ List<IPathMap.PathMapRule> path_map = new ArrayList<IPathMap.PathMapRule>();
+ String path_map_cfg = wc.getAttribute(TCFLaunchDelegate.ATTR_PATH_MAP, ""); //$NON-NLS-1$
+ ArrayList<PathMapRule> map = TCFLaunchDelegate.parsePathMapAttribute(path_map_cfg);
+ for (PathMapRule r : map) path_map.add(r);
+ if (path_map.isEmpty()) path_map = null;
+
+ HashMap<String,ArrayList<IMemoryMap.MemoryRegion>> mem_map = null;
+ String mem_map_cfg = wc.getAttribute(TCFLaunchDelegate.ATTR_MEMORY_MAP, (String)null);
+ if (mem_map_cfg != null) {
+ mem_map = new HashMap<String,ArrayList<IMemoryMap.MemoryRegion>>();
+ TCFLaunchDelegate.parseMemMapsAttribute(mem_map, mem_map_cfg);
+ }
+
+ boolean enable_tracing =
+ "true".equals(Platform.getDebugOption("org.eclipse.tcf.debug/debug")) && //$NON-NLS-1$ //$NON-NLS-2$
+ "true".equals(Platform.getDebugOption("org.eclipse.tcf.debug/debug/tests/runcontrol")); //$NON-NLS-1$ //$NON-NLS-2$
+ if (enable_tracing) System.setProperty("org.eclipse.tcf.debug.tracing.tests.runcontrol", "true"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ test[0] = new TCFTestSuite(peer, done, path_map, mem_map);
+ }
+ catch (Throwable x) {
+ ArrayList<Throwable> errors = new ArrayList<Throwable>();
+ errors.add(x);
+ done.done(errors);
+ }
+ }
+ });
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsCommandHandler.java
new file mode 100644
index 000000000..b3de2ae61
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsCommandHandler.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.handler;
+
+/**
+ * Run diagnostics tests command handler implementation.
+ */
+public class RunTestsCommandHandler extends AbstractDiagnosticsCommandHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.launch.ui.handler.AbstractDiagnosticsCommandHandler#runAsLoop()
+ */
+ @Override
+ protected boolean runAsLoop() {
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsLoopCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsLoopCommandHandler.java
new file mode 100644
index 000000000..4bbf511eb
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/handler/RunTestsLoopCommandHandler.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.launch.ui.handler;
+
+/**
+ * Run diagnostics tests loop command handler implementation.
+ */
+public class RunTestsLoopCommandHandler extends AbstractDiagnosticsCommandHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.launch.ui.handler.AbstractDiagnosticsCommandHandler#runAsLoop()
+ */
+ @Override
+ protected boolean runAsLoop() {
+ return true;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index 042823366..25075c3cd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -98,4 +98,7 @@ public class Messages extends NLS {
// public static String PathMapEditorPage_column_source;
// public static String PathMapEditorPage_column_destination;
public static String PathMapEditorPage_column_contextquery;
+
+ public static String AbstractDiagnosticsCommandHandler_progress_title;
+ public static String AbstractDiagnosticsCommandHandler_progress_button_cancel;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index 05c9e4ae2..d677eaf16 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -39,3 +39,6 @@ LaunchConfigurationAdvancedTabSection_lineseparator_cr=CR
#PathMapEditorPage_column_source=Local
#PathMapEditorPage_column_destination=Origin
PathMapEditorPage_column_contextquery=Context Query
+
+AbstractDiagnosticsCommandHandler_progress_title=Running Diagnostics...
+AbstractDiagnosticsCommandHandler_progress_button_cancel=&Cancel
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/.options b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/.options
index ad621184b..650748ea8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/.options
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/.options
@@ -2,5 +2,6 @@ org.eclipse.tcf.te.tcf.locator/debugmode = 0
org.eclipse.tcf.te.tcf.locator/trace/locatorModel = false
org.eclipse.tcf.te.tcf.locator/trace/locatorListener = false
+org.eclipse.tcf.te.tcf.locator/trace/propertyTester = false
org.eclipse.tcf.te.tcf.locator/trace/channelStateChangeListener = false
org.eclipse.tcf.te.tcf.locator/trace/scanner = false
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
index 27edd0cca..dc91db0e0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/interfaces/ITracing.java
@@ -26,6 +26,11 @@ public interface ITracing {
public static String ID_TRACE_LOCATOR_LISTENER = "trace/locatorListener"; //$NON-NLS-1$
/**
+ * If enabled, prints information about locator model property tester invocations.
+ */
+ public static String ID_TRACE_PROPERTY_TESTER = "trace/propertyTester"; //$NON-NLS-1$
+
+ /**
* If enabled, prints information about channel state change listener method invocations.
*/
public static String ID_TRACE_CHANNEL_STATE_CHANGE_LISTENER = "trace/channelStateChangeListener"; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
index 2a7d13d2b..8d0c2d6a6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/internal/LocatorModelPropertyTester.java
@@ -18,6 +18,8 @@ import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.Assert;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
+import org.eclipse.tcf.te.tcf.locator.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.locator.interfaces.ITracing;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModelProperties;
@@ -268,6 +270,11 @@ public class LocatorModelPropertyTester extends PropertyTester {
services = queryService.queryRemoteServices(node);
}
+ if (CoreBundleActivator.getTraceHandler().isSlotEnabled(ITracing.ID_TRACE_PROPERTY_TESTER)) {
+ CoreBundleActivator.getTraceHandler().trace("testServices: property = " + property + ", expectedValue = " + expectedValue + ", services = " + services, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ ITracing.ID_TRACE_PROPERTY_TESTER, LocatorModelPropertyTester.this);
+ }
+
if (services != null) {
// Lookup each service individually to avoid "accidental" matching
for (String service : services.split(",")) { //$NON-NLS-1$

Back to the top