You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by TheRealHaui <gi...@git.apache.org> on 2017/07/17 17:51:25 UTC

[GitHub] commons-imaging pull request #28: Increase code coverage one

GitHub user TheRealHaui opened a pull request:

    https://github.com/apache/commons-imaging/pull/28

    Increase code coverage one

    Added various improvements to selected Unit Tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/TheRealHaui/commons-imaging increase-code-coverage-one

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-imaging/pull/28.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #28
    
----
commit 127469460ab0ae0d12d35b4e0b5056af6debdea2
Author: Michael Hausegger <ha...@googlemail.com>
Date:   2017-07-13T20:12:46Z

    increase-code-coverage-one Added Unit Tests to increase code coverage.

commit 8e48087803a12106f1d8b88803a94557f031ec62
Author: Michael Hausegger <ha...@googlemail.com>
Date:   2017-07-13T21:00:31Z

    increase-code-coverage-one Added Unit Tests to increase code coverage.

commit 66b929d15a0f03441b58c7cadd42e58da831d5bb
Author: Michael Hausegger <ha...@googlemail.com>
Date:   2017-07-13T21:14:08Z

    increase-code-coverage-one Fixed failing test.

commit 10c8babeff6d0115d4fa440f226e716eaa3bbf79
Author: Michael Hausegger <ha...@googlemail.com>
Date:   2017-07-15T21:39:54Z

    increase-code-coverage-one Fix directory hierarchy problem.

