EqualQa implements Qa<Boolean, Boolean> { @Override public TransientOperation<Boolean, Boolean> evaluate(final BufferedImage left, final BufferedImage right) { CheckEqualSizePreprocessor equalSize = new CheckEqualSizePreprocessor(left, right); equalSize.process(); equalSize = null; ConvenientBufferedImageWrapper leftWrapped = new ConvenientBufferedImageWrapper(left); ConvenientBufferedImageWrapper rightWrapped = new ConvenientBufferedImageWrapper(right); AutoColorConverter convLeft = new AutoColorConverter(leftWrapped, rightWrapped, AutoColorConverter.AlternativeColorConverter.CIEXYZ); AutoColorConverter convRight = new AutoColorConverter(rightWrapped, leftWrapped, AutoColorConverter.AlternativeColorConverter.CIEXYZ); EqualMetric metric = new EqualMetric(convLeft, convRight, new Point(0, 0), new Point(left.getWidth(), left.getHeight())); return metric.execute(); }  @Override TransientOperation<Boolean, Boolean> evaluate(final BufferedImage left, final BufferedImage right);  }
@Test(expected = PreprocessingException.class) public void evaluateTest_differentWidth() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(0, 0, 0), 500, 500); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(0, 0, 0), 400, 500); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); }
@Test(expected = PreprocessingException.class) public void evaluateTest_differentHeight() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(0, 0, 0), 500, 400); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(0, 0, 0), 500, 500); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); }
@Test public void evaluateTest_equal_solid000000() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(0, 0, 0)); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(0, 0, 0)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(true, op.getAggregatedResult()); Assert.assertEquals(true, op.getResult()); }
@Test public void evaluateTest_equal_solid646464() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(100, 100, 100)); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(100, 100, 100)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(true, op.getAggregatedResult()); Assert.assertEquals(true, op.getResult()); }
@Test public void evaluateTest_equal_solid9924cd() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(153, 36, 205)); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(153, 36, 205)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(true, op.getAggregatedResult()); Assert.assertEquals(true, op.getResult()); }
@Test public void evaluateTest_solid000000_solid000164() { BufferedImage left = BufferedImageHelper.createSolidImage(new Color(0, 0, 100)); BufferedImage right = BufferedImageHelper.createSolidImage(new Color(0, 1, 100)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(false, op.getAggregatedResult()); Assert.assertEquals(false, op.getResult()); }
@Test public void evaluateTest_half000000_111111_half000000_111111() { BufferedImage left = BufferedImageHelper.createSolidHalfImage(new Color(0, 0, 0), new Color(255, 255, 255)); BufferedImage right = BufferedImageHelper.createSolidHalfImage(new Color(0, 0, 0), new Color(255, 255, 255)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(true, op.getAggregatedResult()); Assert.assertEquals(true, op.getResult()); }
@Test public void evaluateTest_half000000_000000_half000000_111111() { BufferedImage left = BufferedImageHelper.createSolidHalfImage(new Color(0, 0, 0), new Color(0, 0, 0)); BufferedImage right = BufferedImageHelper.createSolidHalfImage(new Color(0, 0, 0), new Color(255, 255, 255)); EqualQa equalQa = new EqualQa(); TransientOperation<Boolean, Boolean> op = equalQa.evaluate(left, right); Assert.assertEquals(false, op.getAggregatedResult()); Assert.assertEquals(false, op.getResult()); }