tmf: Add waitUntil / condition to tmf.ui.tests
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui.tests / shared / org / eclipse / tracecompass / tmf / ui / tests / shared / IWaitCondition.java
1 /*******************************************************************************
2 * Copyright (c) 2008, 2016 Ketan Padegaonkar and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Ketan Padegaonkar - initial API and implementation
10 * Marc-Andre Laperle - Adapted to Trace Compass from SWTBot's TimeoutException
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.ui.tests.shared;
14
15 /**
16 * A condition meant to be tested periodically. If it fails after a certain
17 * timeout, a failure message is provided.
18 */
19 public interface IWaitCondition {
20 /**
21 * Tests if the condition has been met.
22 *
23 * @return <code>true</code> if the condition is satisfied, <code>false</code> otherwise.
24 * @throws Exception if the test encounters an error while processing the check.
25 */
26 boolean test() throws Exception;
27
28 /**
29 * Gets the failure message when a test fails (returns <code>false</code>).
30 *
31 * @return the failure message to show in case the test fails.
32 */
33 String getFailureMessage();
34 }
This page took 0.03158 seconds and 5 git commands to generate.