use of com.instaclustr.esop.impl.StorageLocation in project esop by instaclustr.
the class StorageLocationTest method fileLocationTest3.
@Test
public void fileLocationTest3() {
StorageLocation fileLocation = new StorageLocation("file:///a/b/c/d/");
fileLocation.validate();
assertEquals(fileLocation.storageProvider, "file");
assertEquals(fileLocation.fileBackupDirectory.toString(), Paths.get("").toAbsolutePath().toString());
assertEquals(fileLocation.bucket, "a");
assertEquals(fileLocation.clusterId, "b");
assertEquals(fileLocation.datacenterId, "c");
assertEquals(fileLocation.nodeId, "d");
}
use of com.instaclustr.esop.impl.StorageLocation in project esop by instaclustr.
the class StorageLocationTest method fileLocationTest2.
@Test
public void fileLocationTest2() {
StorageLocation fileLocation = new StorageLocation("file:///tmp/a/b/c/d/");
fileLocation.validate();
assertEquals(fileLocation.storageProvider, "file");
assertEquals(fileLocation.fileBackupDirectory.toString(), "/tmp");
assertEquals(fileLocation.bucket, "a");
assertEquals(fileLocation.clusterId, "b");
assertEquals(fileLocation.datacenterId, "c");
assertEquals(fileLocation.nodeId, "d");
}
use of com.instaclustr.esop.impl.StorageLocation in project esop by instaclustr.
the class StorageLocationTest method updateStorageLocationDatacenterTest.
@Test
public void updateStorageLocationDatacenterTest() {
StorageLocation storageLocation = new StorageLocation("gcp://bucket/cluster/dc/node");
StorageLocation changedNode = StorageLocation.updateNodeId(storageLocation, "node2");
StorageLocation changedDc = StorageLocation.updateDatacenter(changedNode, "dc2");
assertEquals(changedDc.datacenterId, "dc2");
assertEquals(changedDc.nodeId, "node2");
}
use of com.instaclustr.esop.impl.StorageLocation in project esop by instaclustr.
the class StorageLocationTest method globalLocationTest.
@Test
public void globalLocationTest() {
StorageLocation globalLocation = new StorageLocation("oracle://my-bucket");
globalLocation.validate();
assertEquals(globalLocation.storageProvider, "oracle");
assertEquals(globalLocation.bucket, "my-bucket");
assertNull(globalLocation.clusterId);
assertNull(globalLocation.datacenterId);
assertNull(globalLocation.nodeId);
assertTrue(globalLocation.cloudLocation);
assertTrue(globalLocation.globalRequest);
}
use of com.instaclustr.esop.impl.StorageLocation in project esop by instaclustr.
the class StorageLocationTest method fileLocationTest.
@Test
public void fileLocationTest() {
StorageLocation fileLocation = new StorageLocation("file:///some/path/bucket/cluster/dc/node");
fileLocation.validate();
assertEquals(fileLocation.storageProvider, "file");
assertEquals(fileLocation.fileBackupDirectory.toString(), "/some/path");
assertEquals(fileLocation.bucket, "bucket");
assertEquals(fileLocation.clusterId, "cluster");
assertEquals(fileLocation.datacenterId, "dc");
assertEquals(fileLocation.nodeId, "node");
}
Aggregations