// Path: src/main/java/net/seleucus/wsp/util/WSConstants.java
// public class WSConstants {
// 
//     public static final String LOGGING_REGEX_FOR_EACH_REQUEST = "logging-regex-for-each-request";
//     public static final String ACCESS_LOG_FILE_LOCATION = "access-log-file-location";
//     
// }


import static org.junit.Assert.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Properties;
import net.seleucus.wsp.util.WSConstants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
		File configFile = new File(WSConfiguration.CONFIG_PATH);
		// Running the constructor, creates the file
		// "webspa-config.properties" if one does 
		// not exist
		assertTrue(configFile.exists());
				
	}
	
	@Test
	public void testWSConfigurationShouldNotCreateAFileIfOneExists() throws IOException {
		
		new WSConfiguration();
		new WSConfiguration();
		File configFile = new File(WSConfiguration.CONFIG_PATH);
		// Call the constructor twice, thus creating the file
		assertTrue(configFile.exists());

	}
	
	@Test
	public void testWSConfigurationHasTheAccessLogFileLocationProperty() throws IOException {
		
		new WSConfiguration();
		File configFile = new File(WSConfiguration.CONFIG_PATH);

		FileInputStream in = new FileInputStream(configFile);
		Properties configProperties = new Properties();
		configProperties.load(in);
		in.close();
		
// Path: src/main/java/net/seleucus/wsp/util/WSConstants.java
// public class WSConstants {
// 
//     public static final String LOGGING_REGEX_FOR_EACH_REQUEST = "logging-regex-for-each-request";
//     public static final String ACCESS_LOG_FILE_LOCATION = "access-log-file-location";
//     
// }


// Path: src/test/java/net/seleucus/wsp/config/WSConfigurationTest.java
import static org.junit.Assert.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Properties;
import net.seleucus.wsp.util.WSConstants;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

		File configFile = new File(WSConfiguration.CONFIG_PATH);
		// Running the constructor, creates the file
		// "webspa-config.properties" if one does 
		// not exist
		assertTrue(configFile.exists());
				
	}
	
	@Test
	public void testWSConfigurationShouldNotCreateAFileIfOneExists() throws IOException {
		
		new WSConfiguration();
		new WSConfiguration();
		File configFile = new File(WSConfiguration.CONFIG_PATH);
		// Call the constructor twice, thus creating the file
		assertTrue(configFile.exists());

	}
	
	@Test
	public void testWSConfigurationHasTheAccessLogFileLocationProperty() throws IOException {
		
		new WSConfiguration();
		File configFile = new File(WSConfiguration.CONFIG_PATH);

		FileInputStream in = new FileInputStream(configFile);
		Properties configProperties = new Properties();
		configProperties.load(in);
		in.close();
		
		assertTrue(configProperties.containsKey(WSConstants.ACCESS_LOG_FILE_LOCATION));