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.factory.test;
16  
17  import java.util.List;
18  
19  import org.testng.annotations.Test;
20  
21  import net.sourceforge.acelogger.appender.Appender;
22  import net.sourceforge.acelogger.factory.AppenderFactory;
23  
24  import static org.testng.Assert.assertTrue;
25  
26  /**
27   * TODO: Create Doc.
28   * 
29   * @author Zardi (https://sourceforge.net/users/daniel_zardi)
30   * @version 1.0.0
31   * @since 1.0.0
32   */
33  @Test
34  public class AppenderFactoryTest {
35  
36  	@Test
37  	public void testSetNullAppender() {
38  		List<Appender> previouslyRegistered = AppenderFactory.getRegisteredAppenders();
39  		Appender register = AppenderFactory.registerAppender(null);
40  		List<Appender> currentlyRegistered = AppenderFactory.getRegisteredAppenders();
41  		assertTrue(register.equals(AppenderFactory.getDefaultAppender())
42  				&& currentlyRegistered.containsAll(previouslyRegistered)
43  				&& currentlyRegistered.size() == previouslyRegistered.size());
44  	}
45  
46  }