From: git Date: Wed, 28 Jun 2017 23:44:51 +0000 (+0200) Subject: update tesing file X-Git-Url: http://git.risc.jku.at/gitweb/?a=commitdiff_plain;h=adda80201920def730f5266d5ecb1d67d7d4fbdd;p=ipau%2FColorBlackWhiteConversion.git update tesing file --- diff --git a/Conversion_CYC/TestColor.java b/Conversion_CYC/TestColor.java new file mode 100644 index 0000000..8a6e7d0 --- /dev/null +++ b/Conversion_CYC/TestColor.java @@ -0,0 +1,69 @@ +import static org.junit.Assert.*; + +import java.awt.Color; +import java.awt.image.BufferedImage; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * + */ + +/** + * @author chingyichang + * + */ +public class TestColor { + + BufferedImage input_image; + BufferedImage output_image; + BufferedImage image; + int width; + int height; + + @Before + public void setUp() throws Exception { + LoadFile file = new LoadFile(); + input_image = file.Load_File("test.jpg"); + + BlackandWhite bw_image = new BlackandWhite(); + output_image = bw_image.Black_and_White(input_image); + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + } + + @Test + public void testBlackandWhite() { + + try { + + width = output_image.getWidth(); + height = output_image.getHeight(); + + for(int i=0; i