commit 48a365d24fecf2a29213f16468d3c165f9f34d1e
Author: Michael Hausegger <ha...@googlemail.com>
Date:   2017-07-17T16:51:29Z

    increase-code-coverage-one Changed date format in comments.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127783226
  
    --- Diff: src/test/java/org/apache/commons/imaging/formats/bmp/BmpWriterRgbTest.java ---
    @@ -0,0 +1,35 @@
    +package org.apache.commons.imaging.formats.bmp;
    +
    +import org.junit.Test;
    +
    +import java.awt.image.BufferedImage;
    +import java.util.Arrays;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link BmpWriterRgb}.
    + *
    + * @date 2017-07-13
    + * @see BmpWriterRgb
    + *
    + **/
    +public class BmpWriterRgbTest{
    +
    +
    +    @Test
    +    public void testGetImageData() {
    +
    +        BmpWriterRgb bmpWriterRgb = new BmpWriterRgb();
    +        BufferedImage bufferedImage = new BufferedImage(2, 2, 5);
    +        byte[] byteArray = bmpWriterRgb.getImageData(bufferedImage);
    +
    +        assertEquals( 24, bmpWriterRgb.getBitsPerPixel() );
    +        assertEquals( 0, bmpWriterRgb.getPaletteSize() );
    +        assertEquals( 16, byteArray.length );
    +        assertEquals( "[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]", Arrays.toString(byteArray) );
    --- End diff --
    
    Spaces at start and end of parameter lists seem unnecessary here.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781035
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    +public class ImageDumpTest{
    +
    +
    +    @Test
    +    public void testDumpColorSpace() {
    +
    +        ImageDump imageDump = new ImageDump();
    +        ColorSpace colorSpace = ColorSpace.getInstance(1004);
    +        imageDump.dumpColorSpace("Ku&]N>!4'C#Jzn+", colorSpace);
    +
    +        assertEquals(3, colorSpace.getNumComponents());
    +
    +    }
    --- End diff --
    
    Most test methods I've seen in commons-imaging prefer to have no blank lines at the start and end of the test method body. I suggest removing the blank lines at the start and end of `testDumpColorSpace`'s body here for consistency, so like this:
    
    ```java
    @Test 
    public void testDumpColorSpace() {
    ImageDump imageDump = new ImageDump();
            ColorSpace colorSpace = ColorSpace.getInstance(1004);
            imageDump.dumpColorSpace("Ku&]N>!4'C#Jzn+", colorSpace);
    
            assertEquals(3, colorSpace.getNumComponents());
    }


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781398
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    +public class ImageDumpTest{
    +
    +
    --- End diff --
    
    Having two blank lines here seems to be inconsistent with the other test classes in commons-imaging. I suggest shortening it to one blank line.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781644
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    +public class ImageDumpTest{
    +
    +
    +    @Test
    +    public void testDumpColorSpace() {
    +
    +        ImageDump imageDump = new ImageDump();
    +        ColorSpace colorSpace = ColorSpace.getInstance(1004);
    +        imageDump.dumpColorSpace("Ku&]N>!4'C#Jzn+", colorSpace);
    +
    +        assertEquals(3, colorSpace.getNumComponents());
    +
    +    }
    +
    +
    +    @Test
    +    public void testDump() {
    +
    +        ImageDump imageDump = new ImageDump();
    +        BufferedImage bufferedImage = new BufferedImage(10, 10, 10);
    +        imageDump.dump(bufferedImage);
    +
    +        assertEquals(10, bufferedImage.getHeight());
    +
    +    }
    +
    +
    --- End diff --
    
    Having two blank lines here seems to be inconsistent with the other test classes in commons-imaging. I suggest shortening it to one or zero blank lines.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127782170
  
    --- 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127780127
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    --- End diff --
    
    I question the presence of Javadoc in this class and all the other classes affected by this PR. AFAICT not all the tests (if any) even have Javadocs, so why should javadocs be added for this class and the others?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781095
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    +public class ImageDumpTest{
    +
    +
    +    @Test
    +    public void testDumpColorSpace() {
    +
    +        ImageDump imageDump = new ImageDump();
    +        ColorSpace colorSpace = ColorSpace.getInstance(1004);
    +        imageDump.dumpColorSpace("Ku&]N>!4'C#Jzn+", colorSpace);
    +
    +        assertEquals(3, colorSpace.getNumComponents());
    +
    +    }
    +
    +
    +    @Test
    +    public void testDump() {
    +
    +        ImageDump imageDump = new ImageDump();
    +        BufferedImage bufferedImage = new BufferedImage(10, 10, 10);
    +        imageDump.dump(bufferedImage);
    +
    +        assertEquals(10, bufferedImage.getHeight());
    +
    +    }
    --- End diff --
    
    Ditto regarding blank lines.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781676
  
    --- 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
    + *
    + **/
    --- End diff --
    
    Ditto regarding javadoc.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127782141
  
    --- 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() {
    +
    --- 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127782716
  
    --- Diff: src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java ---
    @@ -17,24 +17,22 @@
     
     package org.apache.commons.imaging.common.bytesource;
     
    -import static org.junit.Assert.assertTrue;
    +import org.apache.commons.imaging.ImagingTest;
    +import org.junit.Test;
     
    -import java.io.BufferedOutputStream;
    -import java.io.ByteArrayOutputStream;
    -import java.io.File;
    -import java.io.FileOutputStream;
    -import java.io.IOException;
    -import java.io.OutputStream;
    +import java.io.*;
     
    -import org.apache.commons.imaging.ImagingTest;
    +import static org.junit.Assert.assertEquals;
    +import static org.junit.Assert.assertTrue;
    +import static org.junit.Assert.fail;
     
     public abstract class ByteSourceTest extends ImagingTest {
         protected File createTempFile(final byte src[]) throws IOException {
             final File file = createTempFile("raw_", ".bin");
     
             // write test bytes to file.
             try (FileOutputStream fos = new FileOutputStream(file);
    -                OutputStream os = new BufferedOutputStream(fos)) {
    +             OutputStream os = new BufferedOutputStream(fos)) {
    --- End diff --
    
    No need to un-tab this line AFAICT.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging issue #28: Increase code coverage one

Posted by garydgregory <gi...@git.apache.org>.
Github user garydgregory commented on the issue:

    https://github.com/apache/commons-imaging/pull/28
  
    You want a fresh PR, yes, but you still need to base it off of git master, not just continue the previous patch please.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by TheRealHaui <gi...@git.apache.org>.
Github user TheRealHaui closed the pull request at:

    https://github.com/apache/commons-imaging/pull/28


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127782811
  
    --- Diff: src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java ---
    @@ -66,6 +64,22 @@ protected File createTempFile(final byte src[]) throws IOException {
             }
             final byte longArray[] = (baos.toByteArray());
     
    -        return new byte[][] { emptyArray, single, simple, zeroes, longArray, };
    +        return new byte[][]{emptyArray, single, simple, zeroes, longArray,};
    --- End diff --
    
    No need to remove spaces here AFAICT.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127783301
  
    --- Diff: src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcTypeLookupTest.java ---
    @@ -0,0 +1,28 @@
    +package org.apache.commons.imaging.formats.jpeg.iptc;
    +
    +import org.junit.Test;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link IptcTypeLookup}.
    + *
    + * @date 2017-07-13
    + * @see IptcTypeLookup
    + *
    + **/
    +public class IptcTypeLookupTest{
    +
    +
    +    @Test
    +    public void testGetIptcTypeWithPositive() {
    +
    +        IptcType iptcType = IptcTypeLookup.getIptcType(1117);
    +
    +        assertEquals( 1117, iptcType.getType() );
    +        assertEquals( "Unknown", iptcType.getName() );
    --- End diff --
    
    Ditto regarding spaces at start and end of parameter lists.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127780455
  
    --- Diff: src/test/java/org/apache/commons/imaging/ImageDumpTest.java ---
    @@ -0,0 +1,44 @@
    +package org.apache.commons.imaging;
    +
    +import org.junit.Test;
    +
    +import java.awt.color.ColorSpace;
    +import java.awt.image.BufferedImage;
    +
    +import static org.junit.Assert.assertEquals;
    +
    +/**
    + * Unit tests for class {@link ImageDump}.
    + *
    + * @date 2017-07-13
    + * @see ImageDump
    + *
    + **/
    +public class ImageDumpTest{
    --- End diff --
    
    The `{` seems to be joined directly with the class name to its left. This is inconsistent with all the other test classes AFAICT.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127781871
  
    --- 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{
    +
    +
    --- 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging pull request #28: Increase code coverage one

Posted by jbduncan <gi...@git.apache.org>.
Github user jbduncan commented on a diff in the pull request:

    https://github.com/apache/commons-imaging/pull/28#discussion_r127782622
  
    --- Diff: src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java ---
    @@ -17,24 +17,22 @@
     
     package org.apache.commons.imaging.common.bytesource;
     
    -import static org.junit.Assert.assertTrue;
    +import org.apache.commons.imaging.ImagingTest;
    +import org.junit.Test;
     
    -import java.io.BufferedOutputStream;
    -import java.io.ByteArrayOutputStream;
    -import java.io.File;
    -import java.io.FileOutputStream;
    -import java.io.IOException;
    -import java.io.OutputStream;
    +import java.io.*;
     
    -import org.apache.commons.imaging.ImagingTest;
    +import static org.junit.Assert.assertEquals;
    +import static org.junit.Assert.assertTrue;
    +import static org.junit.Assert.fail;
    --- End diff --
    
    I'd keep the ordering and style of the imports as before; no need to rearrange them just to import `assertEquals` and `fail`.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[GitHub] commons-imaging issue #28: Increase code coverage one

Posted by TheRealHaui <gi...@git.apache.org>.
Github user TheRealHaui commented on the issue:

    https://github.com/apache/commons-imaging/pull/28
  
    Done in #29.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org