@Test public void processPathNoQuotasHuman() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("-h"); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(HUMAN + NO_QUOTAS + path.toString()); }
@Test public void processPathShowQuotasHuman() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("-q"); options.add("-h"); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(HUMAN + WITH_QUOTAS + path.toString()); }
@Test public void processPathNoQuotas() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(BYTES + NO_QUOTAS + path.toString()); verifyNoMoreInteractions(out); }
@Test public void processPathNoQuotasHuman() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("-h"); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(HUMAN + NO_QUOTAS + path.toString()); }
@Test public void processPathNoQuotas() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(BYTES + NO_QUOTAS + path.toString()); verifyNoMoreInteractions(out); }
@Test public void processPathShowQuotas() throws Exception { Path path = new Path("mockfs:/test"); when(mockFs.getFileStatus(eq(path))).thenReturn(fileStat); PathData pathData = new PathData(path.toString(), conf); PrintStream out = mock(PrintStream.class); Count count = new Count(); count.out = out; LinkedList<String> options = new LinkedList<String>(); options.add("-q"); options.add("dummy"); count.processOptions(options); count.processPath(pathData); verify(out).println(BYTES + WITH_QUOTAS + path.toString()); verifyNoMoreInteractions(out); }
@Test public void processOptionsAll() { LinkedList<String> options = new LinkedList<String>(); options.add("-q"); options.add("-h"); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertTrue(count.isShowQuotas()); assertTrue(count.isHumanReadable()); }
@Test public void processOptionsAll() { LinkedList<String> options = new LinkedList<String>(); options.add("-q"); options.add("-h"); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertTrue(count.isShowQuotas()); assertTrue(count.isHumanReadable()); }
@Test public void isDeprecated() { Count count = new Count(); boolean actual = count.isDeprecated(); boolean expected = false; assertEquals("Count.isDeprecated", expected, actual); }
@Test public void getName() { Count count = new Count(); String actual = count.getName(); String expected = "count"; assertEquals("Count.getName", expected, actual); }
@Test public void getUsage() { Count count = new Count(); String actual = count.getUsage(); String expected = "-count [-q] [-h] <path> ..."; assertEquals("Count.getUsage", expected, actual); }
@Test public void getCommandName() { Count count = new Count(); String actual = count.getCommandName(); String expected = "count"; assertEquals("Count.getCommandName", expected, actual); }
@Test public void processOptionsHumanReadable() { LinkedList<String> options = new LinkedList<String>(); options.add("-h"); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertFalse(count.isShowQuotas()); assertTrue(count.isHumanReadable()); }
@Test public void getName() { Count count = new Count(); String actual = count.getName(); String expected = "count"; assertEquals("Count.getName", expected, actual); }
@Test public void getUsage() { Count count = new Count(); String actual = count.getUsage(); String expected = "-count [-q] [-h] <path> ..."; assertEquals("Count.getUsage", expected, actual); }
@Test public void processOptionsHumanReadable() { LinkedList<String> options = new LinkedList<String>(); options.add("-h"); options.add("dummy"); Count count = new Count(); count.processOptions(options); assertFalse(count.isShowQuotas()); assertTrue(count.isHumanReadable()); }
@Test public void getReplacementCommand() { Count count = new Count(); String actual = count.getReplacementCommand(); String expected = null; assertEquals("Count.getReplacementCommand", expected, actual); }
@Test public void getCommandName() { Count count = new Count(); String actual = count.getCommandName(); String expected = "count"; assertEquals("Count.getCommandName", expected, actual); }
@Test public void isDeprecated() { Count count = new Count(); boolean actual = count.isDeprecated(); boolean expected = false; assertEquals("Count.isDeprecated", expected, actual); }
@Test public void getReplacementCommand() { Count count = new Count(); String actual = count.getReplacementCommand(); String expected = null; assertEquals("Count.getReplacementCommand", expected, actual); }