Search in sources :

Example 36 with SettableBlobMeta

use of org.apache.storm.generated.SettableBlobMeta in project storm by apache.

the class ClientBlobStoreTest method testGoodACLsForCreate.

@Test
public void testGoodACLsForCreate() throws Exception {
    SettableBlobMeta meta = new SettableBlobMeta();
    AccessControl submitterAcl = BlobStoreAclHandler.parseAccessControl("u:tester:rwa");
    meta.add_to_acl(submitterAcl);
    String testKey = "testBlobKey";
    client.createBlob(testKey, meta);
    validatedBlobAcls(testKey);
}
Also used : SettableBlobMeta(org.apache.storm.generated.SettableBlobMeta) AccessControl(org.apache.storm.generated.AccessControl) Test(org.junit.Test)

Example 37 with SettableBlobMeta

use of org.apache.storm.generated.SettableBlobMeta in project storm by apache.

the class ClientBlobStoreTest method testDuplicateACLsForSetBlobMeta.

@Test(expected = AuthorizationException.class)
public void testDuplicateACLsForSetBlobMeta() throws Exception {
    String testKey = "testDuplicateACLsBlobKey";
    SettableBlobMeta meta = new SettableBlobMeta();
    createTestBlob(testKey, meta);
    AccessControl duplicateAcl = BlobStoreAclHandler.parseAccessControl("u:tester:r--");
    meta.add_to_acl(duplicateAcl);
    client.setBlobMeta(testKey, meta);
}
Also used : SettableBlobMeta(org.apache.storm.generated.SettableBlobMeta) AccessControl(org.apache.storm.generated.AccessControl) Test(org.junit.Test)

Example 38 with SettableBlobMeta

use of org.apache.storm.generated.SettableBlobMeta in project storm by apache.

the class ClientBlobStoreTest method testGoodACLsForSetBlobMeta.

@Test
public void testGoodACLsForSetBlobMeta() throws Exception {
    String testKey = "testBlobKey";
    SettableBlobMeta meta = new SettableBlobMeta();
    createTestBlob(testKey, meta);
    meta.add_to_acl(BlobStoreAclHandler.parseAccessControl("u:nextuser:r--"));
    client.setBlobMeta(testKey, meta);
    validatedBlobAcls(testKey);
}
Also used : SettableBlobMeta(org.apache.storm.generated.SettableBlobMeta) Test(org.junit.Test)

Aggregations

SettableBlobMeta (org.apache.storm.generated.SettableBlobMeta)38 IOException (java.io.IOException)16 Test (org.junit.Test)12 ReadableBlobMeta (org.apache.storm.generated.ReadableBlobMeta)10 AccessControl (org.apache.storm.generated.AccessControl)8 File (java.io.File)6 AtomicOutputStream (org.apache.storm.blobstore.AtomicOutputStream)5 Subject (javax.security.auth.Subject)4 BlobStoreFile (org.apache.storm.blobstore.BlobStoreFile)4 FileInputStream (java.io.FileInputStream)3 OutputStream (java.io.OutputStream)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 FileSystem (org.apache.hadoop.fs.FileSystem)2 BufferedInputStream (java.io.BufferedInputStream)1 LinkedList (java.util.LinkedList)1 Path (org.apache.hadoop.fs.Path)1 BlobStore (org.apache.storm.blobstore.BlobStore)1