@Test public void testSharedStore() throws IOException { StreamStore store1 = StoreFactory.sharedLocalStore(); StreamStore store2 = StoreFactory.sharedLocalStore(); File f1 = new File(store1.getLocation(store1.store(resource1()))).getParentFile(); File f2 = new File(store2.getLocation(store2.store(resource1()))).getParentFile(); assertEquals("Shared Stores should share the same parent (since they are shared)", f1, f2); }
@Test public void testAnonymousStore() throws IOException { StreamStore store1 = StoreFactory.anonymousStore(); StreamStore store2 = StoreFactory.anonymousStore(); File f1 = new File(store1.getLocation(store1.store(resource1()))).getParentFile(); File f2 = new File(store2.getLocation(store2.store(resource1()))).getParentFile(); assertFalse( "Anonymous Stores should not share the same parent (since they are anonymous)", f1.equals(f2)); }
@Test public void testPuttingTheSameResourceTwice() throws IOException { StreamStore store = StoreFactory.sharedLocalStore(); String id1 = store.store(resource1()).getIdentification(); String id2 = store.store(resource1()).getIdentification(); assertEquals(id1, id2); }