@Test public void deleteDeltaSnapshot2() throws Exception { SnapshotInfo full = new SnapshotInfo(); full.setStatus(StorageProperties.Status.available.toString()); full.setProgress("100"); full.setSizeGb(new Integer(1)); full.setStartTime(new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(30, TimeUnit.MINUTES))); full.setSnapshotLocation("http: full.setVolumeId("vol-0000002"); full.setSnapshotId("snap-000002a"); full.setSnapPointId("snap-point-id-2a"); full.setIsOrigin(Boolean.TRUE); SnapshotInfo delta1 = new SnapshotInfo(); delta1.setStatus(StorageProperties.Status.deleting.toString()); delta1.setProgress("100"); delta1.setSizeGb(new Integer(1)); delta1.setStartTime(new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(20, TimeUnit.MINUTES))); delta1.setSnapshotLocation("http: delta1.setVolumeId(full.getVolumeId()); delta1.setSnapshotId("snap-000002b"); delta1.setSnapPointId("snap-point-id-2b"); delta1.setIsOrigin(Boolean.TRUE); delta1.setPreviousSnapshotId(full.getSnapshotId()); SnapshotInfo delta2 = new SnapshotInfo(); delta2.setStatus(StorageProperties.Status.deleted.toString()); delta2.setProgress("100"); delta2.setSizeGb(new Integer(1)); delta2.setStartTime(new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(10, TimeUnit.MINUTES))); delta2.setSnapshotLocation("http: delta2.setVolumeId(full.getVolumeId()); delta2.setSnapshotId("snap-000002c"); delta2.setSnapPointId("snap-point-id-2c"); delta2.setIsOrigin(Boolean.TRUE); delta2.setPreviousSnapshotId(delta1.getSnapshotId()); delta2.setDeletionTime(new Date()); try (TransactionResource tran = Entities.transactionFor(SnapshotInfo.class)) { Entities.persist(full); Entities.persist(delta1); Entities.persist(delta2); tran.commit(); } final LogicalStorageManager storageManager = context.mock(LogicalStorageManager.class); context.checking(new Expectations() { { oneOf(storageManager).deleteSnapshot(delta1.getSnapshotId(), delta1.getSnapPointId()); } }); new SnapshotDeleter(storageManager, BlockStorageUnitTestSupport.createMockS3SnapshotTransfer()).run(); context.assertIsSatisfied(); SnapshotInfo processedDelta = Transactions.find(new SnapshotInfo(delta1.getSnapshotId())); assertTrue("expected to have a result querying the eucalyptus_storage persistence context for " + delta1.getSnapshotId(), processedDelta != null); assertTrue("expected SnapshotInfo snapshotID to be " + delta1.getSnapshotId() + " but got " + processedDelta.getSnapshotId(), delta1.getSnapshotId().equals(processedDelta.getSnapshotId())); assertTrue("expected SnapshotInfo status to be " + StorageProperties.Status.deleted + " but got " + processedDelta.getStatus(), StorageProperties.Status.deleted.toString().equals(processedDelta.getStatus())); assertTrue("expected SnapshotInfo deletionTime to be valid but found " + processedDelta.getDeletionTime(), processedDelta.getDeletionTime() != null); }
@Override public void run() { deleteFromEBS(); deleteFromOSG(); }
SnapshotDeleter extends CheckerTask { @Override public void run() { deleteFromEBS(); deleteFromOSG(); } }
SnapshotDeleter extends CheckerTask { @Override public void run() { deleteFromEBS(); deleteFromOSG(); } SnapshotDeleter(LogicalStorageManager blockManager);  SnapshotDeleter(LogicalStorageManager blockManager, S3SnapshotTransfer mock); }
SnapshotDeleter extends CheckerTask { @Override public void run() { deleteFromEBS(); deleteFromOSG(); } SnapshotDeleter(LogicalStorageManager blockManager);  SnapshotDeleter(LogicalStorageManager blockManager, S3SnapshotTransfer mock); @Override void run(); }
SnapshotDeleter extends CheckerTask { @Override public void run() { deleteFromEBS(); deleteFromOSG(); } SnapshotDeleter(LogicalStorageManager blockManager);  SnapshotDeleter(LogicalStorageManager blockManager, S3SnapshotTransfer mock); @Override void run();  }