1   /**
2    * Logback: the generic, reliable, fast and flexible logging framework.
3    * 
4    * Copyright (C) 2000-2008, QOS.ch
5    * 
6    * This library is free software, you can redistribute it and/or modify it under
7    * the terms of the GNU Lesser General Public License as published by the Free
8    * Software Foundation.
9    */
10  package ch.qos.logback.core.sift;
11  
12  import static org.junit.Assert.assertEquals;
13  
14  import org.junit.Ignore;
15  import org.junit.Test;
16  
17  public class ScenarioBasedAppenderTrackerTest {
18  
19    Simulator simulator;
20  
21    void verify() {
22      AppenderTracker at = simulator.appenderTracker;
23      AppenderTracker t_at = simulator.t_appenderTracker;
24      //List<String> resultKeys = at.keyList();
25      //List<String> witnessKeys = t_at.keyList();
26      assertEquals(t_at.keyList(), at.keyList());
27    }
28  
29    @Test
30    public void shortTest() {
31      simulator = new Simulator(20, AppenderTracker.THRESHOLD / 2);
32      simulator.buildScenario(200);
33      simulator.simulate();
34      verify();
35    }
36  
37    @Test
38    public void mediumTest() {
39      simulator = new Simulator(100, AppenderTracker.THRESHOLD / 2);
40      simulator.buildScenario(20000);
41      simulator.simulate();
42      verify();
43    }
44  
45    @Test
46    @Ignore
47    public void longetTest() {
48      simulator = new Simulator(100, AppenderTracker.THRESHOLD / 200);
49      simulator.buildScenario(2000000);
50      simulator.simulate();
51      verify();
52    }
53  }