@Test
  public void testContinueOnSomeDbDirectoriesMissing() throws Exception {
    File targetDir1 = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
    File targetDir2 = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());

    try {
      assertTrue(targetDir1.mkdirs());
      assertTrue(targetDir2.mkdirs());

      if (!targetDir1.setWritable(false, false)) {
        System.err.println(
            "Cannot execute 'testContinueOnSomeDbDirectoriesMissing' because cannot mark directory non-writable");
        return;
      }

      RocksDBStateBackend rocksDbBackend = new RocksDBStateBackend(TEMP_URI);
      rocksDbBackend.setDbStoragePaths(targetDir1.getAbsolutePath(), targetDir2.getAbsolutePath());

      try {
        rocksDbBackend.initializeForJob(getMockEnvironment(), "foobar", IntSerializer.INSTANCE);
      } catch (Exception e) {
        e.printStackTrace();
        fail("Backend initialization failed even though some paths were available");
      }
    } finally {
      //noinspection ResultOfMethodCallIgnored
      targetDir1.setWritable(true, false);
      FileUtils.deleteDirectory(targetDir1);
      FileUtils.deleteDirectory(targetDir2);
    }
  }
  @Test
  public void testSetDbPath() throws Exception {
    RocksDBStateBackend rocksDbBackend = new RocksDBStateBackend(TEMP_URI);

    assertNull(rocksDbBackend.getDbStoragePaths());

    rocksDbBackend.setDbStoragePath("/abc/def");
    assertArrayEquals(new String[] {"/abc/def"}, rocksDbBackend.getDbStoragePaths());

    rocksDbBackend.setDbStoragePath(null);
    assertNull(rocksDbBackend.getDbStoragePaths());

    rocksDbBackend.setDbStoragePaths("/abc/def", "/uvw/xyz");
    assertArrayEquals(new String[] {"/abc/def", "/uvw/xyz"}, rocksDbBackend.getDbStoragePaths());

    //noinspection NullArgumentToVariableArgMethod
    rocksDbBackend.setDbStoragePaths(null);
    assertNull(rocksDbBackend.getDbStoragePaths());
  }
 @Test(expected = IllegalArgumentException.class)
 public void testSetNullPaths() throws Exception {
   RocksDBStateBackend rocksDbBackend = new RocksDBStateBackend(TEMP_URI);
   rocksDbBackend.setDbStoragePaths();
 }