use of com.dexels.navajo.resource.http.adapter.BinaryStoreAdapter in project navajo by Dexels.
the class TestHttpResource method testHead.
@Test
@Ignore
public void testHead() throws IOException, MappableException, UserException {
BinaryStoreAdapter bsa = new BinaryStoreAdapter();
bsa.load(access);
Binary b = createBinary();
b.setMimeType("text/plain");
boolean exists = bsa.headBinary(b.getHexDigest(), "binstore", "junit");
Assert.assertFalse(exists);
}
use of com.dexels.navajo.resource.http.adapter.BinaryStoreAdapter in project navajo by Dexels.
the class TestHttpResource method testPut.
@Test
@Ignore
public void testPut() throws IOException, MappableException, UserException {
BinaryStoreAdapter bsa = new BinaryStoreAdapter();
bsa.load(access);
Binary b = createBinary();
bsa.storeBinary(b, "binstore", "junit", false);
}
use of com.dexels.navajo.resource.http.adapter.BinaryStoreAdapter in project navajo by Dexels.
the class TestHttpResource method testStoreAdapterBasics.
@Test
@Ignore
public void testStoreAdapterBasics() throws IOException, MappableException, UserException, InterruptedException {
BinaryStoreAdapter bsa = new BinaryStoreAdapter();
bsa.load(access);
Binary b = createBinary();
String bb = bsa.storeBinary(b, "binstore", "junit", false);
System.err.println("Result of put: " + bb);
boolean existsNow = bsa.headBinary(b.getHexDigest(), "binstore", "junit");
Assert.assertTrue(existsNow);
System.err.println("exists after insert: " + existsNow);
ReactiveReply result = bsa.deleteBinary(b.getHexDigest(), "binstore", "junit", false);
System.err.println("Delete: " + result.status());
boolean exists = bsa.headBinary(b.getHexDigest(), "binstore", "junit");
Assert.assertFalse(exists);
System.err.println("exists after delete: " + exists);
}
use of com.dexels.navajo.resource.http.adapter.BinaryStoreAdapter in project navajo by Dexels.
the class TestHttpResource method testDelete.
@Test
@Ignore
public void testDelete() throws IOException, MappableException, UserException {
BinaryStoreAdapter bsa = new BinaryStoreAdapter();
bsa.load(access);
Binary b = createBinary();
b.setMimeType("text/plain");
ReactiveReply reply = bsa.deleteBinary(b.getHexDigest(), "binstore", "junit", false);
Assert.assertNotSame(200, reply.status());
}
use of com.dexels.navajo.resource.http.adapter.BinaryStoreAdapter in project navajo by Dexels.
the class TestHttpResource method testStoreAdapterAdvanced.
@Test
@Ignore
public void testStoreAdapterAdvanced() throws IOException, MappableException, UserException, InterruptedException {
Binary b = createBinary();
BinaryStoreAdapter bsa = new BinaryStoreAdapter();
bsa.load(access);
bsa.setBinaryHash(b.getHexDigest());
bsa.setResource("binstore");
bsa.setBucket("junit");
int delres = bsa.getDeleteResult();
bsa.store();
Assert.assertTrue(delres < 400);
// --------------------------------------
bsa = new BinaryStoreAdapter();
bsa.load(access);
bsa.setBinaryHash(b.getHexDigest());
bsa.setResource("binstore");
bsa.setBucket("junit");
boolean existsAfterDelete = bsa.getHeadResult();
bsa.store();
Assert.assertFalse(existsAfterDelete);
// --------------------------------------
bsa = new BinaryStoreAdapter();
bsa.load(access);
bsa.setBinary(b);
String hexDigest = b.getHexDigest();
bsa.setResource("binstore");
bsa.setBucket("junit");
String put = bsa.getPutResult();
bsa.store();
Assert.assertTrue(hexDigest.equals(put));
// --------------------------------------
bsa = new BinaryStoreAdapter();
bsa.load(access);
bsa.setBinaryHash(b.getHexDigest());
bsa.setResource("binstore");
bsa.setBucket("junit");
boolean existsAfterPut = bsa.getHeadResult();
bsa.store();
Assert.assertTrue(existsAfterPut);
// --------------------------------------
}
Aggregations