You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2013/12/08 21:57:51 UTC
svn commit: r1549233 -
/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java
Author: rdonkin
Date: Sun Dec 8 20:57:51 2013
New Revision: 1549233
URL: http://svn.apache.org/r1549233
Log:
Apply PMD change.
Modified:
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java
Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java?rev=1549233&r1=1549232&r2=1549233&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/header/FilteringSequenceFactoryTest.java Sun Dec 8 20:57:51 2013
@@ -21,6 +21,7 @@ package org.apache.rat.header;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import java.io.IOException;
import java.io.StringReader;
import org.junit.Before;
@@ -32,13 +33,13 @@ import org.junit.Test;
public class FilteringSequenceFactoryTest {
/** The capacity. */
- int capacity;
+ private int capacity;
/** The factory. */
- FilteringSequenceFactory factory;
+ private FilteringSequenceFactory factory;
/** The filter. */
- SimpleCharFilter filter;
+ private SimpleCharFilter filter;
/**
* Sets the up.
@@ -56,44 +57,46 @@ public class FilteringSequenceFactoryTes
/**
* No filtering.
*
+ * @throws IOException
+ *
* @throws Exception
* the exception
*/
@Test
- public void noFiltering() throws Exception {
- final String INPUT = "Whatever";
- StringReader reader = new StringReader(INPUT);
+ public void noFiltering() throws IOException {
+ String input = "Whatever";
+ StringReader reader = new StringReader(input);
CharSequence result = factory.filter(reader);
- assertNotNull(result);
+ assertNotNull("Not Null Var", result);
String output = result.toString();
- assertEquals("No filtering so input equals output.", INPUT, output);
- reader = new StringReader(INPUT);
+ assertEquals("No filtering so input equals output.", input, output);
+ reader = new StringReader(input);
result = factory.filter(reader);
- assertNotNull(result);
+ assertNotNull("Not Null Var", result);
output = result.toString();
assertEquals(
"No filtering so input equals output. Independent of previous input",
- INPUT, output);
+ input, output);
}
/**
* Filtering.
*
- * @throws Exception
- * the exception
+ * @throws IOException
+ *
*/
@Test
- public void filtering() throws Exception {
- final String INPUT = "Whatever";
- StringReader reader = new StringReader(INPUT);
+ public void filtering() throws IOException {
+ String input = "Whatever";
+ StringReader reader = new StringReader(input);
CharSequence result = factory.filter(reader);
- assertNotNull(result);
+ assertNotNull("Not null Var", result);
String output = result.toString();
- assertEquals("No filtering so input equals output.", INPUT, output);
+ assertEquals("No filtering so input equals output.", input, output);
filter.filterOut = true;
- reader = new StringReader(INPUT);
+ reader = new StringReader(input);
result = factory.filter(reader);
- assertNotNull(result);
+ assertNotNull("Not Null Var", result);
assertEquals(
"All filtered output is empty. Independent of previous input",
0, result.length());
@@ -102,17 +105,19 @@ public class FilteringSequenceFactoryTes
/**
* Over capacity.
*
+ * @throws IOException
+ *
* @throws Exception
* the exception
*/
@Test
- public void overCapacity() throws Exception {
- final String INPUT = "WhateverWhateverWhateverWhateverWhateverWhateverWhateverWhateverWhateverWhatever";
- StringReader reader = new StringReader(INPUT);
+ public void overCapacity() throws IOException {
+ String input = "WhateverWhateverWhateverWhateverWhateverWhateverWhateverWhateverWhateverWhatever";
+ StringReader reader = new StringReader(input);
CharSequence result = factory.filter(reader);
- assertNotNull(result);
+ assertNotNull("Nor Null Var", result);
String output = new StringBuffer().append(result).toString();
assertEquals("No filtering so input equals output.",
- INPUT.substring(0, capacity), output);
+ input.substring(0, capacity), output);
}
}