Skip to content

Commit

Permalink
Merge pull request #95 from gcheng/betteraction
Browse files Browse the repository at this point in the history
update tests for linkinfo
  • Loading branch information
Albert Cheng committed Jan 9, 2013
2 parents 9f0b32f + f5c36ad commit 6ef0e49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Expand Up @@ -349,7 +349,7 @@ public void canGetParentBackFromAsset() throws ServiceException, InterruptedExce
assertEquals(1, outputAssets.size()); assertEquals(1, outputAssets.size());
AssetInfo childAsset = outputAssets.get(0); AssetInfo childAsset = outputAssets.get(0);


LinkInfo parentAssetLink = childAsset.getParentAssetsLink(); LinkInfo<AssetInfo> parentAssetLink = childAsset.getParentAssetsLink();
AssetInfo parentAsset = service.get(Asset.get(parentAssetLink)); AssetInfo parentAsset = service.get(Asset.get(parentAssetLink));


// Assert // Assert
Expand Down
Expand Up @@ -96,7 +96,7 @@ public void uploadAesProtectedAssetAndDownloadSuccess() throws Exception {
JobInfo jobInfo = decodeAsset("uploadAesProtectedAssetSuccess", assetInfo.getId()); JobInfo jobInfo = decodeAsset("uploadAesProtectedAssetSuccess", assetInfo.getId());


// assert // assert
LinkInfo taskLinkInfo = jobInfo.getTasksLink(); LinkInfo<TaskInfo> taskLinkInfo = jobInfo.getTasksLink();
List<TaskInfo> taskInfos = service.list(Task.list(taskLinkInfo)); List<TaskInfo> taskInfos = service.list(Task.list(taskLinkInfo));
for (TaskInfo taskInfo : taskInfos) { for (TaskInfo taskInfo : taskInfos) {
assertEquals(TaskState.Completed, taskInfo.getState()); assertEquals(TaskState.Completed, taskInfo.getState());
Expand Down Expand Up @@ -139,9 +139,8 @@ private JobInfo decodeAsset(String name, String inputAssetId) throws ServiceExce
} }


private String makeContentKeyId(byte[] aesKey) throws ServiceException, Exception { private String makeContentKeyId(byte[] aesKey) throws ServiceException, Exception {
String protectionKeyId = (String) service.action(ProtectionKey String protectionKeyId = service.action(ProtectionKey.getProtectionKeyId(ContentKeyType.StorageEncryption));
.getProtectionKeyId(ContentKeyType.StorageEncryption)); String protectionKey = service.action(ProtectionKey.getProtectionKey(protectionKeyId));
String protectionKey = (String) service.action(ProtectionKey.getProtectionKey(protectionKeyId));


String contentKeyIdUuid = UUID.randomUUID().toString(); String contentKeyIdUuid = UUID.randomUUID().toString();
String contentKeyId = String.format("nb:kid:UUID:%s", contentKeyIdUuid); String contentKeyId = String.format("nb:kid:UUID:%s", contentKeyIdUuid);
Expand Down
Expand Up @@ -67,7 +67,7 @@ private void verifyJobProperties(String message, String testName, Integer priori
assertDateApproxEquals(message + " EndTime", endTime, actualJob.getEndTime()); assertDateApproxEquals(message + " EndTime", endTime, actualJob.getEndTime());


if (expectedTaskCount != null) { if (expectedTaskCount != null) {
LinkInfo tasksLink = actualJob.getTasksLink(); LinkInfo<TaskInfo> tasksLink = actualJob.getTasksLink();
ListResult<TaskInfo> actualTasks = service.list(Task.list(tasksLink)); ListResult<TaskInfo> actualTasks = service.list(Task.list(tasksLink));
assertEquals(message + " tasks size", expectedTaskCount.intValue(), actualTasks.size()); assertEquals(message + " tasks size", expectedTaskCount.intValue(), actualTasks.size());
} }
Expand Down

0 comments on commit 6ef0e49

Please sign in to comment.