Github user jbduncan commented on a diff in the pull request: https://github.com/apache/commons-imaging/pull/28#discussion_r127782199 --- Diff: src/test/java/org/apache/commons/imaging/common/RgbBufferedImageFactoryTest.java --- @@ -0,0 +1,36 @@ +package org.apache.commons.imaging.common; + +import org.junit.Test; + +import java.awt.image.DirectColorModel; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +/** + * Unit tests for class {@link RgbBufferedImageFactory}. + * + * @date 2017-07-13 + * @see RgbBufferedImageFactory + * + **/ +public class RgbBufferedImageFactoryTest{ + + + @Test + public void testGetColorBufferedImageThrowsIllegalArgumentException() { + + RgbBufferedImageFactory rgbBufferedImageFactory = new RgbBufferedImageFactory(); + + try { + rgbBufferedImageFactory.getColorBufferedImage(0, 0, true); + fail("Expecting exception: IllegalArgumentException"); + } catch(IllegalArgumentException e) { + assertEquals("Width (0) and height (0) cannot be <= 0",e.getMessage()); + assertEquals(DirectColorModel.class.getName(), e.getStackTrace()[0].getClassName()); + } + + } + + --- End diff -- Ditto regarding blank lines. Please shorten them for all other classes as well.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org