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