Search in sources :

Example 11 with ResourceConfig

use of com.hazelcast.jet.config.ResourceConfig in project hazelcast-jet by hazelcast.

the class ResourceConfigTest method testAddResource_with_File.

@Test
public void testAddResource_with_File() throws Exception {
    JobConfig config = new JobConfig();
    File file = new File("/path/to/resource");
    config.addResource(file);
    ResourceConfig resourceConfig = config.getResourceConfigs().iterator().next();
    assertEquals("resource", resourceConfig.getId());
    assertFalse(resourceConfig.isArchive());
    assertEquals(file.toURI().toURL(), resourceConfig.getUrl());
}
Also used : ResourceConfig(com.hazelcast.jet.config.ResourceConfig) File(java.io.File) JobConfig(com.hazelcast.jet.config.JobConfig) Test(org.junit.Test)

Aggregations

ResourceConfig (com.hazelcast.jet.config.ResourceConfig)11 JobConfig (com.hazelcast.jet.config.JobConfig)10 Test (org.junit.Test)10 File (java.io.File)6 URL (java.net.URL)3 JetException (com.hazelcast.jet.JetException)1 Util.idToString (com.hazelcast.jet.impl.util.Util.idToString)1 BufferedInputStream (java.io.BufferedInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 JarInputStream (java.util.jar.JarInputStream)1