diff options
Diffstat (limited to 'tests')
7 files changed, 67 insertions, 11 deletions
diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AbstractTcfUITest.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AbstractTcfUITest.java index 5f8ee7e4f..40ddb79c7 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AbstractTcfUITest.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AbstractTcfUITest.java @@ -162,7 +162,7 @@ public abstract class AbstractTcfUITest extends AbstractCMTest implements IViewe // Make sure that delta is posted after launching process so that it doesn't interfere // with the waiting for the whole viewer to update after breakpoint hit (below). - fDebugViewListener.waitTillFinished(MODEL_CHANGED_COMPLETE| CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE | LABEL_UPDATES); + fDebugViewListener.waitTillFinished(MODEL_CHANGED_COMPLETE| CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE); fDebugViewListener.reset(); runToTestEntry(processInfo, testFunc); @@ -181,12 +181,17 @@ public abstract class AbstractTcfUITest extends AbstractCMTest implements IViewe public String getID() { return topFrameId; } public IChannel getChannel() { return channels[0]; } }; - fDebugViewListener.addLabelUpdate(new TreePath(new Object[] { fLaunch, processTCFContext, threadTCFContext, frameTCFContext })); - fDebugViewListener.waitTillFinished(MODEL_CHANGED_COMPLETE | CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE | LABEL_UPDATES); + VirtualItem topFrameItem = null; + long timeout = System.currentTimeMillis() + TIMEOUT_DEFAULT; + do { + fDebugViewListener.addLabelUpdate(new TreePath(new Object[] { fLaunch, processTCFContext, threadTCFContext, frameTCFContext })); + fDebugViewListener.waitTillFinished(MODEL_CHANGED_COMPLETE | CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE | LABEL_UPDATES); + topFrameItem = fDebugViewListener.findElement( + new Pattern[] { Pattern.compile(".*"), Pattern.compile(".*"), Pattern.compile(".*" + processInfo.fProcessId + ".*\\(.*[Bb]reakpoint.*"), Pattern.compile(".*")}); + fDebugViewListener.reset(); + } while (topFrameItem == null && System.currentTimeMillis() < timeout); - VirtualItem topFrameItem = fDebugViewListener.findElement( - new Pattern[] { Pattern.compile(".*"), Pattern.compile(".*"), Pattern.compile(".*" + processInfo.fProcessId + ".*\\(.*[Bb]reakpoint.*"), Pattern.compile(".*")}); if (topFrameItem == null) { Assert.fail("Top stack frame not found. \n\nDebug view dump: \n:" + fDebugViewViewer.toString()); } diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AutomatedSuite.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AutomatedSuite.java new file mode 100644 index 000000000..6c0a0e9ae --- /dev/null +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/AutomatedSuite.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2009, 2012 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Freescale Semiconductor - Bug 293618, Breakpoints view sorts up to first colon only + *******************************************************************************/ +package org.eclipse.tcf.debug.test; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * Tests for integration and nightly builds. + * + * @since 3.6 + */ +public class AutomatedSuite extends TestSuite { + + /** + * Returns the suite. This is required to use the JUnit Launcher. + * + * @return the test suite + */ + public static Test suite() { + return new AutomatedSuite(); + } + + /** + * Constructs the automated test suite. Adds all tests. + */ + public AutomatedSuite() { + addTest(new TestSuite(BreakpointsTest.class)); + addTest(new TestSuite(TransactionTests.class)); + addTest(new TestSuite(BreakpointDetailPaneTest.class)); + addTest(new TestSuite(BreakpointsViewTest.class)); + addTest(new TestSuite(RunControlCMTest.class)); + addTest(new TestSuite(StackTraceCMTest.class)); + addTest(new TestSuite(CacheTests.class)); + addTest(new TestSuite(RangeCacheTests.class)); + addTest(new TestSuite(QueryTests.class)); + addTest(new TestSuite(SampleTest.class)); + } +} diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointsTest.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointsTest.java index a1f927599..5239efa88 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointsTest.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/BreakpointsTest.java @@ -159,7 +159,7 @@ public class BreakpointsTest extends AbstractTcfUITest return validate( fBreakpointsCM.waitContextAdded(this) ); }}.get(60, TimeUnit.SECONDS); - long timeout = System.currentTimeMillis() + 60000; + long timeout = System.currentTimeMillis() + TIMEOUT_DEFAULT; wait: while(System.currentTimeMillis() < timeout) { synchronized(addedBps) { addedBps.wait(100); diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/IViewerUpdatesListenerConstants.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/IViewerUpdatesListenerConstants.java index 19d5f44a6..0adfa5fe8 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/IViewerUpdatesListenerConstants.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/IViewerUpdatesListenerConstants.java @@ -17,6 +17,8 @@ package org.eclipse.tcf.debug.test; */ public interface IViewerUpdatesListenerConstants { + public static final int TIMEOUT_DEFAULT = 60000; + public static final int LABEL_SEQUENCE_COMPLETE = 0X00000001; public static final int CONTENT_SEQUENCE_COMPLETE = 0X00000002; public static final int CONTENT_SEQUENCE_STARTED = 0X00020000; diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/RangeCacheTests.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/RangeCacheTests.java index ea9bdc54b..453755feb 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/RangeCacheTests.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/RangeCacheTests.java @@ -259,9 +259,10 @@ public class RangeCacheTests extends TestCase { for (int i = 50; i < 100; i++) { Assert.assertEquals(null, data.get(i)); } - - // Check state while waiting for data - assertCacheValidWithData(fRangeCache, 0, 50); + + for (int i = 0; i < 50; i++) { + Assert.assertEquals(new Integer(i), data.get(i)); + } } diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/ViewerUpdatesListener.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/ViewerUpdatesListener.java index a93a5e1a0..aed1b9395 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/ViewerUpdatesListener.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/ViewerUpdatesListener.java @@ -81,7 +81,7 @@ public class ViewerUpdatesListener private boolean fStateRestoreComplete; private int fContentUpdatesCounter; private int fLabelUpdatesCounter; - private int fTimeoutInterval = 60000; + private int fTimeoutInterval = TIMEOUT_DEFAULT; private long fTimeoutTime; protected Set<TreePath> makeTreePathSet() { diff --git a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/services/ResetMap.java b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/services/ResetMap.java index af2cfc8bd..dda1fd840 100644 --- a/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/services/ResetMap.java +++ b/tests/plugins/org.eclipse.tcf.debug.test/src/org/eclipse/tcf/debug/test/services/ResetMap.java @@ -76,7 +76,7 @@ public class ResetMap { public void addValid(String id, String[] childrenIds, IResettable cache) { assert Protocol.isDispatchThread(); - if (!clearPending(id, cache)) return; + if (clearPending(id, cache)) return; List<IResettable> list = fValid.get(id); if (list == null) { |