/** * Asserts whether actual bitmap is very similar to the expected bitmap at some quality level. * * <p>This is defined as their PSNR value is greater than or equal to the threshold. The higher * the threshold, the more similar they are. * * @param expectedBitmap The expected bitmap. * @param actualBitmap The actual bitmap. * @param psnrThresholdDb The PSNR threshold (in dB), at or above which bitmaps are considered * very similar. */ public static void assertBitmapsAreSimilar( Bitmap expectedBitmap, Bitmap actualBitmap, double psnrThresholdDb) { assertThat(getPsnr(expectedBitmap, actualBitmap)).isAtLeast(psnrThresholdDb); }
/** * Asserts whether actual bitmap is very similar to the expected bitmap at some quality level. * * <p>This is defined as their PSNR value is greater than or equal to the threshold. The higher * the threshold, the more similar they are. * * @param expectedBitmap The expected bitmap. * @param actualBitmap The actual bitmap. * @param psnrThresholdDb The PSNR threshold (in dB), at or above which bitmaps are considered * very similar. */ public static void assertBitmapsAreSimilar( Bitmap expectedBitmap, Bitmap actualBitmap, double psnrThresholdDb) { assertThat(getPsnr(expectedBitmap, actualBitmap)).isAtLeast(psnrThresholdDb); }
private void verifyRetrySettings(Set<Code> retryCodes, RetrySettings retrySettings) { assertThat(retryCodes).containsAllOf(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); assertThat(retrySettings.getTotalTimeout()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getInitialRetryDelay()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getRetryDelayMultiplier()).isAtLeast(1.0); assertThat(retrySettings.getMaxRetryDelay()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getInitialRpcTimeout()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getRpcTimeoutMultiplier()).isAtLeast(1.0); assertThat(retrySettings.getMaxRpcTimeout()).isGreaterThan(Duration.ZERO); } }
private void verifyRetrySettingAreSane(Set<Code> retryCodes, RetrySettings retrySettings) { assertThat(retryCodes).containsAllOf(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE); assertThat(retrySettings.getTotalTimeout()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getInitialRetryDelay()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getRetryDelayMultiplier()).isAtLeast(1.0); assertThat(retrySettings.getMaxRetryDelay()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getInitialRpcTimeout()).isGreaterThan(Duration.ZERO); assertThat(retrySettings.getRpcTimeoutMultiplier()).isAtLeast(1.0); assertThat(retrySettings.getMaxRpcTimeout()).isGreaterThan(Duration.ZERO); } }
@Override public void tick(TimeLapse timeLapse) { final List<RoadUser> list = model.getObjects().asList(); for (int i = 0; i < list.size(); i++) { for (int j = i + 1; j < list.size(); j++) { final Point p1 = model.getPosition(list.get(i)); final Point p2 = model.getPosition(list.get(j)); assert_() .withMessage("%s is too close to %s", list.get(i), list.get(j)) .that(Point.distance(p1, p2)) .isAtLeast(599d); } } }