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

Last change on this file since 343 was 343, checked in by Tim Baarslag, 4 years ago

Fixed all errors in all 2018 agents

File size: 879 bytes
Line 
1package negotiator;
2
3import org.junit.Test;
4
5import genius.core.timeline.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.