tmf: Add a timeout to TmfTraceManagerTest
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.tmf.ctf.core.tests / src / org / eclipse / tracecompass / tmf / ctf / core / tests / temp / tracemanager / TmfTraceManagerTest.java
index c96ade9dbebb592bb8294bfa88262e309bdecc65..d5622483999e188d8a629e01c9968521fdc9f904 100644 (file)
@@ -21,6 +21,7 @@ import static org.junit.Assume.assumeTrue;
 import java.io.File;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.concurrent.TimeUnit;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
@@ -42,7 +43,10 @@ import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.TestRule;
+import org.junit.rules.Timeout;
 
 import com.google.common.collect.ImmutableSet;
 
@@ -53,6 +57,10 @@ import com.google.common.collect.ImmutableSet;
  */
 public class TmfTraceManagerTest {
 
+    /** Time-out tests after 20 seconds */
+    @Rule
+    public TestRule globalTimeout= new Timeout(20, TimeUnit.SECONDS);
+
     private static final int SCALE = ITmfTimestamp.NANOSECOND_SCALE;
 
     private static ITmfTrace trace1;
This page took 0.024896 seconds and 5 git commands to generate.