View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.joran.spi;
15  
16  import org.junit.jupiter.api.Test;
17  
18  import java.io.File;
19  import java.net.MalformedURLException;
20  import java.net.URL;
21  
22  import static org.junit.jupiter.api.Assertions.assertEquals;
23  
24  /**
25   * @author Ceki Gülcü
26   */
27  public class ConfigurationWatchListTest {
28  
29      @Test
30      // See http://jira.qos.ch/browse/LBCORE-119
31      public void fileToURLAndBack() throws MalformedURLException {
32          File file = new File("a b.xml");
33          URL url = file.toURI().toURL();
34          ConfigurationWatchList cwl = new ConfigurationWatchList();
35          File back = cwl.convertToFile(url);
36          assertEquals(file.getName(), back.getName());
37      }
38  }