// Path: src/main/java/com/tngtech/propertyloader/exception/PropertyLoaderException.java
// public class PropertyLoaderException extends RuntimeException {
// 
//     public PropertyLoaderException(String message) {
//         super(message);
//     }
// }


import com.tngtech.propertyloader.exception.PropertyLoaderException;
import org.junit.Test;
import java.net.URL;
import java.util.Properties;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

    @Test
    public void testLoadingFromCurrentDirectoryOnly() {
        String[] args = {"toBeIncluded",
                "src/test/resources/testUmlauts",
                "/src/test/resources/abc.def",
        };

        PropertyLoader propertyLoader = new PropertyLoader()
                .atCurrentDirectory()
                .addDefaultSuffixes()
                .withDefaultFilters();
        Properties properties = propertyLoader.load(args);
        assertFalse(properties.containsKey("definedInIncluded")); //no loading from classpath etc
        assertTrue(properties.containsKey("umlauts")); //correct path relative to current directory
        assertFalse(properties.containsKey("abc")); //not found because of leading slash but not a correct path
    }

    @Test
    public void testLoadingWithDefaultConfig_Loads_Includes_And_Resolves_Variables() {
        String[] args = {"testForIncludesAndVariableResolving"};

        PropertyLoader propertyLoader = new PropertyLoader().withDefaultConfig();
        Properties properties = propertyLoader.load(args);

        assertEquals("Hello, World!", properties.getProperty("b")); //b is variable a
        assertEquals("yes", properties.getProperty("xxx")); //xxx is defined in toBeIncluded
        assertEquals("prod-blub", properties.getProperty("testInclude.prod")); //has to be defined, otherwise filter warns
    }

// Path: src/main/java/com/tngtech/propertyloader/exception/PropertyLoaderException.java
// public class PropertyLoaderException extends RuntimeException {
// 
//     public PropertyLoaderException(String message) {
//         super(message);
//     }
// }


// Path: src/test/java/com/tngtech/propertyloader/PropertyLoaderIntegrationTest.java
import com.tngtech.propertyloader.exception.PropertyLoaderException;
import org.junit.Test;
import java.net.URL;
import java.util.Properties;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;


    @Test
    public void testLoadingFromCurrentDirectoryOnly() {
        String[] args = {"toBeIncluded",
                "src/test/resources/testUmlauts",
                "/src/test/resources/abc.def",
        };

        PropertyLoader propertyLoader = new PropertyLoader()
                .atCurrentDirectory()
                .addDefaultSuffixes()
                .withDefaultFilters();
        Properties properties = propertyLoader.load(args);
        assertFalse(properties.containsKey("definedInIncluded")); //no loading from classpath etc
        assertTrue(properties.containsKey("umlauts")); //correct path relative to current directory
        assertFalse(properties.containsKey("abc")); //not found because of leading slash but not a correct path
    }

    @Test
    public void testLoadingWithDefaultConfig_Loads_Includes_And_Resolves_Variables() {
        String[] args = {"testForIncludesAndVariableResolving"};

        PropertyLoader propertyLoader = new PropertyLoader().withDefaultConfig();
        Properties properties = propertyLoader.load(args);

        assertEquals("Hello, World!", properties.getProperty("b")); //b is variable a
        assertEquals("yes", properties.getProperty("xxx")); //xxx is defined in toBeIncluded
        assertEquals("prod-blub", properties.getProperty("testInclude.prod")); //has to be defined, otherwise filter warns
    }

    @Test(expected = PropertyLoaderException.class)