package org.ovirt.engine.core.common.queries;

import static org.junit.Assert.assertFalse;

import java.util.HashSet;
import java.util.Set;

import org.junit.Test;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConfigValuesTest {
    private static final Logger log = LoggerFactory.getLogger(ConfigValuesTest.class);
    private static final Set<String> configValuesEnumNames = getConfigValuesEnumNames();

    private static Set<String> getConfigValuesEnumNames() {
        Set<String> configValuesEnumNames = new HashSet<String>();
        for (ConfigValues configValue : ConfigValues.values()) {
            configValuesEnumNames.add(configValue.toString());
        }
        return configValuesEnumNames;
    }

    @Test
    public void findMissingEnumNames() {
        // Find missing ConfigurationValues enum names in ConfigValues enum
        boolean missingKey = false;
        for (ConfigurationValues configValue : ConfigurationValues.values()) {
            if (!configValuesEnumNames.contains(configValue.toString())) {
                log.error("Found missing key: {}", configValue);
                missingKey = true;
                break;
            }
        }

        assertFalse("Found missing key: ", missingKey);
    }
}

@@ -77,20 +77,19 @@
 t.assert
-Fals
+Tru
 e;%0A%0Aimpo
@@ -131,16 +131,42 @@
 til.Set;
+%0Aimport java.util.TreeSet;
 %0A%0Aimport
@@ -955,15 +955,32 @@
     
-boolean
+Set%3CConfigurationValues%3E
  mis
@@ -990,16 +990,46 @@
 gKey
+s
  = 
-false
+new TreeSet%3CConfigurationValues%3E()
 ;%0A  
@@ -1275,38 +1275,26 @@
 gKey
- = true;%0A                break
+s.add(configValue)
 ;%0A  
@@ -1334,12 +1334,11 @@
 sert
-Fals
+Tru
 e(%22F
@@ -1357,11 +1357,26 @@
  key
+s
 : %22
+ + missingKeys
 , mi
@@ -1383,16 +1383,27 @@
 ssingKey
+s.isEmpty()
 );%0A    %7D

Make ConfigValuesTest more informative