org.apache.flink.core.fs.UnsupportedFileSystemSchemeException Java Examples

The following examples show how to use org.apache.flink.core.fs.UnsupportedFileSystemSchemeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FilesystemSchemeConfigTest.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
@Test
public void testExplicitlySetToOther() throws Exception {
	final Configuration conf = new Configuration();
	conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, "otherFS://localhost:1234/");
	FileSystem.initialize(conf);

	URI justPath = new URI(tempFolder.newFile().toURI().getPath());
	assertNull(justPath.getScheme());

	try {
		FileSystem.get(justPath);
		fail("should have failed with an exception");
	}
	catch (UnsupportedFileSystemSchemeException e) {
		assertTrue(e.getMessage().contains("otherFS"));
	}
}
 
Example #2
Source File: FilesystemSchemeConfigTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testExplicitlySetToOther() throws Exception {
	final Configuration conf = new Configuration();
	conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, "otherFS://localhost:1234/");
	FileSystem.initialize(conf);

	URI justPath = new URI(tempFolder.newFile().toURI().getPath());
	assertNull(justPath.getScheme());

	try {
		FileSystem.get(justPath);
		fail("should have failed with an exception");
	}
	catch (UnsupportedFileSystemSchemeException e) {
		assertTrue(e.getMessage().contains("otherFS"));
	}
}
 
Example #3
Source File: FilesystemSchemeConfigTest.java    From flink with Apache License 2.0 6 votes vote down vote up
@Test
public void testExplicitlySetToOther() throws Exception {
	final Configuration conf = new Configuration();
	conf.setString(CoreOptions.DEFAULT_FILESYSTEM_SCHEME, "otherFS://localhost:1234/");
	FileSystem.initialize(conf);

	URI justPath = new URI(tempFolder.newFile().toURI().getPath());
	assertNull(justPath.getScheme());

	try {
		FileSystem.get(justPath);
		fail("should have failed with an exception");
	}
	catch (UnsupportedFileSystemSchemeException e) {
		assertTrue(e.getMessage().contains("otherFS"));
	}
}
 
Example #4
Source File: BucketingSinkFsInitTest.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
@Test(expected = UnsupportedFileSystemSchemeException.class)
public void testInitForUnsupportedFileSystem() throws Exception {
	final Path path = new Path("nofs://localhost:51234/some/path/");
	BucketingSink.createHadoopFileSystem(path, null);
}
 
Example #5
Source File: BucketingSinkFsInitTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test(expected = UnsupportedFileSystemSchemeException.class)
public void testInitForUnsupportedFileSystem() throws Exception {
	final Path path = new Path("nofs://localhost:51234/some/path/");
	BucketingSink.createHadoopFileSystem(path, null);
}
 
Example #6
Source File: BucketingSinkFsInitTest.java    From flink with Apache License 2.0 4 votes vote down vote up
@Test(expected = UnsupportedFileSystemSchemeException.class)
public void testInitForUnsupportedFileSystem() throws Exception {
	final Path path = new Path("nofs://localhost:51234/some/path/");
	BucketingSink.createHadoopFileSystem(path, null);
}