use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.
the class ZMSFileChangeLogStoreTest method FileStructStoreInvalid.
@Test
public void FileStructStoreInvalid() {
try {
File rootDir = new File(FSTORE_PATH);
rootDir.mkdirs();
String fpath = FSTORE_PATH + "/zts_file.tmp";
touch(fpath);
@SuppressWarnings("unused") ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(fpath, null, null);
fail();
} catch (RuntimeException | IOException ex) {
assertTrue(true);
}
}
use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.
the class ZMSFileChangeLogStoreTest method deleteExistent.
@Test
public void deleteExistent() {
ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
Struct data = new Struct();
data.put("key", "val1");
fstore.put("test1", JSON.bytes(data));
fstore.delete("test1");
Struct st = fstore.get("test1", Struct.class);
assertNull(st);
}
use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.
the class ZMSFileChangeLogStoreTest method scanEmpty.
@Test
public void scanEmpty() {
ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
List<String> ls = fstore.scan();
assertEquals(ls.size(), 0);
}
use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.
the class ZMSFileChangeLogStoreTest method FileStructStoreValidDir.
@Test
public void FileStructStoreValidDir() {
ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
assertNotNull(fstore);
}
use of com.yahoo.athenz.zts.store.impl.ZMSFileChangeLogStore in project athenz by yahoo.
the class ZMSFileChangeLogStoreTest method scanSingle.
@Test
public void scanSingle() {
ZMSFileChangeLogStore fstore = new ZMSFileChangeLogStore(FSTORE_PATH, null, null);
Struct data = new Struct();
data.put("key", "val1");
fstore.put("test1", JSON.bytes(data));
List<String> ls = fstore.scan();
assertEquals(ls.size(), 1);
assertTrue(ls.contains("test1"));
}
Aggregations