Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPawel Piech2012-06-09 03:22:58 +0000
committerEugene Tarassov2012-06-12 00:05:48 +0000
commitd4fce15928897a3cb0c9757ea5abf50a93c49051 (patch)
tree0de839247ccb3985f9513dc3268b145836e77cc6 /tests
parent10793bd1adb4c2e5f52df3d99515b153dce63bfb (diff)
downloadorg.eclipse.tcf-d4fce15928897a3cb0c9757ea5abf50a93c49051.tar.gz
org.eclipse.tcf-d4fce15928897a3cb0c9757ea5abf50a93c49051.tar.xz
org.eclipse.tcf-d4fce15928897a3cb0c9757ea5abf50a93c49051.zip
Bug 381993 - [breakpoints] Add a detail pane in breakpoints view to show breakpoints' scope setting
Completed implementaiton.
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointDetailPaneTest.java90
1 files changed, 90 insertions, 0 deletions
diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointDetailPaneTest.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointDetailPaneTest.java
new file mode 100644
index 000000000..b27dd9658
--- /dev/null
+++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointDetailPaneTest.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.debug.test;
+
+import java.util.regex.Pattern;
+
+import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.tcf.debug.ui.ITCFDebugUIConstants;
+import org.eclipse.tcf.internal.cdt.ui.breakpoints.TCFBreakpointScopeDetailPane.ContextQueryElement;
+import org.eclipse.tcf.internal.cdt.ui.breakpoints.TCFBreakpointScopeDetailPane.ScopeDetailInputObject;
+import org.eclipse.tcf.internal.debug.ui.launch.TCFLaunchContext;
+import org.junit.Assert;
+
+@SuppressWarnings("restriction")
+public class BreakpointDetailPaneTest extends AbstractTcfUITest
+{
+ private BreakpointsListener fBpListener;
+
+ protected VirtualTreeModelViewer fContextQueryViewViewer;
+ protected VirtualViewerUpdatesListener fContextQueryViewListener;
+
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ fBpListener = new BreakpointsListener();
+
+ // CDT Breakpoint integration depends on the TCF-CDT breakpoint
+ // integration to be active. This is normally triggered by selecting
+ // a stack frame in the UI. Here force activation of the plugin
+ // artificially. None of the cdt integration packages are exported, so
+ // use the TCF Launch Context extension point indirectly to force the
+ // plugin to load.
+ TCFLaunchContext.getLaunchContext(null);
+
+ final Display display = Display.getDefault();
+ display.syncExec(new Runnable() {
+ public void run() {
+ fContextQueryViewViewer = new VirtualTreeModelViewer(
+ display, SWT.NONE, new PresentationContext(ITCFDebugUIConstants.ID_CONTEXT_QUERY_VIEW));
+ fContextQueryViewListener = new VirtualViewerUpdatesListener(fContextQueryViewViewer);
+ }
+ });
+
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ final Display display = Display.getDefault();
+ display.syncExec(new Runnable() {
+ public void run() {
+ fContextQueryViewListener.dispose();
+ fContextQueryViewViewer.dispose();
+ }
+ });
+ fBpListener.dispose();
+ super.tearDown();
+ }
+
+ public void testContextAddedOnLineBrakpointCreate() throws Exception {
+ initProcessModel("tcf_test_func0");
+
+ final String query = "pid="+fProcessId;
+
+ fContextQueryViewListener.reset();
+ Display.getDefault().syncExec(new Runnable() { public void run() {
+ fContextQueryViewViewer.setAutoExpandLevel(-1);
+ fContextQueryViewViewer.setInput(new ScopeDetailInputObject(new ContextQueryElement(query, null)));
+ }});
+ fContextQueryViewListener.waitTillFinished(CONTENT_SEQUENCE_COMPLETE | LABEL_UPDATES_RUNNING);
+
+ VirtualItem scopeItem = fContextQueryViewListener.findElement(new Pattern[] { Pattern.compile(".*pid\\="+fProcessId+"*.") });
+ if (scopeItem == null) {
+ Assert.fail("Scope item not found. \n\nContext query view dump: \n:" + fContextQueryViewViewer.toString());
+ }
+
+ }
+
+}

Back to the top