From adda80201920def730f5266d5ecb1d67d7d4fbdd Mon Sep 17 00:00:00 2001 From: git Date: Thu, 29 Jun 2017 01:44:51 +0200 Subject: [PATCH] update tesing file --- Conversion_CYC/TestColor.java | 69 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Conversion_CYC/TestColor.java 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