Author: britter
Date: Mon Jun 13 06:34:26 2016
New Revision: 1748089
URL: http://svn.apache.org/viewvc?rev=1748089&view=rev
Log:
Indent code with 4 spaces
Modified:
commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
Modified:
commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
URL:
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java?rev=1748089&r1=1748088&r2=1748089&view=diff
==============================================================================
---
commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
(original)
+++
commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
Mon Jun 13 06:34:26 2016
@@ -1,7 +1,5 @@
package org.apache.commons.imaging.formats.pnm;
-import static org.junit.Assert.assertEquals;
-
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Collections;
@@ -11,47 +9,49 @@ import org.apache.commons.imaging.ImageI
import org.apache.commons.imaging.ImageReadException;
import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
public class PnmImageParserTest {
- private static final Charset US_ASCII = Charset.forName("US-ASCII");
+ private static final Charset US_ASCII = Charset.forName("US-ASCII");
- @Test
- public void testGetImageInfo_happyCase() throws ImageReadException,
IOException {
- byte[] bytes = "P1\n3 2\n0 1 0\n1 0 1\n".getBytes(US_ASCII);
- Map<String, Object> params = Collections.emptyMap();
- PnmImageParser underTest = new PnmImageParser();
- ImageInfo results = underTest.getImageInfo(bytes, params);
- assertEquals(results.getBitsPerPixel(), 1);
- assertEquals(results.getWidth(), 3);
- assertEquals(results.getHeight(), 2);
- assertEquals(results.getNumberOfImages(), 1);
- }
-
- /**
- * If an invalid width is specified, should throw {@link ImageReadException}
rather than
- * {@link NumberFormatException}.
- */
- @Test(expected = ImageReadException.class)
- public void testGetImageInfo_invalidWidth() throws ImageReadException,
IOException {
- byte[] bytes = "P1\na 2\n0 0 0 0 0 0 0 0 0 0 0\n1 1 1 1 1 1 1 1 1 1
1\n".getBytes(US_ASCII);
- Map<String, Object> params = Collections.emptyMap();
- PnmImageParser underTest = new PnmImageParser();
- underTest.getImageInfo(bytes, params);
- }
-
- @Test(expected = ImageReadException.class)
- public void testGetImageInfo_invalidHeight() throws ImageReadException,
IOException {
- byte[] bytes = "P1\n2 a\n0 0\n0 0\n0 0\n0 0\n0 0\n0 1\n1 1\n1 1\n1 1\n1
1\n1 1\n".getBytes(US_ASCII);
- Map<String, Object> params = Collections.emptyMap();
- PnmImageParser underTest = new PnmImageParser();
- underTest.getImageInfo(bytes, params);
- }
-
- @Test(expected = ImageReadException.class)
- public void testGetImageInfo_missingWidthValue() throws ImageReadException,
IOException {
- byte[] bytes = "P7\nWIDTH \n".getBytes(US_ASCII);
- Map<String, Object> params = Collections.emptyMap();
- PnmImageParser underTest = new PnmImageParser();
- underTest.getImageInfo(bytes, params);
- }
+ @Test
+ public void testGetImageInfo_happyCase() throws ImageReadException,
IOException {
+ byte[] bytes = "P1\n3 2\n0 1 0\n1 0 1\n".getBytes(US_ASCII);
+ Map<String, Object> params = Collections.emptyMap();
+ PnmImageParser underTest = new PnmImageParser();
+ ImageInfo results = underTest.getImageInfo(bytes, params);
+ assertEquals(results.getBitsPerPixel(), 1);
+ assertEquals(results.getWidth(), 3);
+ assertEquals(results.getHeight(), 2);
+ assertEquals(results.getNumberOfImages(), 1);
+ }
+
+ /**
+ * If an invalid width is specified, should throw {@link
ImageReadException} rather than
+ * {@link NumberFormatException}.
+ */
+ @Test(expected = ImageReadException.class)
+ public void testGetImageInfo_invalidWidth() throws ImageReadException,
IOException {
+ byte[] bytes = "P1\na 2\n0 0 0 0 0 0 0 0 0 0 0\n1 1 1 1 1 1 1 1 1 1
1\n".getBytes(US_ASCII);
+ Map<String, Object> params = Collections.emptyMap();
+ PnmImageParser underTest = new PnmImageParser();
+ underTest.getImageInfo(bytes, params);
+ }
+
+ @Test(expected = ImageReadException.class)
+ public void testGetImageInfo_invalidHeight() throws ImageReadException,
IOException {
+ byte[] bytes = "P1\n2 a\n0 0\n0 0\n0 0\n0 0\n0 0\n0 1\n1 1\n1 1\n1
1\n1 1\n1 1\n".getBytes(US_ASCII);
+ Map<String, Object> params = Collections.emptyMap();
+ PnmImageParser underTest = new PnmImageParser();
+ underTest.getImageInfo(bytes, params);
+ }
+
+ @Test(expected = ImageReadException.class)
+ public void testGetImageInfo_missingWidthValue() throws
ImageReadException, IOException {
+ byte[] bytes = "P7\nWIDTH \n".getBytes(US_ASCII);
+ Map<String, Object> params = Collections.emptyMap();
+ PnmImageParser underTest = new PnmImageParser();
+ underTest.getImageInfo(bytes, params);
+ }
}