package net.ssehub.kernel_haven.test_utils;

import java.io.File;
import java.util.Properties;

import net.ssehub.kernel_haven.SetUpException;
import net.ssehub.kernel_haven.config.Configuration;
import net.ssehub.kernel_haven.config.DefaultSettings;

/**
 * A configuration that does no consistency checks. Useful for test cases.
 * 
 * @author Adam
 * @author Moritz
 *
 */
public class TestConfiguration extends Configuration {

    /**
     * Creates a test configuration with no consistency checks.
     * 
     * @param properties The properties to generate this from.
     * 
     * @throws SetUpException Never thrown.
     */
    public TestConfiguration(Properties properties) throws SetUpException {
        super(properties, false);
        
        DefaultSettings.registerAllSettings(this);
        
//        // general
//        this.resourceDir = readFileProperty("resource_dir", new FileProps());
//        this.outputDir = readFileProperty("output_dir", new FileProps());
//        this.pluginsDir = readFileProperty("plugins_dir", new FileProps());
////        this.cacheDir = readFileProperty("cache_dir", new FileProps());
//        
//        this.logConsole = Boolean.parseBoolean(getProperty("log.console", "true"));
//        this.logFile = Boolean.parseBoolean(getProperty("log.file", "false"));
//        this.logError = Boolean.parseBoolean(getProperty("log.error", "true"));
//        this.logWarning = Boolean.parseBoolean(getProperty("log.warning", "true"));
//        this.logInfo = Boolean.parseBoolean(getProperty("log.info", "true"));
//        this.logDebug = Boolean.parseBoolean(getProperty("log.debug", "false"));
//        this.logDir = readFileProperty("log.dir", new FileProps());
//        
//        this.archive = Boolean.parseBoolean(getProperty("archive", "false"));
//        this.archiveDir = readFileProperty("archive.dir", new FileProps());
//        this.archiveCacheDir = Boolean.parseBoolean(getProperty("archive.cache_dir", "false"));
//        this.archiveResDir = Boolean.parseBoolean(getProperty("archive.res_dir", "false"));
//        this.archiveSourceTree = Boolean.parseBoolean(getProperty("archive.source_tree", "false"));
//        
//        // analysis
//        this.analysisClassName = getProperty("analysis.class");
//        List<String> list = readList("analysis.components.log");
//        this.loggingAnalyissComponents = new HashSet<>(list == null ? new LinkedList<>() : list);
//        
//        // common extractor stuff
//        this.sourceTree = readFileProperty("source_tree", new FileProps());
//        this.arch = getProperty("arch");
//        
//        // code
//        // TODO
////        this.codeProviderTimeout = readLong("code.provider.timeout", 0);
//        this.codeExtractorClassName = getProperty("code.extractor.class");
////        this.codeCacheWrite = Boolean.parseBoolean(getProperty("code.provider.cache.write", "false"));
////        this.codeCacheRead = Boolean.parseBoolean(getProperty("code.provider.cache.read", "false"));
////        String fileListSetting = getProperty("code.extractor.files", "");
////        String[] fileListSettingParts = fileListSetting.split(",");
////        this.codeExtractorFiles = new File[fileListSettingParts.length];
////        for (int i = 0; i < this.codeExtractorFiles.length; i++) {
////            this.codeExtractorFiles[i] = new File(fileListSettingParts[i].trim());
////        }
////        this.codeExtractorFilenamePattern = Pattern.compile(getProperty("code.extractor.file_regex", ".*\\.c"));
////        this.codeExtractorThreads = (int) readLong("code.extractor.threads", 0);
//        
//        // build
////        this.buildProviderTimeout = readLong("build.provider.timeout", 0);
////        this.buildCacheWrite = Boolean.parseBoolean(getProperty("build.provider.cache.write", "false"));
////        this.buildCacheRead = Boolean.parseBoolean(getProperty("build.provider.cache.read", "false"));
//        this.buildExtractorClassName = getProperty("build.extractor.class");
//        
//        // variabiltiy
//        // TODO
////        this.variabilityProviderTimeout = readLong("variability.provider.timeout", 0);
////        this.variabilityCacheWrite = Boolean.parseBoolean(getProperty("variability.provider.cache.write", "false"));
////        this.variabilityCacheRead = Boolean.parseBoolean(getProperty("variability.provider.cache.read", "false"));
//        this.variabilityExtractorClassName = getProperty("variability.extractor.class");
    }
    
    @Override
    public void setPropertyFile(File propertyFile) {
        super.setPropertyFile(propertyFile);
    }
    
}

@@ -802,3718 +802,8 @@
 s);%0A
