Search in sources :

Example 6 with PathNotFoundException

use of org.apache.hadoop.fs.PathNotFoundException in project hadoop by apache.

the class TestRegistryOperations method testPutNoParent.

@Test
public void testPutNoParent() throws Throwable {
    ServiceRecord record = new ServiceRecord();
    record.set(YarnRegistryAttributes.YARN_ID, "testPutNoParent");
    String path = "/path/without/parent";
    try {
        operations.bind(path, record, 0);
        // didn't get a failure
        // trouble
        RegistryPathStatus stat = operations.stat(path);
        fail("Got a status " + stat);
    } catch (PathNotFoundException expected) {
    // expected
    }
}
Also used : RegistryPathStatus(org.apache.hadoop.registry.client.types.RegistryPathStatus) PathNotFoundException(org.apache.hadoop.fs.PathNotFoundException) ServiceRecord(org.apache.hadoop.registry.client.types.ServiceRecord) Test(org.junit.Test) AbstractRegistryTest(org.apache.hadoop.registry.AbstractRegistryTest)

Aggregations

PathNotFoundException (org.apache.hadoop.fs.PathNotFoundException)6 RegistryPathStatus (org.apache.hadoop.registry.client.types.RegistryPathStatus)4 PathIsNotEmptyDirectoryException (org.apache.hadoop.fs.PathIsNotEmptyDirectoryException)3 IOException (java.io.IOException)2 FileAlreadyExistsException (org.apache.hadoop.fs.FileAlreadyExistsException)2 AbstractRegistryTest (org.apache.hadoop.registry.AbstractRegistryTest)2 AuthenticationFailedException (org.apache.hadoop.registry.client.exceptions.AuthenticationFailedException)2 NoChildrenForEphemeralsException (org.apache.hadoop.registry.client.exceptions.NoChildrenForEphemeralsException)2 NoPathPermissionsException (org.apache.hadoop.registry.client.exceptions.NoPathPermissionsException)2 RegistryIOException (org.apache.hadoop.registry.client.exceptions.RegistryIOException)2 ServiceRecord (org.apache.hadoop.registry.client.types.ServiceRecord)2 KeeperException (org.apache.zookeeper.KeeperException)2 Test (org.junit.Test)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 EOFException (java.io.EOFException)1 HashMap (java.util.HashMap)1 InvalidRecordException (org.apache.hadoop.registry.client.exceptions.InvalidRecordException)1 NoRecordException (org.apache.hadoop.registry.client.exceptions.NoRecordException)1 ServiceStateException (org.apache.hadoop.service.ServiceStateException)1 Stat (org.apache.zookeeper.data.Stat)1