Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test for NO output when blank line

  • Loading branch information...
commit 839fa2e050a764bd2995e5700cebd7826f3400e4 1 parent 6b2cf57
@NathanNeff authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 wordcount/src/test/java/WordMapperTest.java
View
11 wordcount/src/test/java/WordMapperTest.java
@@ -7,17 +7,24 @@
public class WordMapperTest {
MapDriver<LongWritable, Text, Text, IntWritable> mapDriver;
- @Before
+
+ @Before
public void setUp() {
WordMapper mapper = new WordMapper();
mapDriver = new MapDriver<LongWritable, Text, Text, IntWritable>();
mapDriver.setMapper(mapper);
}
- @Test
+ @Test
public void testMapper() {
mapDriver.withInput(new LongWritable(1), new Text("cat dog"));
mapDriver.withOutput(new Text("cat"), new IntWritable(1));
mapDriver.withOutput(new Text("dog"), new IntWritable(1));
mapDriver.runTest();
}
+
+ @Test
+ public void testNoOutput() {
+ mapDriver.withInput(new LongWritable(1), new Text(""));
+ mapDriver.runTest();
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.