@Test public void countTest() throws IOException { TestUtils.createByteFile(mTfs, "/testRoot/testFileA", WriteType.MUST_CACHE, 10); TestUtils.createByteFile(mTfs, "/testRoot/testDir/testFileB", WriteType.MUST_CACHE, 20); TestUtils.createByteFile(mTfs, "/testRoot/testFileB", WriteType.MUST_CACHE, 30); mFsShell.count(new String[] { "count", "/testRoot" }); String expected = ""; String format = "%-25s%-25s%-15s\n"; expected += String.format(format, "File Count", "Folder Count", "Total Bytes"); expected += String.format(format, 3, 2, 60); Assert.assertEquals(expected, mOutput.toString()); }
public int count(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs count <path>"); return -1; } String path = argv[1]; long[] values = countHelper(path); String format = "%-25s%-25s%-15s\n"; System.out.format(format, "File Count", "Folder Count", "Total Bytes"); System.out.format(format, values[0], values[1], values[2]); return 0; }
TFsShell { public int count(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs count <path>"); return -1; } String path = argv[1]; long[] values = countHelper(path); String format = "%-25s%-25s%-15s\n"; System.out.format(format, "File Count", "Folder Count", "Total Bytes"); System.out.format(format, values[0], values[1], values[2]); return 0; } }
TFsShell { public int count(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs count <path>"); return -1; } String path = argv[1]; long[] values = countHelper(path); String format = "%-25s%-25s%-15s\n"; System.out.format(format, "File Count", "Folder Count", "Total Bytes"); System.out.format(format, values[0], values[1], values[2]); return 0; }  }
TFsShell { public int count(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs count <path>"); return -1; } String path = argv[1]; long[] values = countHelper(path); String format = "%-25s%-25s%-15s\n"; System.out.format(format, "File Count", "Folder Count", "Total Bytes"); System.out.format(format, values[0], values[1], values[2]); return 0; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]); }
TFsShell { public int count(String argv[]) throws IOException { if (argv.length != 2) { System.out.println("Usage: tfs count <path>"); return -1; } String path = argv[1]; long[] values = countHelper(path); String format = "%-25s%-25s%-15s\n"; System.out.format(format, "File Count", "Folder Count", "Total Bytes"); System.out.format(format, values[0], values[1], values[2]); return 0; }  static void main(String argv[]); int cat(String argv[]); int copyFromLocal(String argv[]); int copyToLocal(String argv[]); int count(String argv[]); int fileinfo(String argv[]); int location(String argv[]); int ls(String argv[]); int lsr(String argv[]); int mkdir(String argv[]); int pin(String argv[]); int unpin(String argv[]); void printUsage(); int rename(String argv[]); int report(String argv[]); int request(String argv[]); int rm(String argv[]); int run(String argv[]); int tail(String argv[]); int touch(String argv[]);  }