Class TestCommandLineTokenizer

  • All Implemented Interfaces:
    junit.framework.Test

    public class TestCommandLineTokenizer
    extends junit.framework.TestCase
    This junit TestCase runs a barrage of tests against the CommandLineTokenizer. This TestCase is unusual for this project in that it contains a main() method; this method is used to generate test methods to paste into this class.
    Author:
    Marty Lamb
    See Also:
    CommandLineTokenizer
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(String[] args)
      A helper method to write additional test cases based upon the specified argument array.
      static junit.framework.Test suite()
      Creates and returns a new Test based upon this class.
      void test1()
      Tests for correct parsing of [this is a test].
      void test10()
      Tests for correct parsing of ["this is a test]
      void test2()
      Tests for corect parsing of [this is a "test"]
      void test3()
      Tests for correct parsing of ["this is a test"]
      void test4()
      Tests for correct parsing of [this is a "test]
      void test5()
      Tests for correct parsing of [thi\s is a \"test]
      void test6()
      Tests for correct parsing of [thi\s is a \"test\\]
      void test7()
      Tests for correct parsing of [thi\s is a \"test\\\"]
      void test8()
      Tests for correct parsing of a null command line.
      void test9()
      Tests for correct parsing of a whitespace-only command line.
      • Methods inherited from class junit.framework.TestCase

        assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
    • Constructor Detail

      • TestCommandLineTokenizer

        public TestCommandLineTokenizer()
    • Method Detail

      • suite

        public static junit.framework.Test suite()
        Creates and returns a new Test based upon this class.
        Returns:
        a new Test based upon this class.
      • test1

        public void test1()
        Tests for correct parsing of [this is a test].
      • test2

        public void test2()
        Tests for corect parsing of [this is a "test"]
      • test3

        public void test3()
        Tests for correct parsing of ["this is a test"]
      • test4

        public void test4()
        Tests for correct parsing of [this is a "test]
      • test5

        public void test5()
        Tests for correct parsing of [thi\s is a \"test]
      • test6

        public void test6()
        Tests for correct parsing of [thi\s is a \"test\\]
      • test7

        public void test7()
        Tests for correct parsing of [thi\s is a \"test\\\"]
      • test8

        public void test8()
        Tests for correct parsing of a null command line.
      • test9

        public void test9()
        Tests for correct parsing of a whitespace-only command line.
      • test10

        public void test10()
        Tests for correct parsing of ["this is a test]
      • main

        public static void main​(String[] args)
        A helper method to write additional test cases based upon the specified argument array.
        Parameters:
        args - the argument array that CommandLineTokenizer.tokenize() should produce.