1   /*
2    * This file is part of AceLogger.
3    * 
4    * AceLogger is free software: you can redistribute it and/or modify it under the terms of the GNU
5    * Lesser General Public License as published by the Free Software Foundation, either version 3 of
6    * the License, or (at your option) any later version.
7    * 
8    * AceLogger is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
9    * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10   * Lesser General Public License for more details.
11   * 
12   * You should have received a copy of the GNU Lesser General Public License along with AceLogger.
13   * If not, see <http://www.gnu.org/licenses/lgpl-3.0.html>.
14   */
15  package net.sourceforge.acelogger.filter.test;
16  
17  import org.testng.annotations.Test;
18  
19  import net.sourceforge.acelogger.level.LogLevel;
20  import net.sourceforge.acelogger.level.filter.BaseLevelFilter;
21  
22  import static org.testng.Assert.assertEquals;
23  
24  /**
25   * TODO: Create Doc.
26   * 
27   * @author Zardi (https://sourceforge.net/users/daniel_zardi)
28   * @version 1.0.0
29   * @since 1.0.0
30   */
31  @Test
32  public class BaseLevelFilterTest {
33  
34  	private static class LevelFilterTester extends BaseLevelFilter {
35  
36  		public LevelFilterTester(String identifier) {
37  			super(identifier);
38  		}
39  
40  		public boolean isSuitable(LogLevel level) {
41  			return false;
42  		}
43  
44  	}
45  
46  	@Test
47  	public void testSetIdentifier() {
48  		LevelFilterTester tester = new LevelFilterTester("filter.tester");
49  		assertEquals(tester.getIdentifier(), "filter.tester");
50  	}
51  
52  	@Test
53  	public void testSetNullIdentifier() {
54  		LevelFilterTester tester = new LevelFilterTester(null);
55  		assertEquals(tester.getIdentifier(), "");
56  	}
57  
58  }