ExpressionTokenizer { public List<String> getCommandStrings() { return commandStrings; } ExpressionTokenizer(String arg); List<String> getCommandStrings();  }
@Test public void testTokenizer1() { String str = "ls -ltr \"|\" | grep -v hello"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList("ls -ltr \"|\"", "grep -v hello"), t.getCommandStrings()); }
@Test public void testTokenizer2() { String str = "ls -ltr \"|\" \">>>\" > 2 | grep -v hello"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList("ls -ltr \"|\" \">>>\"", "> 2", "grep -v hello"), t.getCommandStrings()); }
@Test public void testTokenizer3() { String str = "ls -ltr \"|\" \">>>\" >> 2 | grep -v hello | > asd"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList("ls -ltr \"|\" \">>>\"", ">> 2", "grep -v hello", "> asd"), t.getCommandStrings()); }
@Test public void testTokenizer4() { String str = "echo hello > file"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList("echo hello", "> file"), t.getCommandStrings()); }
@Test public void testTokenizer5() { String str = " > file"; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList("> file"), t.getCommandStrings()); }
@Test public void testTokenizer6() { String str = ""; ExpressionTokenizer t = new ExpressionTokenizer(str); assertEquals(Arrays.asList(""), t.getCommandStrings()); }