Search in sources :

Example 6 with ExternalResourceDriver

use of org.apache.flink.api.common.externalresource.ExternalResourceDriver in project flink by apache.

the class ExternalResourceUtilsTest method testNotConfiguredFactoryClass.

@Test
public void testNotConfiguredFactoryClass() {
    final Configuration config = new Configuration();
    final Map<Class<?>, Iterator<?>> plugins = new HashMap<>();
    plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory()));
    final PluginManager testingPluginManager = new TestingPluginManager(plugins);
    config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1));
    final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager);
    assertThat(externalResourceDrivers.entrySet(), is(empty()));
}
Also used : TestingPluginManager(org.apache.flink.core.plugin.TestingPluginManager) PluginManager(org.apache.flink.core.plugin.PluginManager) Configuration(org.apache.flink.configuration.Configuration) HashMap(java.util.HashMap) Iterator(java.util.Iterator) TestingPluginManager(org.apache.flink.core.plugin.TestingPluginManager) ExternalResourceDriver(org.apache.flink.api.common.externalresource.ExternalResourceDriver) Test(org.junit.Test)

Aggregations

ExternalResourceDriver (org.apache.flink.api.common.externalresource.ExternalResourceDriver)6 HashMap (java.util.HashMap)5 Configuration (org.apache.flink.configuration.Configuration)4 PluginManager (org.apache.flink.core.plugin.PluginManager)4 TestingPluginManager (org.apache.flink.core.plugin.TestingPluginManager)4 Test (org.junit.Test)4 Iterator (java.util.Iterator)3 VisibleForTesting (org.apache.flink.annotation.VisibleForTesting)2 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 ExternalResourceDriverFactory (org.apache.flink.api.common.externalresource.ExternalResourceDriverFactory)1 ExternalResourceInfo (org.apache.flink.api.common.externalresource.ExternalResourceInfo)1 DelegatingConfiguration (org.apache.flink.configuration.DelegatingConfiguration)1