示例#1
0
 /** Test {@link TextInput#skipWhiteSpace()}. */
 public void testSkipWhiteSpaceInverse() {
   final String first = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
   qedeqInput.skipWhiteSpaceInverse();
   assertEquals(0, qedeqInput.getPosition());
   qedeqInput.setPosition(first.length() + 1);
   qedeqInput.skipWhiteSpaceInverse();
   assertEquals('\n', qedeqInput.getChar());
   assertEquals(first.length(), qedeqInput.getPosition());
   qedeqInput.setRow(8);
   assertEquals(
       "   \t\r   <LOCATION value=\"http://qedeq.org/0.01.06/sample1\"/>", qedeqInput.getLine());
   qedeqInput.setColumn(9);
   qedeqInput.skipWhiteSpaceInverse();
   assertEquals(7, qedeqInput.getRow());
   assertEquals('>', qedeqInput.getChar(-1));
   qedeqInput.read();
   assertEquals(8, qedeqInput.getRow());
 }
示例#2
0
 /** Test {@link TextInput#readLetterDigitString()}. */
 public void testReadLetterDigitString() {
   qedeqInput.read();
   qedeqInput.read();
   assertEquals("xml", qedeqInput.readLetterDigitString());
   qedeqInput.setRow(13);
   assertEquals("Example1", qedeqInput.readLetterDigitString());
   qedeqInput.setRow(13);
   qedeqInput.setColumn(1);
   qedeqInput.skipWhiteSpace();
   assertEquals("Example1", qedeqInput.readLetterDigitString());
   try {
     qedeqInput.readLetterDigitString();
     fail("IllegalArgumentException expected");
   } catch (IllegalArgumentException e) {
     // expected
   }
   try {
     emptyInput.readLetterDigitString();
     fail("IllegalArgumentException expected");
   } catch (IllegalArgumentException e) {
     // expected
   }
 }