< prev index next >

core/JemmyAWTInput/test/org/jemmy/image/awt/comparator/ComparatorTest.java

Print this page

        

*** 20,37 **** * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package org.jemmy.image.comparator; import java.awt.Color; import java.io.File; import java.awt.image.BufferedImage; import java.io.FileNotFoundException; import java.io.IOException; ! import org.jemmy.image.*; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; --- 20,38 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package org.jemmy.image.awt.comparator; import java.awt.Color; import java.io.File; import java.awt.image.BufferedImage; import java.io.FileNotFoundException; import java.io.IOException; ! ! import org.jemmy.image.awt.*; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test;
*** 69,104 **** // @Test public void average() { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/golden-averagedistance.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/actual-averagedistance.png"), true); assertNotNull(new AverageDistanceImageComparator(.001).compare(new AWTImage(golden), new AWTImage(actual))); } @Test public void strict() { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/golden-strict.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/actual-strict.png"), true); assertNotNull(new StrictImageComparator().compare(new AWTImage(golden), new AWTImage(actual))); } @Test public void strict_hyperlink() throws FileNotFoundException, IOException { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/golden-hyperlink.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/comparator/actual-hyperlink.png"), true); BufferedImage diff = ((AWTImage)new StrictImageComparator().compare(new AWTImage(golden), new AWTImage(actual))).getTheImage(); //assertNull(diff); //barbashov sucks! //he submits similar images new PNGEncoder(new File("/tmp/aaa.png")).encode(diff); --- 70,105 ---- // @Test public void average() { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/golden-averagedistance.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/actual-averagedistance.png"), true); assertNotNull(new AverageDistanceImageComparator(.001).compare(new AWTImage(golden), new AWTImage(actual))); } @Test public void strict() { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/golden-strict.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/actual-strict.png"), true); assertNotNull(new StrictImageComparator().compare(new AWTImage(golden), new AWTImage(actual))); } @Test public void strict_hyperlink() throws FileNotFoundException, IOException { BufferedImage golden = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/golden-hyperlink.png"), true); BufferedImage actual = PNGDecoder.decode(getClass().getClassLoader(). ! getResourceAsStream("org/jemmy/image/awt/comparator/actual-hyperlink.png"), true); BufferedImage diff = ((AWTImage)new StrictImageComparator().compare(new AWTImage(golden), new AWTImage(actual))).getTheImage(); //assertNull(diff); //barbashov sucks! //he submits similar images new PNGEncoder(new File("/tmp/aaa.png")).encode(diff);
< prev index next >