-        %0A//        // general%0A//        this.resourceDir = readFileProperty(%22resource_dir%22, new FileProps());%0A//        this.outputDir = readFileProperty(%22output_dir%22, new FileProps());%0A//        this.pluginsDir = readFileProperty(%22plugins_dir%22, new FileProps());%0A////        this.cacheDir = readFileProperty(%22cache_dir%22, new FileProps());%0A//        %0A//        this.logConsole = Boolean.parseBoolean(getProperty(%22log.console%22, %22true%22));%0A//        this.logFile = Boolean.parseBoolean(getProperty(%22log.file%22, %22false%22));%0A//        this.logError = Boolean.parseBoolean(getProperty(%22log.error%22, %22true%22));%0A//        this.logWarning = Boolean.parseBoolean(getProperty(%22log.warning%22, %22true%22));%0A//        this.logInfo = Boolean.parseBoolean(getProperty(%22log.info%22, %22true%22));%0A//        this.logDebug = Boolean.parseBoolean(getProperty(%22log.debug%22, %22false%22));%0A//        this.logDir = readFileProperty(%22log.dir%22, new FileProps());%0A//        %0A//        this.archive = Boolean.parseBoolean(getProperty(%22archive%22, %22false%22));%0A//        this.archiveDir = readFileProperty(%22archive.dir%22, new FileProps());%0A//        this.archiveCacheDir = Boolean.parseBoolean(getProperty(%22archive.cache_dir%22, %22false%22));%0A//        this.archiveResDir = Boolean.parseBoolean(getProperty(%22archive.res_dir%22, %22false%22));%0A//        this.archiveSourceTree = Boolean.parseBoolean(getProperty(%22archive.source_tree%22, %22false%22));%0A//        %0A//        // analysis%0A//        this.analysisClassName = getProperty(%22analysis.class%22);%0A//        List%3CString%3E list = readList(%22analysis.components.log%22);%0A//        this.loggingAnalyissComponents = new HashSet%3C%3E(list == null ? new LinkedList%3C%3E() : list);%0A//        %0A//        // common extractor stuff%0A//        this.sourceTree = readFileProperty(%22source_tree%22, new FileProps());%0A//        this.arch = getProperty(%22arch%22);%0A//        %0A//        // code%0A//        // TODO%0A////        this.codeProviderTimeout = readLong(%22code.provider.timeout%22, 0);%0A//        this.codeExtractorClassName = getProperty(%22code.extractor.class%22);%0A////        this.codeCacheWrite = Boolean.parseBoolean(getProperty(%22code.provider.cache.write%22, %22false%22));%0A////        this.codeCacheRead = Boolean.parseBoolean(getProperty(%22code.provider.cache.read%22, %22false%22));%0A////        String fileListSetting = getProperty(%22code.extractor.files%22, %22%22);%0A////        String%5B%5D fileListSettingParts = fileListSetting.split(%22,%22);%0A////        this.codeExtractorFiles = new File%5BfileListSettingParts.length%5D;%0A////        for (int i = 0; i %3C this.codeExtractorFiles.length; i++) %7B%0A////            this.codeExtractorFiles%5Bi%5D = new File(fileListSettingParts%5Bi%5D.trim());%0A////        %7D%0A////        this.codeExtractorFilenamePattern = Pattern.compile(getProperty(%22code.extractor.file_regex%22, %22.*%5C%5C.c%22));%0A////        this.codeExtractorThreads = (int) readLong(%22code.extractor.threads%22, 0);%0A//        %0A//        // build%0A////        this.buildProviderTimeout = readLong(%22build.provider.timeout%22, 0);%0A////        this.buildCacheWrite = Boolean.parseBoolean(getProperty(%22build.provider.cache.write%22, %22false%22));%0A////        this.buildCacheRead = Boolean.parseBoolean(getProperty(%22build.provider.cache.read%22, %22false%22));%0A//        this.buildExtractorClassName = getProperty(%22build.extractor.class%22);%0A//        %0A//        // variabiltiy%0A//        // TODO%0A////        this.variabilityProviderTimeout = readLong(%22variability.provider.timeout%22, 0);%0A////        this.variabilityCacheWrite = Boolean.parseBoolean(getProperty(%22variability.provider.cache.write%22, %22false%22));%0A////        this.variabilityCacheRead = Boolean.parseBoolean(getProperty(%22variability.provider.cache.read%22, %22false%22));%0A//        this.variabilityExtractorClassName = getProperty(%22variability.extractor.class%22);%0A
     

Remove unneded, old, commented-out code from TestConfiguration