diff --git a/build.gradle b/build.gradle index 2358c96..d554b2e 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ subprojects { compile 'ch.qos.logback:logback-core:1.2.3' compile 'ch.qos.logback:logback-classic:1.2.3' compile 'com.google.guava:guava:23.0-jre' - compile 'com.spectralogic.ds3:ds3-sdk:3.5.4' + compile 'com.spectralogic.ds3:ds3-sdk:5.0.2' compile 'com.google.inject:guice:4.2.0' testCompile ('org.mockito:mockito-core:1.10.19') { diff --git a/ds3-cli-certification/src/test/java/com/spectralogic/ds3cli/certification/Certification_Test.java b/ds3-cli-certification/src/test/java/com/spectralogic/ds3cli/certification/Certification_Test.java index ec5214e..5bcd046 100644 --- a/ds3-cli-certification/src/test/java/com/spectralogic/ds3cli/certification/Certification_Test.java +++ b/ds3-cli-certification/src/test/java/com/spectralogic/ds3cli/certification/Certification_Test.java @@ -20,6 +20,8 @@ import com.google.common.collect.Iterables; import com.spectralogic.ds3cli.CommandResponse; import com.spectralogic.ds3cli.exceptions.*; +import com.spectralogic.ds3cli.helpers.TempStorageIds; +import com.spectralogic.ds3cli.helpers.TempStorageUtil; import com.spectralogic.ds3cli.helpers.Util; import com.spectralogic.ds3client.Ds3Client; import com.spectralogic.ds3client.Ds3ClientBuilder; @@ -30,10 +32,7 @@ import com.spectralogic.ds3client.models.common.Credentials; import com.spectralogic.ds3client.networking.FailedRequestException; import org.apache.commons.io.FileUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.FixMethodOrder; -import org.junit.Test; +import org.junit.*; import org.junit.runners.MethodSorters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,6 +44,7 @@ import java.util.*; import static com.spectralogic.ds3cli.certification.CertificationUtil.*; +import static com.spectralogic.ds3cli.helpers.TempStorageUtil.setupDataPolicy; import static com.spectralogic.ds3cli.helpers.TempStorageUtil.verifyAvailableTapePartition; import static junit.framework.TestCase.assertFalse; import static org.hamcrest.CoreMatchers.is; @@ -56,10 +56,10 @@ /** * Implement tests to automate the BlackPearl Certification process for the JavaCLI. - * + *

* For details, refer to - * https://developer.spectralogic.com/certification/ - * https://developer.spectralogic.com/test-plan/ + * https://developer.spectralogic.com/certification/ + * https://developer.spectralogic.com/test-plan/ */ @FixMethodOrder(MethodSorters.NAME_ASCENDING) // Order only matters for manually verifying the results @@ -74,6 +74,7 @@ public class Certification_Test { private static UUID envDataPolicyId; private final static Ds3ExceptionHandlerMapper EXCEPTION_MAPPER = Ds3ExceptionHandlerMapper.getInstance(); + static { EXCEPTION_MAPPER.addHandler(FailedRequestException.class, new FailedRequestExceptionHandler()); EXCEPTION_MAPPER.addHandler(RuntimeException.class, new RuntimeExceptionHandler()); @@ -133,7 +134,7 @@ public void test_7_2_1_invalid_credentials() throws Exception { try { Util.command(invalid_client, "--http -c get_service"); - } catch(final FailedRequestException e) { + } catch (final FailedRequestException e) { final String formattedException = FailedRequestExceptionHandler.format(e); OUT.insertPreformat(formattedException); final String expectedError = "permissions / authorization error"; @@ -155,7 +156,7 @@ public void test_7_2_2_invalid_endpoint() throws Exception { boolean success = false; try { Util.command(invalid_client, "--http -c get_service"); - } catch(final UnknownHostException uhe) { + } catch (final UnknownHostException uhe) { final String formattedException = ExceptionFormatter.format(uhe); final String expectedError = "UnknownHost"; assertThat(formattedException, containsString(expectedError)); @@ -177,7 +178,7 @@ public void test_7_3_1_list_nonexistent_bucket() throws Exception { try { Util.command(client, "--http -c get_bucket -b " + bucketName); - } catch(final CommandException ce) { + } catch (final CommandException ce) { final String formattedException = ExceptionFormatter.format(ce); assertThat(formattedException, containsString("Error: Unknown bucket.")); OUT.insertLog("CommandResponse for 7.3.1 failed attempt to list nonexistent bucket:"); @@ -212,7 +213,7 @@ public void test_7_3_2_access_bucket_wrong_user() throws Exception { // Attempt to access the bucket with the new user, which should fail final String listBucketCmd = "--http -c get_bucket -b " + bucketName; Util.command(invalid_client, listBucketCmd); - } catch(final FailedRequestException e) { + } catch (final FailedRequestException e) { final String formattedException = FailedRequestExceptionHandler.format(e); final String expectedError = "permissions / authorization error"; assertThat(formattedException, containsString(expectedError)); @@ -250,7 +251,7 @@ public void test_7_4_get_nonexistent_object() throws Exception { final CommandResponse getNonExtandObjectResponse = Util.command(client, getNonExtantObject); OUT.insertCommand(getNonExtantObject, getNonExtandObjectResponse.getMessage()); - } catch(final FailedRequestException fre) { + } catch (final FailedRequestException fre) { final String formattedException = FailedRequestExceptionHandler.format(fre); final String expectedError = "not found"; assertThat(formattedException, containsString(expectedError)); @@ -266,6 +267,7 @@ public void test_7_4_get_nonexistent_object() throws Exception { /** * 7.5-7: Archive and Restore 3 objects larger than the chunk size to BP simultaneously. + * * @throws Exception */ @Test @@ -282,6 +284,7 @@ public void test_7_5_and_6_bulk_performance_3x110GB() throws Exception { /** * 7.7-8: Archive 250 objects of approximately 1GB size to BP. + * * @throws Exception */ @Test @@ -323,7 +326,7 @@ private static boolean testBulkPutAndBulkGetPerformance( OUT.insertLog("Bulk PUT from bucket " + bucketName); final long startPutTime = getCurrentTime(); - final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); + final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); final CommandResponse putBulkResponse = Util.command(client, putBulkCmd); OUT.insertCommand(putBulkCmd, putBulkResponse.getMessage()); final long endPutTime = getCurrentTime(); @@ -368,14 +371,20 @@ public void test_8_1_versioning() throws Exception { final Long fileSize = 1024L; final String bucketName = CertificationUtil.getBucketName(testDescription); boolean success = false; + final UUID dataPolicy = setupDataPolicy(testDescription, false, ChecksumType.Type.MD5, client); + final TempStorageIds tempStorageIds = TempStorageUtil.setup(testDescription, dataPolicy, client); + OUT.startNewTest(testDescription); try { + OUT.insertLog("Set data policy to use versioning"); - final String enableDataPolicyVersioningCmd = "--http -c modify_data_policy --modify-params versioning:KEEP_LATEST -i " + envDataPolicyId; + final String enableDataPolicyVersioningCmd = "--http -c modify_data_policy --modify-params versioning:KEEP_LATEST -i " + dataPolicy; final CommandResponse modifyDataPolicyResponse = Util.command(client, enableDataPolicyVersioningCmd); OUT.insertCommand(enableDataPolicyVersioningCmd, modifyDataPolicyResponse.getMessage()); assertThat(modifyDataPolicyResponse.getReturnCode(), is(0)); + client.modifyUserSpectraS3(new ModifyUserSpectraS3Request("Administrator") + .withDefaultDataPolicyId(dataPolicy)); // create and store one file Path bulkPutLocalTempDir = CertificationUtil.createTempFiles(bucketName, numFiles, fileSize); @@ -407,11 +416,9 @@ public void test_8_1_versioning() throws Exception { } catch (final Exception e) { LOG.error("Exception: {}", e.getMessage(), e); } finally { - Util.deleteBucket(client, bucketName); - - // undo versioning - Util.command(client, "--http -c modify_data_policy --modify-params versioning:NONE -i " + envDataPolicyId); - + client.modifyUserSpectraS3(new ModifyUserSpectraS3Request("Administrator") + .withDefaultDataPolicyId(envDataPolicyId)); + TempStorageUtil.teardown(testDescription, tempStorageIds, client); OUT.finishTest(testDescription, success); assertTrue(testDescription + " did not complete", success); } @@ -432,7 +439,7 @@ public void test_8_2_partial_restore() throws Exception { try { final Path bulkPutLocalTempDir = CertificationUtil.createTempFiles(bucketName, numFiles, fileSize); - final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); + final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); final CommandResponse putBulkResponse = Util.command(client, putBulkCmd); OUT.insertCommand(putBulkCmd, putBulkResponse.getMessage()); assertThat(putBulkResponse.getReturnCode(), is(0)); @@ -445,7 +452,7 @@ public void test_8_2_partial_restore() throws Exception { OUT.insertPreformat(objectName); // restore first 100 bytes - final String getPartialObjectCmd = "--http -c get_object --range-offset 0 --range-length 100 -b " + bucketName + " -o " + objectName + " -d " + bulkPutLocalTempDir.toString(); + final String getPartialObjectCmd = "--http -c get_object --range-offset 0 --range-length 100 -b " + bucketName + " -o " + objectName + " -d " + bulkPutLocalTempDir.toString(); final CommandResponse getPartialResponse = Util.command(client, getPartialObjectCmd); OUT.insertCommand(getPartialObjectCmd, getPartialResponse.getMessage()); assertThat(getPartialResponse.getReturnCode(), is(0)); @@ -455,11 +462,11 @@ public void test_8_2_partial_restore() throws Exception { final com.spectralogic.ds3cli.util.FileUtils.ObjectsToPut objectsToPut = com.spectralogic.ds3cli.util.FileUtils.getObjectsToPut(filesToPut, bulkPutLocalTempDir, "", true); final Ds3Object obj = objectsToPut.getDs3Objects().get(0); assertTrue(obj.getSize() < 150); - OUT.insertLog(obj.getName() + " size: " + Long.toString(obj.getSize())); + OUT.insertLog(obj.getName() + " size: " + Long.toString(obj.getSize())); success = true; } catch (final Exception e) { - LOG.error("Exception in " + testDescription, e ); + LOG.error("Exception in " + testDescription, e); } finally { OUT.finishTest(testDescription, success); Util.deleteBucket(client, bucketName); @@ -501,7 +508,7 @@ public void test_8_4_change_priorities() throws Exception { success = true; } catch (final Exception e) { - LOG.error("Exception in " + testDescription, e ); + LOG.error("Exception in " + testDescription, e); } finally { OUT.finishTest(testDescription, success); CertificationUtil.deleteJob(client, jobId); @@ -551,7 +558,7 @@ public boolean apply(@Nullable final Tape tape) { assertTrue(postEjectResponse.getMessage().contains(ejectLocation)); success = true; } catch (final Exception e) { - LOG.error("Exception in " + testDescription, e ); + LOG.error("Exception in " + testDescription, e); } finally { CertificationUtil.cancelTapeEject(client, barcode); OUT.finishTest(testDescription, success); @@ -587,7 +594,7 @@ public void test_8_6_fully_persisted() throws Exception { // Create temp files for BULK_PUT final Path bulkPutLocalTempDir = CertificationUtil.createTempFiles(bucketName, numFiles, fileSize); - final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); + final String putBulkCmd = "--http -c put_bulk -b " + bucketName + " -d " + bulkPutLocalTempDir.toString(); final CommandResponse putBulkResponse = Util.command(client, putBulkCmd); assertThat(putBulkResponse.getReturnCode(), is(0)); @@ -620,7 +627,7 @@ public void test_8_6_fully_persisted() throws Exception { final CommandResponse getPhysicalPlacementAfterResponse = Util.command(client, getPhysicalPlacementCmd); OUT.insertCommand(getPhysicalPlacementCmd, getPhysicalPlacementAfterResponse.getMessage()); } catch (final Exception e) { - LOG.error("Exception in " + testDescription, e ); + LOG.error("Exception in " + testDescription, e); } finally { OUT.finishTest(testDescription, success); Util.deleteBucket(client, bucketName); @@ -642,16 +649,16 @@ public void test_8_7_large_list() throws Exception { boolean success = false; try { // Put 500 files into bucket - final CommandResponse performanceResponse = Util.putPerformanceFiles(client, bucketName, numFiles, fileSize); + final CommandResponse performanceResponse = Util.putPerformanceFiles(client, bucketName, numFiles, fileSize); assertThat(performanceResponse.getReturnCode(), is(0)); final String listBucketArgs = "--http -c get_bucket -b " + bucketName; - final CommandResponse getBucketResponseAfterBulkPut = Util.command(client, listBucketArgs); + final CommandResponse getBucketResponseAfterBulkPut = Util.command(client, listBucketArgs); OUT.insertCommand(listBucketArgs, getBucketResponseAfterBulkPut.getMessage()); assertThat(getBucketResponseAfterBulkPut.getReturnCode(), is(0)); success = true; } catch (final Exception e) { - LOG.error("Exception in " + testDescription, e ); + LOG.error("Exception in " + testDescription, e); } finally { OUT.finishTest(testDescription, success); Util.deleteBucket(client, bucketName); diff --git a/ds3-cli-integration/src/test/java/com/spectralogic/ds3cli/integration/FeatureIntegration_Test.java b/ds3-cli-integration/src/test/java/com/spectralogic/ds3cli/integration/FeatureIntegration_Test.java index a324646..9575936 100644 --- a/ds3-cli-integration/src/test/java/com/spectralogic/ds3cli/integration/FeatureIntegration_Test.java +++ b/ds3-cli-integration/src/test/java/com/spectralogic/ds3cli/integration/FeatureIntegration_Test.java @@ -43,6 +43,7 @@ import com.spectralogic.ds3client.commands.GetBucketResponse; import com.spectralogic.ds3client.commands.GetObjectRequest; import com.spectralogic.ds3client.commands.GetObjectResponse; +import com.spectralogic.ds3client.commands.spectrads3.CancelJobSpectraS3Request; import com.spectralogic.ds3client.helpers.Ds3ClientHelpers; import com.spectralogic.ds3client.helpers.FileObjectPutter; import com.spectralogic.ds3client.helpers.FolderNameFilter; @@ -833,9 +834,9 @@ public void getPhysicalPlacement() throws Exception { final Arguments args = new Arguments(new String[]{"--http", "-c", "get_physical_placement", "-b", bucketName, "-o", "beowulf.txt" }); final CommandResponse response = Util.command(client, args); - assertTrue(response.getMessage().contains("| Object Name | ID | In Cache | Length | Offset | Latest | Version |")); + assertTrue(response.getMessage().contains("| Object Name | ID | In Cache | Length | Offset | Latest | Version |")); assertTrue(response.getMessage().contains("| beowulf.txt |")); - assertTrue(response.getMessage().contains("| true | 294059 | 0 | true | 1 |")); + assertTrue(response.getMessage().contains("| true | 294059 | 0 | true |")); } finally { Util.deleteBucket(client, bucketName); @@ -1254,6 +1255,7 @@ public void testResettingDeadJobTimerWithModifyJob() throws Exception { assertNotNull(response); assertNotNull(response.getMessage()); assertFalse(response.getMessage().isEmpty()); + client.cancelJobSpectraS3(new CancelJobSpectraS3Request(job.getJobId())); } finally { Util.deleteBucket(client, bucketName); } diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/EjectStorageDomain.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/EjectStorageDomain.java index c914a0b..1df8bf8 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/EjectStorageDomain.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/EjectStorageDomain.java @@ -54,7 +54,7 @@ public CliCommand init(final Arguments args) throws Exception { public DefaultResult call() throws Exception { final EjectStorageDomainSpectraS3Request request - = new EjectStorageDomainSpectraS3Request(id) + = new EjectStorageDomainSpectraS3Request(id.toString()) .withBucketId(bucket).withEjectLabel(ejectLabel).withEjectLocation(ejectLocation); this.getClient().ejectStorageDomainSpectraS3(request); diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetDetailedObjects.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetDetailedObjects.java index b64d24a..fefe2de 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetDetailedObjects.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetDetailedObjects.java @@ -90,7 +90,7 @@ private void checkFilterParams() throws BadArgumentException { public GetDetailedObjectsResult call() throws Exception { final FluentIterable detailedObjects = FluentIterable.from(new LazyIterable<>( - new GetObjectsFullDetailsLoaderFactory(getClient(), this.bucketName, this.prefix, 100, 5, true))) + new GetObjectsFullDetailsLoaderFactory(getClient(), this.bucketName, 100, 5, true))) .filter(Predicates.and(getDatePredicate(), getSizePredicate(), getNamePredicate(), getOwnerPredicate())); return new GetDetailedObjectsResult(detailedObjects); diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetObjectsOnTape.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetObjectsOnTape.java index 03101cc..5d87649 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetObjectsOnTape.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/command/GetObjectsOnTape.java @@ -56,7 +56,7 @@ public GetObjectsOnTapeResult call() throws CommandException, IOException { try { final GetBlobsOnTapeSpectraS3Response response - = getClient().getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(null, this.tapeId)); + = getClient().getBlobsOnTapeSpectraS3(new GetBlobsOnTapeSpectraS3Request(this.tapeId)); return new GetObjectsOnTapeResult(this.tapeId, response.getBulkObjectListResult().getObjects()); } catch (final FailedRequestException e) { diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPathBackendView.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPathBackendView.java index b6dd84d..6ca0257 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPathBackendView.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPathBackendView.java @@ -39,7 +39,7 @@ public String render(final GetDataPathBackendResult obj) { return "No valid Data Path Backend on remote appliance"; } - initTable(ImmutableList.of("Activated", "Auto Timeout", "Auto Inspect", "Conflict Resolution", "ID", + initTable(ImmutableList.of("Activated", "Auto Timeout", "Auto Inspect", "ID", "Last Heartbeat", "Unavailable Media Policy", "Unavailable Pool Retry Mins", "Unavailable Partition Retry Mins")); return ASCIITable.getInstance().getTable(getHeaders(), formatTableContents()); @@ -51,12 +51,11 @@ protected String[][] formatTableContents() { attributesArray[0] = nullGuardToString(dataPathBackend.getActivated()); attributesArray[1] = nullGuardToString(dataPathBackend.getAutoActivateTimeoutInMins()); attributesArray[2] = nullGuardToString(dataPathBackend.getAutoInspect()); - attributesArray[3] = nullGuardToString(dataPathBackend.getDefaultImportConflictResolutionMode()); - attributesArray[4] = nullGuardToString(dataPathBackend.getId()); - attributesArray[5] = nullGuardFromDate(dataPathBackend.getLastHeartbeat(), DATE_FORMAT); - attributesArray[6] = nullGuardToString(dataPathBackend.getUnavailableMediaPolicy()); - attributesArray[7] = nullGuardToString(dataPathBackend.getUnavailablePoolMaxJobRetryInMins()); - attributesArray[8] = nullGuardToString(dataPathBackend.getUnavailableTapePartitionMaxJobRetryInMins()); + attributesArray[3] = nullGuardToString(dataPathBackend.getId()); + attributesArray[4] = nullGuardFromDate(dataPathBackend.getLastHeartbeat(), DATE_FORMAT); + attributesArray[5] = nullGuardToString(dataPathBackend.getUnavailableMediaPolicy()); + attributesArray[6] = nullGuardToString(dataPathBackend.getUnavailablePoolMaxJobRetryInMins()); + attributesArray[7] = nullGuardToString(dataPathBackend.getUnavailableTapePartitionMaxJobRetryInMins()); contents.add(attributesArray); return contents.toArray(new String[contents.size()][]); } diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPoliciesView.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPoliciesView.java index 3018f5c..0fec369 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPoliciesView.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetDataPoliciesView.java @@ -41,7 +41,7 @@ public String render(final GetDataPoliciesResult br) { initTable(ImmutableList.of("Name", "Created", "Versioning", "Checksum Type", "End-to-End CRC Required", "Blobbing Enabled", "Default Blob Size", "Default Get Job Priority","Default Put Job Priority", - "Default Verify Job Priority", "Id", "LTFS Object Naming")); + "Default Verify Job Priority", "Id")); setTableDataAlignment(ImmutableList.of(ASCIITable.ALIGN_LEFT, ASCIITable.ALIGN_LEFT, ASCIITable.ALIGN_RIGHT , ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT, ASCIITable.ALIGN_RIGHT)); return ASCIITable.getInstance().getTable(getHeaders(), formatTableContents()); @@ -64,7 +64,6 @@ protected String[][] formatTableContents() { arrayEntry[8] = nullGuardToString(dataPolicy.getDefaultPutJobPriority()); arrayEntry[9] = nullGuardToString(dataPolicy.getDefaultVerifyJobPriority()); arrayEntry[10] = nullGuardToString(dataPolicy.getId()); - arrayEntry[11] = nullGuardToString(dataPolicy.getLtfsObjectNamingAllowed()); builder.add(arrayEntry); } diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetPhysicalPlacementWithFullDetailsView.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetPhysicalPlacementWithFullDetailsView.java index a673df6..216597a 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetPhysicalPlacementWithFullDetailsView.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetPhysicalPlacementWithFullDetailsView.java @@ -85,7 +85,7 @@ private String[][] formatBulkObjectList(final BulkObject obj) { bulkObjectArray[3] = nullGuardToString(obj.getLength()); bulkObjectArray[4] = nullGuardToString(obj.getOffset()); bulkObjectArray[5] = nullGuardToString(obj.getLatest()); - bulkObjectArray[6] = nullGuardToString(obj.getVersion()); + bulkObjectArray[6] = nullGuardToString(obj.getVersionId()); formatArray[0] = bulkObjectArray; return formatArray; diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetTapesView.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetTapesView.java index 153a390..aaeaa22 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetTapesView.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/GetTapesView.java @@ -79,7 +79,7 @@ protected String[][] formatTableContents() { private String storageDomainName(final Tape tape) { try { - return getTapesResult.getResult().getStorageDomainIdNameMap().get(tape.getStorageDomainId()); + return getTapesResult.getResult().getStorageDomainIdNameMap().get(tape.getStorageDomainMemberId()); } catch (final Throwable t) { LOG.debug("Error getting storage domain name for tape.", t); } diff --git a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/VerifyBulkJobView.java b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/VerifyBulkJobView.java index 3d7958d..1ad4292 100644 --- a/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/VerifyBulkJobView.java +++ b/ds3_java_cli/src/main/java/com/spectralogic/ds3cli/views/cli/VerifyBulkJobView.java @@ -59,7 +59,7 @@ protected String[][] formatTableContents() { arrayEntry[0] = nullGuardToString(chunk); arrayEntry[1] = nullGuard(bulkObject.getName()); arrayEntry[2] = nullGuardToString(bulkObject.getLength()); - arrayEntry[3] = nullGuardToString(bulkObject.getVersion()); + arrayEntry[3] = nullGuardToString(bulkObject.getVersionId()); contents.add(arrayEntry); } } diff --git a/ds3_java_cli/src/test/java/com/spectralogic/ds3cli/Ds3Cli_Test.java b/ds3_java_cli/src/test/java/com/spectralogic/ds3cli/Ds3Cli_Test.java index 48a4e3b..22b65d4 100644 --- a/ds3_java_cli/src/test/java/com/spectralogic/ds3cli/Ds3Cli_Test.java +++ b/ds3_java_cli/src/test/java/com/spectralogic/ds3cli/Ds3Cli_Test.java @@ -38,6 +38,7 @@ import org.apache.commons.cli.MissingOptionException; import org.apache.commons.cli.UnrecognizedOptionException; import org.apache.commons.io.IOUtils; +import org.hamcrest.CoreMatchers; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.invocation.InvocationOnMock; @@ -57,6 +58,8 @@ import static com.spectralogic.ds3cli.util.Constants.DATE_FORMAT; import static com.spectralogic.ds3client.utils.ResponseUtils.toImmutableIntList; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.*; @@ -394,88 +397,99 @@ public void getBucketJson() throws Exception { assertTrue(command instanceof GetBucket); final View view = command.getView(); - final String expected = - " \"Data\" : {\n" + - " \"bucket\" : {\n" + - " \"CreationDate\" : \"2016-11-18T15:48:08.000Z\",\n" + - " \"DataPolicyId\" : \"8a5d5e56-8d54-4098-b790-6002730b3d96\",\n" + - " \"Empty\" : null,\n" + - " \"Id\" : \"07cbc080-16ae-46ea-a275-ec8cb27e178c\",\n" + - " \"LastPreferredChunkSizeInBytes\" : 19004340787,\n" + - " \"LogicalUsedCapacity\" : 1928234,\n" + - " \"Name\" : \"mountain\",\n" + - " \"UserId\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"result\" : [ {\n" + - " \"etag\" : \"3d1bc5d88e795c5b23da7f812c073870\",\n" + - " \"ETag\" : \"3d1bc5d88e795c5b23da7f812c073870\",\n" + - " \"Key\" : \"YouDontKnowMe_295x166.jpg\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 10634,\n" + - " \"StorageClass\" : null\n" + - " }, {\n" + - " \"etag\" : \"ef751d03b7fe4fb2013be56c5a8da26e\",\n" + - " \"ETag\" : \"ef751d03b7fe4fb2013be56c5a8da26e\",\n" + - " \"Key\" : \"sky_bandana.jpg\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 142164,\n" + - " \"StorageClass\" : null\n" + - " }, {\n" + - " \"etag\" : \"a2750043425399804e83288f5f97d112\",\n" + - " \"ETag\" : \"a2750043425399804e83288f5f97d112\",\n" + - " \"Key\" : \"sky_point,web.jpg\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 17120,\n" + - " \"StorageClass\" : null\n" + - " }, {\n" + - " \"etag\" : \"71e93f1026d0362aa0b7dccedf031d8c\",\n" + - " \"ETag\" : \"71e93f1026d0362aa0b7dccedf031d8c\",\n" + - " \"Key\" : \"skylark,l5ct2.bmp\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 921654,\n" + - " \"StorageClass\" : null\n" + - " }, {\n" + - " \"etag\" : \"777fd3670853d4f197c52cfa6a21f773\",\n" + - " \"ETag\" : \"777fd3670853d4f197c52cfa6a21f773\",\n" + - " \"Key\" : \"skylark--car 001.jpg\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 391998,\n" + - " \"StorageClass\" : null\n" + - " }, {\n" + - " \"etag\" : \"6dc0c5e59418d651777c8432e13e9539\",\n" + - " \"ETag\" : \"6dc0c5e59418d651777c8432e13e9539\",\n" + - " \"Key\" : \"skylark004.jpg\",\n" + - " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + - " \"Owner\" : {\n" + - " \"DisplayName\" : \"jk\",\n" + - " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + - " },\n" + - " \"Size\" : 444664,\n" + - " \"StorageClass\" : null\n" + - " } ]\n" + - " },\n" + - " \"Status\" : \"OK\"\n" + - "}"; + final String expected = " \"Data\" : {\n" + + " \"bucket\" : {\n" + + " \"CreationDate\" : \"2016-11-18T15:48:08.000Z\",\n" + + " \"DataPolicyId\" : \"8a5d5e56-8d54-4098-b790-6002730b3d96\",\n" + + " \"Empty\" : null,\n" + + " \"Id\" : \"07cbc080-16ae-46ea-a275-ec8cb27e178c\",\n" + + " \"LastPreferredChunkSizeInBytes\" : 19004340787,\n" + + " \"LogicalUsedCapacity\" : 1928234,\n" + + " \"Name\" : \"mountain\",\n" + + " \"UserId\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"result\" : [ {\n" + + " \"etag\" : \"3d1bc5d88e795c5b23da7f812c073870\",\n" + + " \"ETag\" : \"3d1bc5d88e795c5b23da7f812c073870\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"YouDontKnowMe_295x166.jpg\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 10634,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " }, {\n" + + " \"etag\" : \"ef751d03b7fe4fb2013be56c5a8da26e\",\n" + + " \"ETag\" : \"ef751d03b7fe4fb2013be56c5a8da26e\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"sky_bandana.jpg\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 142164,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " }, {\n" + + " \"etag\" : \"a2750043425399804e83288f5f97d112\",\n" + + " \"ETag\" : \"a2750043425399804e83288f5f97d112\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"sky_point,web.jpg\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 17120,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " }, {\n" + + " \"etag\" : \"71e93f1026d0362aa0b7dccedf031d8c\",\n" + + " \"ETag\" : \"71e93f1026d0362aa0b7dccedf031d8c\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"skylark,l5ct2.bmp\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 921654,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " }, {\n" + + " \"etag\" : \"777fd3670853d4f197c52cfa6a21f773\",\n" + + " \"ETag\" : \"777fd3670853d4f197c52cfa6a21f773\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"skylark--car 001.jpg\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 391998,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " }, {\n" + + " \"etag\" : \"6dc0c5e59418d651777c8432e13e9539\",\n" + + " \"ETag\" : \"6dc0c5e59418d651777c8432e13e9539\",\n" + + " \"IsLatest\" : null,\n" + + " \"Key\" : \"skylark004.jpg\",\n" + + " \"LastModified\" : \"2016-11-18T15:48:10.000Z\",\n" + + " \"Owner\" : {\n" + + " \"DisplayName\" : \"jk\",\n" + + " \"ID\" : \"5079e312-bcff-43c7-bd54-d8148af0a515\"\n" + + " },\n" + + " \"Size\" : 444664,\n" + + " \"StorageClass\" : null,\n" + + " \"VersionId\" : null\n" + + " } ]\n" + + " },\n" + + " \"Status\" : \"OK\"\n" + + "}"; final String packet = "3d1bc5d88e795c5b23da7f812c073870YouDontKnowMe_295x166.jpg2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a51510634ef751d03b7fe4fb2013be56c5a8da26esky_bandana.jpg2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a515142164a2750043425399804e83288f5f97d112sky_point,web.jpg2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a5151712071e93f1026d0362aa0b7dccedf031d8cskylark,l5ct2.bmp2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a515921654777fd3670853d4f197c52cfa6a21f773skylark--car 001.jpg2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a5153919986dc0c5e59418d651777c8432e13e9539skylark004.jpg2016-11-18T15:48:10.000Zjk5079e312-bcff-43c7-bd54-d8148af0a5154446642016-11-18T15:48:08.000Zfalse1000mountain"; @@ -492,7 +506,7 @@ public void getBucketJson() throws Exception { final GetBucketResult getBucketResult = new GetBucketResult(bucket, objects.getObjects()); final String result = view.render(getBucketResult); - assertTrue(result.endsWith(expected)); + assert(result.endsWith(expected)); } @Test @@ -747,7 +761,7 @@ public void getCompletedJob() throws Exception { final View view = command.getView(); final String expected = "JobId: " + jobId + " | Name: Good Job | Status: COMPLETED | Bucket: bucket | Type: GET | Priority: HIGH | User Name: spectra | Creation Date: 2015-09-28T17:30:43.000Z | Total Size: 32 | Total Transferred: 0"; - final String packet = ""; + final String packet = ""; final MasterObjectList objects = XmlOutput.fromXml(packet, MasterObjectList.class); final GetJobResult getJobResult = new GetJobResult(objects); @@ -772,7 +786,7 @@ public void getCompletedJobJson() throws Exception { " \"cachedSizeInBytes\" : 0,\n" + " \"chunkClientProcessingOrderGuarantee\" : \"NONE\",\n" + " \"completedSizeInBytes\" : 0,\n" + - " \"entirelyInCache\" : false,\n" + + " \"entirelyInCache\" : null,\n" + " \"jobId\" : \"aa5df0cc-b03a-4cb9-b69d-56e7367e917f\",\n" + " \"naked\" : false,\n" + " \"name\" : null,\n" + @@ -790,7 +804,7 @@ public void getCompletedJobJson() throws Exception { " \"Status\" : \"OK\"\n" + "}"; - final String packet = ""; + final String packet = ""; final MasterObjectList objects = XmlOutput.fromXml(packet, MasterObjectList.class); final GetJobResult getJobResult = new GetJobResult(objects); @@ -1572,10 +1586,10 @@ public void testGetPhysicalPlacementOnTape() throws Exception { tape1.setPartitionId(tape1PartitionId); tape1.setState(TapeState.PENDING_INSPECTION); final UUID tape1StorageDomainId = UUID.randomUUID(); - tape1.setStorageDomainId(tape1StorageDomainId); + tape1.setStorageDomainMemberId(tape1StorageDomainId); tape1.setTakeOwnershipPending(false); tape1.setTotalRawCapacity(20000L); - tape1.setType("LTO6"); + tape1.setType(TapeDriveType.LTO6.toString()); tape1.setWriteProtected(false); tape1.setEjectLabel("Tape1EjectLabel"); tape1.setEjectLocation("Tape1EjectLocation"); @@ -1591,10 +1605,10 @@ public void testGetPhysicalPlacementOnTape() throws Exception { tape2.setPartitionId(tape2PartitionId); tape2.setState(TapeState.PENDING_INSPECTION); final UUID tape2StorageDomainId = UUID.randomUUID(); - tape2.setStorageDomainId(tape2StorageDomainId); + tape2.setStorageDomainMemberId(tape2StorageDomainId); tape2.setTakeOwnershipPending(false); tape2.setTotalRawCapacity(20000L); - tape2.setType("LTO7"); + tape2.setType(TapeDriveType.LTO7.toString()); tape2.setWriteProtected(false); tape2.setEjectLabel("Tape2EjectLabel"); tape2.setEjectLocation("Tape2EjectLocation"); @@ -1618,8 +1632,7 @@ public void testGetPhysicalPlacementOnTape() throws Exception { final String result = view.render(new GetPhysicalPlacementWithFullDetailsResult(bulkObjectList)); assertTrue(result.contains("| Object Name | ID | In Cache | Length | Offset | Latest | Version |")); - assertTrue(result.contains("| testObject | | Unknown | 1024 | 0 | false | 0 |")); - + assertTrue(result.contains("| testObject | | Unknown | 1024 | 0 | false | N/A |")); assertTrue(result.contains("| Tape Bar Code | State | Type | Description | Eject Label | Eject Location |")); assertTrue(result.contains("| 121557L6 | PENDING_INSPECTION | LTO6 | N/A | Tape1EjectLabel | Tape1EjectLocation |")); assertTrue(result.contains("| 421555L7 | PENDING_INSPECTION | LTO7 | N/A | Tape2EjectLabel | Tape2EjectLocation |")); @@ -1640,7 +1653,7 @@ public void testGetPhysicalPlacementOnPool() throws Exception { pool1.setReservedCapacity(0L); pool1.setState(PoolState.NORMAL); final UUID pool1StorageDomainId = UUID.randomUUID(); - pool1.setStorageDomainId(pool1StorageDomainId); + pool1.setStorageDomainMemberId(pool1StorageDomainId); pool1.setTotalCapacity(420000L); pool1.setType(PoolType.NEARLINE); pool1.setUsedCapacity(6L*7L); @@ -1658,7 +1671,7 @@ public void testGetPhysicalPlacementOnPool() throws Exception { pool2.setReservedCapacity(0L); pool2.setState(PoolState.NORMAL); final UUID pool2StorageDomainId = UUID.randomUUID(); - pool2.setStorageDomainId(pool2StorageDomainId); + pool2.setStorageDomainMemberId(pool2StorageDomainId); pool2.setTotalCapacity(420000L); pool2.setType(PoolType.NEARLINE); pool2.setUsedCapacity(6L*7L); @@ -1682,7 +1695,7 @@ public void testGetPhysicalPlacementOnPool() throws Exception { final String result = view.render(new GetPhysicalPlacementWithFullDetailsResult(bulkObjectList)); assertTrue(result.contains("| Object Name | ID | In Cache | Length | Offset | Latest | Version |")); - assertTrue(result.contains("| testObject | | Unknown | 1024 | 0 | false | 0 |")); + assertTrue(result.contains("| testObject | | Unknown | 1024 | 0 | false | N/A |")); assertTrue(result.contains("| Pool Name | ID | Bucket ID | State | Health | Type | Partition ID |")); assertTrue(result.contains("| pool1 | " + pool1Id.toString() + " | | NORMAL | OK | NEARLINE | |")); @@ -1691,17 +1704,19 @@ public void testGetPhysicalPlacementOnPool() throws Exception { @Test public void testGetPhysicalPlacementOnCloud() throws Exception { + final String uuid = "a231d751-b1ae-4569-b59c-230892363d7f"; final Arguments args = new Arguments(new String[]{"ds3_java_cli", "-e", "localhost:8080", "-k", "key!", "-a", "access", "-c", "get_physical_placement", "-b", "bothclouds", "-o", "VBoxSVC.log"}); final CliCommand command = CliCommandFactory.getCommandExecutor(args.getCommand()); command.init(args); assertTrue(command instanceof GetPhysicalPlacement); final View view = command.getView(); - final String expected = "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + - "| Object Name | ID | In Cache | Length | Offset | Latest | Version |\n" + - "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + - "| VBoxSVC.log | 809e1e66-13e7-4441-8eda-10b1ddb528ca | false | 8611 | 0 | true | 1 |\n" + - "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + + final String expected = + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + + "| Object Name | ID | In Cache | Length | Offset | Latest | Version |\n" + + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + + "| VBoxSVC.log | 809e1e66-13e7-4441-8eda-10b1ddb528ca | false | 8611 | 0 | true | a231d751-b1ae-4569-b59c-230892363d7f |\n" + + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + "+------------------------------------+--------------------------------------+-----------+--------+--------+----------+--------------------------------------+\n" + "| Pool Name | ID | Bucket ID | State | Health | Type | Partition ID |\n" + "+------------------------------------+--------------------------------------+-----------+--------+--------+----------+--------------------------------------+\n" + @@ -1719,7 +1734,7 @@ public void testGetPhysicalPlacementOnCloud() throws Exception { "+-------------+--------+--------------------------------------+----------+-----------+--------------------+\n"; final String packet = "" + - "" + + "" + "" + "" + "/h/NVMdssiwLKQBAGd+AGMFhDbesFTRziWQJw1eYjL5x9zvYInCLsxZO/SuMizasrULUEJccTD3fCuXH8OpE4Q==" + @@ -1743,7 +1758,7 @@ public void testGetPhysicalPlacementOnCloud() throws Exception { "Arctic_Blue_1_13867492206260533141" + "fa827f71-b9a7-451a-98cf-c3392bad9323true" + "NO14209583782297" + - "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + + "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + "142095837822976NEARLINE" + "790121185760" + "" + @@ -1774,11 +1789,11 @@ public void testGetPhysicalPlacementOnReplication() throws Exception { final View view = command.getView(); final String expected = - "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + - "| Object Name | ID | In Cache | Length | Offset | Latest | Version |\n" + - "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + - "| VBox.log | 35e2c6ba-95f9-47ff-947c-194923633232 | false | 102363 | 0 | true | 1 |\n" + - "+-------------+--------------------------------------+----------+--------+--------+--------+---------+\n" + + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + + "| Object Name | ID | In Cache | Length | Offset | Latest | Version |\n" + + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + + "| VBox.log | 35e2c6ba-95f9-47ff-947c-194923633232 | false | 102363 | 0 | true | 17af634d-7955-4e1b-a16a-cfa9292f01ae |\n" + + "+-------------+--------------------------------------+----------+--------+--------+--------+--------------------------------------+\n" + "+------------------------------------+--------------------------------------+-----------+--------+--------+----------+--------------------------------------+\n" + "| Pool Name | ID | Bucket ID | State | Health | Type | Partition ID |\n" + "+------------------------------------+--------------------------------------+-----------+--------+--------+----------+--------------------------------------+\n" + @@ -1791,7 +1806,7 @@ public void testGetPhysicalPlacementOnReplication() throws Exception { "+------------------+--------+--------------------------------------+----------+--------------------+\n"; final String packet = "" + - "" + + "" + "" + "NONE" + "c3BlY3RyYQ==MFri35Rk" + @@ -1808,7 +1823,7 @@ public void testGetPhysicalPlacementOnReplication() throws Exception { "/pool/Arctic_Blue_1_13867492206260533141/vol/data/ds3" + "Arctic_Blue_1_13867492206260533141fa827f71-b9a7-451a-98cf-c3392bad9323" + "trueNO14209583782297" + - "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + + "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + "142095837822976NEARLINE790121185760" + "" + "" + @@ -1828,11 +1843,11 @@ public void getDataPolicies() throws Exception { assertTrue(command instanceof GetDataPolicies); final View view = command.getView(); - final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id | LTFS Object Naming |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| fred | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 | true |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n"; + final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| fred | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n"; final String packet = "" + "false" + @@ -1844,7 +1859,6 @@ public void getDataPolicies() throws Exception { "LOW" + "false" + "d3e6e795-fc85-4163-9d2f-4bc271d995d0" + - "true" + "fred" + "LOW" + "NONE"; @@ -1863,11 +1877,11 @@ public void getDataPolicy() throws Exception { assertTrue(command instanceof GetDataPolicy); final View view = command.getView(); - final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id | LTFS Object Naming |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| fake | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 | true |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n"; + final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| fake | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n"; final String packet = "" + "false" + @@ -1879,7 +1893,6 @@ public void getDataPolicy() throws Exception { "LOW" + "false" + "d3e6e795-fc85-4163-9d2f-4bc271d995d0" + - "true" + "fake" + "LOW" + "NONE"; @@ -1899,11 +1912,11 @@ public void modifyDataPolicy() throws Exception { assertTrue(command instanceof ModifyDataPolicy); final View view = command.getView(); - final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id | LTFS Object Naming |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n" - +"| fred | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 | true |\n" - +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+--------------------+\n"; + final String expected = "+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| Name | Created | Versioning | Checksum Type | End-to-End CRC Required | Blobbing Enabled | Default Blob Size | Default Get Job Priority | Default Put Job Priority | Default Verify Job Priority | Id |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n" + +"| fred | 2016-04-26T14:17:04.000Z | NONE | MD5 | false | false | 1073741824 | HIGH | NORMAL | LOW | d3e6e795-fc85-4163-9d2f-4bc271d995d0 |\n" + +"+------+--------------------------+------------+---------------+-------------------------+------------------+-------------------+--------------------------+--------------------------+-----------------------------+--------------------------------------+\n"; final String packet = "" + "false" + @@ -1915,7 +1928,7 @@ public void modifyDataPolicy() throws Exception { "LOW" + "false" + "d3e6e795-fc85-4163-9d2f-4bc271d995d0" + - "true" + +// "true" + "fred" + "LOW" + "NONE" + @@ -2073,7 +2086,8 @@ public void getBlobsOnTape() throws Exception { final View view = command.getView(); - final String expected = "+-------------------------------------------------+-------------+-----------+--------------------------------------+\n" + + final String expected = + "+-------------------------------------------------+-------------+-----------+--------------------------------------+\n" + "| Name | Bucket | Size | Id |\n" + "+-------------------------------------------------+-------------+-----------+--------------------------------------+\n" + "| 123456789.txt | coffeehouse | 9 | 53452a07-699a-4c27-8de5-95aa0a431df1 |\n" + @@ -2104,31 +2118,31 @@ public void getBlobsOnTape() throws Exception { "+-------------------------------------------------+-------------+-----------+--------------------------------------+\n"; final String packet = "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + ""; final BulkObjectList blobs = XmlOutput.fromXml(packet, BulkObjectList.class); @@ -2182,6 +2196,7 @@ public void getBlobsOnTapeMissingTape() throws Exception { @Test public void verifyBulkJob() throws Exception { + final String uuid = "c823f683-6789-4fd7-912c-8060fed0cdad"; final Arguments args = new Arguments(new String[]{"ds3_java_cli", "-e", "localhost:8080", "-k", "key!", "-a", "access", "-c", "verify_bulk_job", "-b", "coffeehouse" }); final CliCommand command = CliCommandFactory.getCommandExecutor(args.getCommand()); command.init(args); @@ -2189,65 +2204,65 @@ public void verifyBulkJob() throws Exception { final View view = command.getView(); final String expected = - "+-------+-------------------------------------------------+-----------+---------+\n" + - "| Chunk | Name | Size | Version |\n" + - "+-------+-------------------------------------------------+-----------+---------+\n" + - "| 0 | 123456789.txt | 9 | 1 |\n" + - "| 0 | Always_295x166.jpg | 9172 | 1 |\n" + - "| 0 | Chapter 9.docx | 29895 | 1 |\n" + - "| 0 | RedRiverValley_295x166.jpg | 9114 | 1 |\n" + - "| 0 | Softphone Install.docx | 774741 | 1 |\n" + - "| 0 | ThinkingOutLoud_295x166.jpg | 11059 | 1 |\n" + - "| 0 | UnforgetWonderful_295x166.jpg | 10724 | 1 |\n" + - "| 0 | YouDontKnowMe_295x166.jpg | 10634 | 1 |\n" + - "| 0 | beowulf.txt | 294056 | 1 |\n" + - "| 0 | coffeehouse/im_in_the_mood.mp3 | 3309717 | 1 |\n" + - "| 0 | coffeehouse/jk/ColumbinesGrow.m4a | 45872985 | 1 |\n" + - "| 0 | coffeehouse/jk/ColumbinesGrow.mp3 | 5050747 | 1 |\n" + - "| 0 | coffeehouse/jk/Columbines_295x166.jpg | 10528 | 1 |\n" + - "| 0 | coffeehouse/jk/Misty_2015.m4a | 10396369 | 1 |\n" + - "| 0 | coffeehouse/jk/RedRiverValley.m4a | 77080710 | 1 |\n" + - "| 0 | coffeehouse/jk/RedRiverValley.mp3 | 6363965 | 1 |\n" + - "| 0 | coffeehouse/jk/UnforgetWonderful_295x166.jpg | 10724 | 1 |\n" + - "| 0 | coffeehouse/jk/Unforgettable-WonderfulWorld.m4a | 110054089 | 1 |\n" + - "| 0 | coffeehouse/jk/Unforgettable-WonderfulWorld.mp3 | 7520930 | 1 |\n" + - "| 0 | coffeehouse/jk/WhereOrWhen.m4a | 51272203 | 1 |\n" + - "| 0 | coffeehouse/jk/WhereOrWhen.mp3 | 5647581 | 1 |\n" + - "| 0 | coffeehouse/jk/WhereOrWhen_295x166.jpg | 11263 | 1 |\n" + - "| 0 | coffeehouse/jk/im_in_the_mood.m4a | 11207247 | 1 |\n" + - "| 0 | coffeehouse/jk/im_in_the_mood_200.jpg | 8621 | 1 |\n" + - "| 0 | coffeehouse/witchcraft.mp3 | 6409093 | 1 |\n" + - "+-------+-------------------------------------------------+-----------+---------+\n"; + "+-------+-------------------------------------------------+-----------+--------------------------------------+\n" + + "| Chunk | Name | Size | Version |\n" + + "+-------+-------------------------------------------------+-----------+--------------------------------------+\n" + + "| 0 | 123456789.txt | 9 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | Always_295x166.jpg | 9172 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | Chapter 9.docx | 29895 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | RedRiverValley_295x166.jpg | 9114 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | Softphone Install.docx | 774741 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | ThinkingOutLoud_295x166.jpg | 11059 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | UnforgetWonderful_295x166.jpg | 10724 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | YouDontKnowMe_295x166.jpg | 10634 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | beowulf.txt | 294056 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/im_in_the_mood.mp3 | 3309717 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/ColumbinesGrow.m4a | 45872985 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/ColumbinesGrow.mp3 | 5050747 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/Columbines_295x166.jpg | 10528 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/Misty_2015.m4a | 10396369 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/RedRiverValley.m4a | 77080710 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/RedRiverValley.mp3 | 6363965 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/UnforgetWonderful_295x166.jpg | 10724 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/Unforgettable-WonderfulWorld.m4a | 110054089 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/Unforgettable-WonderfulWorld.mp3 | 7520930 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/WhereOrWhen.m4a | 51272203 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/WhereOrWhen.mp3 | 5647581 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/WhereOrWhen_295x166.jpg | 11263 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/im_in_the_mood.m4a | 11207247 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/jk/im_in_the_mood_200.jpg | 8621 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "| 0 | coffeehouse/witchcraft.mp3 | 6409093 | c823f683-6789-4fd7-912c-8060fed0cdad |\n" + + "+-------+-------------------------------------------------+-----------+--------------------------------------+\n"; final String packet = "" + "" + "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + "" + ""; @@ -2388,7 +2403,7 @@ public void getTapes() throws Exception { "52741a53-24d5-4391-87a9-9cce703d7ed72016-06-29T20:28:45.000Z" + "6fc8a8c6-0b14-4ef6-a4ec-b7246028fa8e:22016-06-29T20:24:35.000Z" + "f3a7b5dd-af2d-4dc3-84d9-6ac69fab135c" + - "HP-Y140125415NORMAL" + + "HP-Y140125415NORMAL" + "false2408088338432" + "LTO6false" + "" + @@ -2401,7 +2416,7 @@ public void getTapes() throws Exception { "2016-07-18T03:04:30.000Z" + "f3a7b5dd-af2d-4dc3-84d9-6ac69fab135c" + "HP-Y140125438NORMAL" + - "" + storageDoamin1Id + "" + + "" + storageDoamin1Id + "" + "false2408088338432" + "LTO6false" + "" + @@ -2413,7 +2428,7 @@ public void getTapes() throws Exception { "723aeba4-2fbe-43e2-a14c-cd8975d56c0c:2" + "2016-06-29T20:18:44.000Z" + "f3a7b5dd-af2d-4dc3-84d9-6ac69fab135c" + - "HP-S140125234NORMAL" + + "HP-S140125234NORMAL" + "false2408088338432" + "LTO6false" + "" + @@ -2430,7 +2445,7 @@ public void getTapes() throws Exception { "f3a7b5dd-af2d-4dc3-84d9-6ac69fab135c" + "HP-X131014007" + "NORMAL" + - "" + storageDoamin2Id + "" + + "" + storageDoamin2Id + "" + "false" + "2408088338432" + "LTO6" + @@ -2467,7 +2482,7 @@ public void getTapesWithBucketId() throws Exception { "52741a53-24d5-4391-87a9-9cce703d7ed72016-06-29T20:28:45.000Z" + "6fc8a8c6-0b14-4ef6-a4ec-b7246028fa8e:22016-06-29T20:24:35.000Z" + "f3a7b5dd-af2d-4dc3-84d9-6ac69fab135c" + - "HP-Y140125415NORMAL" + + "HP-Y140125415NORMAL" + "false2408088338432" + "LTO6false" + "", "utf-8"); @@ -2514,7 +2529,7 @@ public void ejectTape() throws Exception { "2017-01-19T22:16:09.000Z" + "9bccaba8-440a-431f-9357-5a66c48d09f2" + "FOREIGNHP-G140314442" + - "FORMAT_IN_PROGRESS" + + "FORMAT_IN_PROGRESS" + "false1425000103936" + "LTO5false" + "", "utf-8"); @@ -2643,13 +2658,11 @@ public void getCapacitySummary() throws Exception { final InputStream packet = IOUtils.toInputStream("" + "" + "9" + - "0" + "2" + "7" + "" + "" + "8" + - "0" + "3" + "5" + "" + @@ -2688,13 +2701,11 @@ public void getCapacitySummaryJson() throws Exception { final InputStream packet = IOUtils.toInputStream("" + "" + "9" + - "0" + "2" + "7" + "" + "" + "8" + - "0" + "3" + "5" + "" + @@ -2715,17 +2726,16 @@ public void getDataPathBackend() throws Exception { final View view = command.getView(); final String expected = - "+-----------+--------------+--------------+---------------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n" + - "| Activated | Auto Timeout | Auto Inspect | Conflict Resolution | ID | Last Heartbeat | Unavailable Media Policy | Unavailable Pool Retry Mins | Unavailable Partition Retry Mins |\n" + - "+-----------+--------------+--------------+---------------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n" + - "| true | 30 | FULL | CANCEL | 5d45ab7a-b83f-4dc1-95d5-a45b59e48718 | 2016-09-07T22:09:55.000Z | DISALLOW | 20 | 20 |\n" + - "+-----------+--------------+--------------+---------------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n"; + "+-----------+--------------+--------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n" + + "| Activated | Auto Timeout | Auto Inspect | ID | Last Heartbeat | Unavailable Media Policy | Unavailable Pool Retry Mins | Unavailable Partition Retry Mins |\n" + + "+-----------+--------------+--------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n" + + "| true | 30 | FULL | 5d45ab7a-b83f-4dc1-95d5-a45b59e48718 | 2016-09-07T22:09:55.000Z | DISALLOW | 20 | 20 |\n" + + "+-----------+--------------+--------------+--------------------------------------+--------------------------+--------------------------+-----------------------------+----------------------------------+\n"; final InputStream packet = IOUtils.toInputStream("" + "true" + "30" + "FULL" + - "CANCEL" + "5d45ab7a-b83f-4dc1-95d5-a45b59e48718" + "5d45ab7a-b83f-4dc1-95d5-a45b59e48718" + "2016-09-07T22:09:55.000Z" + @@ -2749,30 +2759,30 @@ public void getDataPathBackendJson() throws Exception { assertTrue(command instanceof GetDataPathBackend); final View view = command.getView(); - final String expected = - " \"Data\" : {\n" + - " \"Activated\" : true,\n" + - " \"AutoActivateTimeoutInMins\" : 30,\n" + - " \"AutoInspect\" : \"NEVER\",\n" + - " \"DefaultImportConflictResolutionMode\" : \"CANCEL\",\n" + - " \"DefaultVerifyDataAfterImport\" : null,\n" + - " \"DefaultVerifyDataPriorToImport\" : false,\n" + - " \"Id\" : \"5d45ab7a-b83f-4dc1-95d5-a45b59e48718\",\n" + - " \"InstanceId\" : \"5d45ab7a-b83f-4dc1-95d5-a45b59e48718\",\n" + - " \"LastHeartbeat\" : \"2016-09-07T22:09:55.000Z\",\n" + - " \"PartiallyVerifyLastPercentOfTapes\" : null,\n" + - " \"UnavailableMediaPolicy\" : \"DISALLOW\",\n" + - " \"UnavailablePoolMaxJobRetryInMins\" : 20,\n" + - " \"UnavailableTapePartitionMaxJobRetryInMins\" : 20\n" + - " },\n" + - " \"Status\" : \"OK\"\n" + - "}"; + final String expected = " \"Data\" : {\n" + + " \"Activated\" : true,\n" + + " \"AllowNewJobRequests\" : false,\n" + + " \"AutoActivateTimeoutInMins\" : 30,\n" + + " \"AutoInspect\" : \"NEVER\",\n" + + " \"CacheAvailableRetryAfterInSeconds\" : 0,\n" + + " \"DefaultVerifyDataAfterImport\" : null,\n" + + " \"DefaultVerifyDataPriorToImport\" : false,\n" + + " \"Id\" : \"5d45ab7a-b83f-4dc1-95d5-a45b59e48718\",\n" + + " \"InstanceId\" : \"5d45ab7a-b83f-4dc1-95d5-a45b59e48718\",\n" + + " \"IomEnabled\" : false,\n" + + " \"LastHeartbeat\" : \"2016-09-07T22:09:55.000Z\",\n" + + " \"PartiallyVerifyLastPercentOfTapes\" : null,\n" + + " \"UnavailableMediaPolicy\" : \"DISALLOW\",\n" + + " \"UnavailablePoolMaxJobRetryInMins\" : 20,\n" + + " \"UnavailableTapePartitionMaxJobRetryInMins\" : 20\n" + + " },\n" + + " \"Status\" : \"OK\"\n" + + "}"; final InputStream packet = IOUtils.toInputStream("" + "true" + "30" + "NEVER" + - "CANCEL" + "5d45ab7a-b83f-4dc1-95d5-a45b59e48718" + "5d45ab7a-b83f-4dc1-95d5-a45b59e48718" + "2016-09-07T22:09:55.000Z" + @@ -2785,7 +2795,7 @@ public void getDataPathBackendJson() throws Exception { final DataPathBackend backendInfo = XmlOutput.fromXml(packet, DataPathBackend.class); final GetDataPathBackendResult backendResult = new GetDataPathBackendResult(backendInfo); final String result = view.render(backendResult); - assertTrue(result.endsWith(expected)); + assertThat(result, CoreMatchers.endsWith(expected)); } @Test @@ -2882,7 +2892,7 @@ public void getJobsJson() throws Exception { " \"cachedSizeInBytes\" : 343479386,\n" + " \"chunkClientProcessingOrderGuarantee\" : \"IN_ORDER\",\n" + " \"completedSizeInBytes\" : 0,\n" + - " \"entirelyInCache\" : false,\n" + + " \"entirelyInCache\" : null,\n" + " \"jobId\" : \"52dc72a9-7876-4024-9034-d2f6e886f7e7\",\n" + " \"naked\" : false,\n" + " \"name\" : \"PUT by 192.168.1.12\",\n" + @@ -2915,7 +2925,7 @@ public void getJobsJson() throws Exception { final JobList jobs = XmlOutput.fromXml(packet, JobList.class); final GetJobsResult jobsResult = new GetJobsResult(jobs); final String result = view.render(jobsResult); - assertTrue(result.endsWith(expected)); + assert(result.endsWith(expected)); } /** @@ -3137,7 +3147,7 @@ public void verifyTape() throws Exception { "2017-02-21T21:37:31.000Z" + "2e705e0c-7608-4179-b794-de1f30059081" + "HP-G140314442" + - "NORMAL785c194c-1844-4f2a-8896-95f9418bbc4d" + + "NORMAL785c194c-1844-4f2a-8896-95f9418bbc4d" + "false1425000103936" + "LTO5false" + "", "utf-8"); @@ -3173,7 +3183,7 @@ public void cancelVerifyTape() throws Exception { "2017-02-21T21:37:31.000Z" + "2e705e0c-7608-4179-b794-de1f30059081" + "HP-G140314442" + - "NORMAL785c194c-1844-4f2a-8896-95f9418bbc4d" + + "NORMAL785c194c-1844-4f2a-8896-95f9418bbc4d" + "false1425000103936" + "LTO5false" + "", "utf-8"); @@ -3220,7 +3230,7 @@ public void getPool() throws Exception { "1982c83f-ee80-434f-ae5b-19415faa5b01" + "trueNO" + "386117455052NORMAL" + - "896dcbf3-66a6-4f4f-a163-0210c6e0ab4b" + + "896dcbf3-66a6-4f4f-a163-0210c6e0ab4b" + "3861174550528ONLINE" + "44370332160" + "", "utf-8"); @@ -3267,7 +3277,7 @@ public void getPools() throws Exception { "fa827f71-b9a7-451a-98cf-c3392bad9323" + "trueNO" + "14209583782297" + - "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + + "NORMAL8253863e-8818-4677-8e6b-60b1d398dd1e" + "142095837822976NEARLINE" + "789712094144" + "" + @@ -3282,7 +3292,7 @@ public void getPools() throws Exception { "1982c83f-ee80-434f-ae5b-19415faa5b01" + "trueNO" + "386117455052NORMAL" + - "896dcbf3-66a6-4f4f-a163-0210c6e0ab4b" + + "896dcbf3-66a6-4f4f-a163-0210c6e0ab4b" + "3861174550528ONLINE" + "44370332160" + "", "utf-8");