lttng: Fix ControlViewTest
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui.tests / src / org / eclipse / tracecompass / lttng2 / control / ui / tests / model / component / TargetNodeConnectedCondition.java
1 /**********************************************************************
2 * Copyright (c) 2016 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.tracecompass.lttng2.control.ui.tests.model.component;
13
14 import org.eclipse.osgi.util.NLS;
15 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
16 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
17 import org.eclipse.tracecompass.tmf.ui.tests.shared.IWaitCondition;
18
19 /**
20 * Condition that waits for a target node to be in connected state.
21 */
22 public class TargetNodeConnectedCondition implements IWaitCondition {
23
24 TargetNodeComponent fNode;
25
26 /**
27 * Constructor.
28 *
29 * @param node
30 * The target node
31 */
32 public TargetNodeConnectedCondition(TargetNodeComponent node) {
33 fNode = node;
34 }
35
36 @Override
37 public boolean test() throws Exception {
38 return fNode.getTargetNodeState() == TargetNodeState.CONNECTED;
39 }
40
41 @Override
42 public String getFailureMessage() {
43 return NLS.bind("Target Node {0} did not reach CONNECTED state. State is ", fNode.getName(), fNode.getTargetNodeState().toString());
44 }
45
46 }
This page took 0.031874 seconds and 5 git commands to generate.