Search in sources :

Example 11 with StorageLocation

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");
}
Also used : StorageLocation(com.instaclustr.esop.impl.StorageLocation) Test(org.testng.annotations.Test)

Example 12 with StorageLocation

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");
}
Also used : StorageLocation(com.instaclustr.esop.impl.StorageLocation) Test(org.testng.annotations.Test)

Example 13 with StorageLocation

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");
}
Also used : StorageLocation(com.instaclustr.esop.impl.StorageLocation) Test(org.testng.annotations.Test)

Example 14 with StorageLocation

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);
}
Also used : StorageLocation(com.instaclustr.esop.impl.StorageLocation) Test(org.testng.annotations.Test)

Example 15 with StorageLocation

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");
}
Also used : StorageLocation(com.instaclustr.esop.impl.StorageLocation) Test(org.testng.annotations.Test)

Aggregations

StorageLocation (com.instaclustr.esop.impl.StorageLocation)24 Test (org.testng.annotations.Test)16 Path (java.nio.file.Path)9 ListOperationRequest (com.instaclustr.esop.impl.list.ListOperationRequest)6 RestoreOperationRequest (com.instaclustr.esop.impl.restore.RestoreOperationRequest)5 BackupOperationRequest (com.instaclustr.esop.impl.backup.BackupOperationRequest)4 AmazonS3 (com.amazonaws.services.s3.AmazonS3)2 AzureBucketService (com.instaclustr.esop.azure.AzureBucketService)2 GCPBucketService (com.instaclustr.esop.gcp.GCPBucketService)2 LocalFileRestorer (com.instaclustr.esop.local.LocalFileRestorer)2 S3BucketService (com.instaclustr.esop.s3.aws.S3BucketService)2 Bucket (com.google.cloud.storage.Bucket)1 Storage (com.google.cloud.storage.Storage)1 AzureBackuper (com.instaclustr.esop.azure.AzureBackuper)1 AzureRestorer (com.instaclustr.esop.azure.AzureRestorer)1 AbstractBackupTest (com.instaclustr.esop.backup.embedded.AbstractBackupTest)1 GCPBackuper (com.instaclustr.esop.gcp.GCPBackuper)1 GCPRestorer (com.instaclustr.esop.gcp.GCPRestorer)1 AllManifestsReport (com.instaclustr.esop.impl.Manifest.AllManifestsReport)1 ManifestReport (com.instaclustr.esop.impl.Manifest.ManifestReporter.ManifestReport)1