Java Code Examples for org.apache.hadoop.fs.swift.util.SwiftTestUtils#assertIsFile()

The following examples show how to use org.apache.hadoop.fs.swift.util.SwiftTestUtils#assertIsFile() . 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: TestSwiftFileSystemBasicOps.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testFileStatus() throws Throwable {
  Path path = new Path("/test/FileStatus");
  try {
    String text = "Testing File Status "
            + System.currentTimeMillis();
    writeTextFile(fs, path, text, false);
    SwiftTestUtils.assertIsFile(fs, path);
  } finally {
    delete(fs, path);
  }
}
 
Example 2
Source File: TestSwiftFileSystemBasicOps.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testFileStatus() throws Throwable {
  Path path = new Path("/test/FileStatus");
  try {
    String text = "Testing File Status "
            + System.currentTimeMillis();
    writeTextFile(fs, path, text, false);
    SwiftTestUtils.assertIsFile(fs, path);
  } finally {
    delete(fs, path);
  }
}
 
Example 3
Source File: TestSwiftFileSystemDirectories.java    From sahara-extra with Apache License 2.0 5 votes vote down vote up
/**
 * Asserts that a zero byte file has a status of file and not
 * file or symlink
 *
 * @throws Exception on failures
 */
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testZeroByteFilesAreFiles() throws Exception {
  Path src = path("/test/testZeroByteFilesAreFiles");
  //create a zero byte file
  SwiftTestUtils.touch(fs, src);
  SwiftTestUtils.assertIsFile(fs, src);
}
 
Example 4
Source File: TestSwiftFileSystemBasicOps.java    From sahara-extra with Apache License 2.0 5 votes vote down vote up
@Test(timeout = SWIFT_TEST_TIMEOUT)
public void testFileStatus() throws Throwable {
  Path path = new Path("/test/FileStatus");
  try {
    String text = "Testing File Status "
            + System.currentTimeMillis();
    writeTextFile(fs, path, text, false);
    SwiftTestUtils.assertIsFile(fs, path);
  } finally {
    delete(fs, path);
  }
}
 
Example 5
Source File: SwiftFileSystemBaseTest.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Assert that a file exists and whose {@link FileStatus} entry
 * declares that this is a file and not a symlink or directory.
 *
 * @param filename name of the file
 * @throws IOException IO problems during file operations
 */
protected void assertIsFile(Path filename) throws IOException {
  SwiftTestUtils.assertIsFile(fs, filename);
}
 
Example 6
Source File: SwiftFileSystemBaseTest.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Assert that a file exists and whose {@link FileStatus} entry
 * declares that this is a file and not a symlink or directory.
 *
 * @param filename name of the file
 * @throws IOException IO problems during file operations
 */
protected void assertIsFile(Path filename) throws IOException {
  SwiftTestUtils.assertIsFile(fs, filename);
}
 
Example 7
Source File: SwiftFileSystemBaseTest.java    From sahara-extra with Apache License 2.0 2 votes vote down vote up
/**
 * Assert that a file exists and whose {@link FileStatus} entry
 * declares that this is a file and not a symlink or directory.
 *
 * @param filename name of the file
 * @throws IOException IO problems during file operations
 */
protected void assertIsFile(Path filename) throws IOException {
  SwiftTestUtils.assertIsFile(fs, filename);
}