Search in sources :

Example 1 with ConfigurationMemberInfo

use of com.oracle.svm.configure.config.ConfigurationMemberInfo in project graal by oracle.

the class TypeMethodsWithFlagsTest method doTest.

void doTest() {
    TypeConfiguration currentConfigWithoutPrevious = TypeConfiguration.copyAndSubtract(currentConfig, previousConfig);
    String name = getTypeName();
    ConfigurationType configurationType = currentConfigWithoutPrevious.get(ConfigurationCondition.alwaysTrue(), name);
    if (methodsThatMustExist.size() == 0) {
        Assert.assertNull("Generated configuration type " + name + " exists. Expected it to be cleared as it is empty.", configurationType);
    } else {
        Assert.assertNotNull("Generated configuration type " + name + " does not exist. Has the test code changed?", configurationType);
        for (Map.Entry<ConfigurationMethod, ConfigurationMemberDeclaration> methodEntry : methodsThatMustExist.entrySet()) {
            ConfigurationMemberDeclaration kind = ConfigurationType.TestBackdoor.getMethodInfoIfPresent(configurationType, methodEntry.getKey()).getDeclaration();
            Assert.assertNotNull("Method " + methodEntry.getKey() + " unexpectedly NOT found in the new configuration.", kind);
            Assert.assertEquals("Method " + methodEntry.getKey() + " contains a different kind than expected in the new configuration.", kind, methodEntry.getValue());
        }
        for (Map.Entry<ConfigurationMethod, ConfigurationMemberDeclaration> methodEntry : methodsThatMustNotExist.entrySet()) {
            ConfigurationMemberInfo kind = ConfigurationType.TestBackdoor.getMethodInfoIfPresent(configurationType, methodEntry.getKey());
            Assert.assertNull("Method " + methodEntry.getKey() + " unexpectedly found in the new configuration.", kind);
        }
    }
}
Also used : ConfigurationType(com.oracle.svm.configure.config.ConfigurationType) ConfigurationMethod(com.oracle.svm.configure.config.ConfigurationMethod) ConfigurationMemberInfo(com.oracle.svm.configure.config.ConfigurationMemberInfo) ConfigurationMemberDeclaration(com.oracle.svm.configure.config.ConfigurationMemberInfo.ConfigurationMemberDeclaration) TypeConfiguration(com.oracle.svm.configure.config.TypeConfiguration) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

ConfigurationMemberInfo (com.oracle.svm.configure.config.ConfigurationMemberInfo)1 ConfigurationMemberDeclaration (com.oracle.svm.configure.config.ConfigurationMemberInfo.ConfigurationMemberDeclaration)1 ConfigurationMethod (com.oracle.svm.configure.config.ConfigurationMethod)1 ConfigurationType (com.oracle.svm.configure.config.ConfigurationType)1 TypeConfiguration (com.oracle.svm.configure.config.TypeConfiguration)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1