source: src/test/java/negotiator/PausableTimelineTest.java@ 209

Last change on this file since 209 was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 870 bytes
Line 
1package negotiator;
2
3import org.junit.Test;
4
5import genius.core.PausableContinuousTimeline;
6
7public class PausableTimelineTest {
8
9 @Test
10 public void testTimeline() {
11 PausableContinuousTimeline timeline = new PausableContinuousTimeline(3);
12 System.out.println(
13 "Elapsed: " + timeline.getElapsedSeconds() + " seconds");
14 try {
15 timeline.pause();
16 Thread.sleep(2000);
17 timeline.resume();
18 } catch (Exception e) {
19 e.printStackTrace();
20 }
21 System.out.println(
22 "Elapsed: " + timeline.getElapsedSeconds() + " seconds");
23 try {
24 timeline.pause();
25 Thread.sleep(2000);
26 timeline.resume();
27 } catch (Exception e) {
28 e.printStackTrace();
29 }
30 System.out.println(timeline.getElapsedSeconds() + " seconds");
31
32 while (!timeline.isDeadlineReached()) {
33 System.out.println(
34 "Elapsed: " + timeline.getElapsedSeconds() + " seconds");
35 }
36 }
37
38}
Note: See TracBrowser for help on using the repository browser.