use of org.graalvm.nativeimage.impl.ConfigurationCondition in project graal by oracle.
the class ProxyConfigurationParser method parseWithConditionalConfig.
private void parseWithConditionalConfig(Map<String, Object> proxyConfigObject) {
checkAttributes(proxyConfigObject, "proxy descriptor object", Collections.singleton("interfaces"), Collections.singletonList(CONDITIONAL_KEY));
ConfigurationCondition condition = parseCondition(proxyConfigObject);
parseInterfaceList(condition, asList(proxyConfigObject.get("interfaces"), "\"interfaces\" must be an array of fully qualified interface names"));
}
use of org.graalvm.nativeimage.impl.ConfigurationCondition in project graal by oracle.
the class TypeMethodsWithFlagsTest method doTestSerializationConfig.
private static void doTestSerializationConfig(SerializationConfiguration serializationConfig) {
ConfigurationCondition condition = ConfigurationCondition.alwaysTrue();
Assert.assertFalse(serializationConfig.contains(condition, "seenType", null));
Assert.assertTrue(serializationConfig.contains(condition, "unseenType", null));
}
use of org.graalvm.nativeimage.impl.ConfigurationCondition in project graal by oracle.
the class TypeMethodsWithFlagsTest method doTestProxyConfig.
private static void doTestProxyConfig(ProxyConfiguration proxyConfig) {
ConfigurationCondition condition = ConfigurationCondition.alwaysTrue();
Assert.assertFalse(proxyConfig.contains(condition, "testProxySeenA", "testProxySeenB", "testProxySeenC"));
Assert.assertTrue(proxyConfig.contains(condition, "testProxyUnseen"));
}
use of org.graalvm.nativeimage.impl.ConfigurationCondition in project graal by oracle.
the class ResourceConfigurationTest method anyResourceMatches.
@Test
public void anyResourceMatches() {
ResourceConfiguration rc = new ResourceConfiguration();
ConfigurationCondition defaultCond = ConfigurationCondition.alwaysTrue();
rc.addResourcePattern(defaultCond, ".*/Resource.*txt$");
Assert.assertTrue(rc.anyResourceMatches("com/my/app/Resource0.txt"));
Assert.assertTrue(rc.anyResourceMatches("com/my/app/Resource1.txt"));
Assert.assertTrue(rc.anyResourceMatches("/Resource2.txt"));
Assert.assertTrue(rc.anyResourceMatches("/Resource3.txt"));
rc.ignoreResourcePattern(defaultCond, ".*/Resource2.txt$");
Assert.assertTrue(rc.anyResourceMatches("com/my/app/Resource0.txt"));
Assert.assertTrue(rc.anyResourceMatches("com/my/app/Resource1.txt"));
Assert.assertFalse(rc.anyResourceMatches("/Resource2.txt"));
Assert.assertTrue(rc.anyResourceMatches("/Resource3.txt"));
}
Aggregations