1   /*
2    * @(#) ModulusFilterTest.java Sep 28, 2004 Copyright (c) 2002-2005 Delft
3    * University of Technology Jaffalaan 5, 2628 BX Delft, the Netherlands. All
4    * rights reserved. This software is proprietary information of Delft University
5    * of Technology The code is published under the Lesser General Public License
6    */
7   package nl.tudelft.simulation.language.filters;
8   
9   import junit.framework.Assert;
10  import junit.framework.TestCase;
11  
12  /***
13   * Tests the ModulusFilter.
14   * <p>
15   * (c) copyright 2002-2005 <a href="http://www.simulation.tudelft.nl">Delft
16   * University of Technology </a>, the Netherlands.
17   * <p>
18   * See for project information <a
19   * href="http://www.simulation.tudelft.nl/dsol/language">www.simulation.tudelft.nl/language
20   * </a> <br>
21   * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
22   * General Public License (LGPL) </a>, no warranty
23   * 
24   * @author <a
25   *         href="http://web.eur.nl/fbk/dep/dep1/Introduction/Staff/People/Lang">Niels
26   *         Lang </a><a href="http://www.peter-jacobs.com/index.htm">Peter
27   *         Jacobs </a>
28   * @version 1.2 Sep 28, 2004
29   * @since 1.5
30   */
31  public class ModulusFilterTest extends TestCase
32  {
33      /***
34       * constructs a new ZeroFilterTest
35       */
36      public ModulusFilterTest()
37      {
38          this("test");
39      }
40  
41      /***
42       * constructs a new ZeroFilterTest
43       * 
44       * @param arg0
45       */
46      public ModulusFilterTest(String arg0)
47      {
48          super(arg0);
49      }
50  
51      /***
52       * tests the ZeroFilter.
53       */
54      public void test()
55      {
56          Filterinterface filter = new ModulusFilter(10);
57          for (int i = 0; i < 100; i++)
58          {
59              if (i % 10 == 0)
60              {
61                  Assert.assertTrue(filter.accept("entry"));
62              } else
63              {
64                  Assert.assertFalse(filter.accept("entry"));
65              }
66          }
67      }
68  }