Search in sources :

Example 1 with NamespaceNotFoundException

use of org.apache.accumulo.proxy.thrift.NamespaceNotFoundException in project accumulo by apache.

the class SimpleProxyBase method namespaceNotFound.

@Test
public void namespaceNotFound() throws Exception {
    final String doesNotExist = "doesNotExists";
    try {
        client.deleteNamespace(creds, doesNotExist);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.renameNamespace(creds, doesNotExist, "abcdefg");
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.setNamespaceProperty(creds, doesNotExist, "table.compaction.major.ratio", "4");
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.removeNamespaceProperty(creds, doesNotExist, "table.compaction.major.ratio");
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.getNamespaceProperties(creds, doesNotExist);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        IteratorSetting setting = new IteratorSetting(100, "DebugTheThings", DebugIterator.class.getName(), Collections.emptyMap());
        client.attachNamespaceIterator(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.removeNamespaceIterator(creds, doesNotExist, "DebugTheThings", EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.getNamespaceIteratorSetting(creds, doesNotExist, "DebugTheThings", IteratorScope.SCAN);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.listNamespaceIterators(creds, doesNotExist);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        IteratorSetting setting = new IteratorSetting(100, "DebugTheThings", DebugIterator.class.getName(), Collections.emptyMap());
        client.checkNamespaceIteratorConflicts(creds, doesNotExist, setting, EnumSet.allOf(IteratorScope.class));
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.addNamespaceConstraint(creds, doesNotExist, MaxMutationSize.class.getName());
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.removeNamespaceConstraint(creds, doesNotExist, 1);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.listNamespaceConstraints(creds, doesNotExist);
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
    try {
        client.testNamespaceClassLoad(creds, doesNotExist, DebugIterator.class.getName(), SortedKeyValueIterator.class.getName());
        fail("exception not thrown");
    } catch (NamespaceNotFoundException ex) {
    }
}
Also used : DebugIterator(org.apache.accumulo.core.iterators.DebugIterator) IteratorSetting(org.apache.accumulo.proxy.thrift.IteratorSetting) SortedKeyValueIterator(org.apache.accumulo.core.iterators.SortedKeyValueIterator) IteratorScope(org.apache.accumulo.proxy.thrift.IteratorScope) MaxMutationSize(org.apache.accumulo.test.constraints.MaxMutationSize) NamespaceNotFoundException(org.apache.accumulo.proxy.thrift.NamespaceNotFoundException) Test(org.junit.Test)

Aggregations

DebugIterator (org.apache.accumulo.core.iterators.DebugIterator)1 SortedKeyValueIterator (org.apache.accumulo.core.iterators.SortedKeyValueIterator)1 IteratorScope (org.apache.accumulo.proxy.thrift.IteratorScope)1 IteratorSetting (org.apache.accumulo.proxy.thrift.IteratorSetting)1 NamespaceNotFoundException (org.apache.accumulo.proxy.thrift.NamespaceNotFoundException)1 MaxMutationSize (org.apache.accumulo.test.constraints.MaxMutationSize)1 Test (org.junit.Test)1