Search in sources :

Example 1 with BlobTransferStatus

use of io.crate.blob.BlobTransferStatus in project crate by crate.

the class BlobHttpIntegrationTest method assertNoActiveTransfersRemaining.

@After
public void assertNoActiveTransfersRemaining() throws Exception {
    Iterable<BlobTransferTarget> transferTargets = internalCluster().getInstances(BlobTransferTarget.class);
    final Field activeTransfersField = BlobTransferTarget.class.getDeclaredField("activeTransfers");
    activeTransfersField.setAccessible(true);
    assertBusy(() -> {
        for (BlobTransferTarget transferTarget : transferTargets) {
            Map<UUID, BlobTransferStatus> activeTransfers = null;
            try {
                activeTransfers = (Map<UUID, BlobTransferStatus>) activeTransfersField.get(transferTarget);
                assertThat(activeTransfers.keySet(), empty());
            } catch (IllegalAccessException e) {
                throw Throwables.propagate(e);
            }
        }
    });
}
Also used : BlobTransferTarget(io.crate.blob.BlobTransferTarget) Field(java.lang.reflect.Field) BlobTransferStatus(io.crate.blob.BlobTransferStatus) After(org.junit.After)

Aggregations

BlobTransferStatus (io.crate.blob.BlobTransferStatus)1 BlobTransferTarget (io.crate.blob.BlobTransferTarget)1 Field (java.lang.reflect.Field)1 After (org.junit.After)1