@Test
@Ignore
public void shouldDownscaleImagesTest() {

    int iterations = 5;
    int j = iterations;
    while (--j>=0) {
        setup();
        // Create test scheduler.
        NonThreadScheduler scheduler = new NonThreadScheduler(gm);
        scheduler.startup();
        // Put a rotation request on the pipe.
        if (PipeWriter.tryWriteFragment(imageRotationInputPipe, ImageRotationSchema.MSG_ROTATIONREQUEST_1)) {
            PipeWriter.writeLong(imageRotationInputPipe, ImageRotationSchema.MSG_ROTATIONREQUEST_1_FIELD_NUMERATOR_101, ROTATION_ANGLE[0]);
            PipeWriter.writeLong(imageRotationInputPipe, ImageRotationSchema.MSG_ROTATIONREQUEST_1_FIELD_DENOMINATOR_201, ROTATION_ANGLE[1]);
            PipeWriter.writeLong(imageRotationInputPipe, ImageRotationSchema.MSG_ROTATIONREQUEST_1_FIELD_TIMESTAMP_301,Long.MAX_VALUE);
            PipeWriter.publishWrites(imageRotationInputPipe);
        }
        // Run until we write a frame.
        while (rotationPipeReaderState.framesProcessed <= 0) {
            // Run scheduler pipe.
            scheduler.run();
            // Read from pipe.
            readFromRotationPipe(rotationOutputPipe, rotationPipeReaderState, LinuxImageCaptureStage.OUTPUT_ENCODING);
        }
        // Verify the frame is valid.
        try {
            Path filePath = Paths.get("src", "test", "images", "cat1-320-240.rotated");
            byte[] fileBytes = Files.readAllBytes(filePath);
            Assert.assertTrue(Arrays.equals(fileBytes, rotationPipeReaderState.currentFrame));
        } catch (IOException e) {
            Assert.fail(e.getMessage());
        }
    }
}