01 /*
02 * LaTeXConstantsTests.java
03 * Copyright (c) 1998-2008, The University of Sheffield.
04 *
05 * This code is from the GATE project (http://gate.ac.uk/) and is free
06 * software licenced under the GNU General Public License version 3. It is
07 * distributed without any warranty. For more details see COPYING.txt in the
08 * top level directory (or at http://gatewiki.sf.net/COPYING.txt).
09 *
10 * Hamish Cunningham, 13th May 2006
11 */
12
13 package gate.yam.translate;
14
15 import junit.framework.*;
16 import gate.yam.parse.*;
17
18 /**
19 * Check that all the YAM parse tree nodes are associated with an appropriate
20 * set of constants.
21 */
22 public class LaTeXConstantsTests extends TestCase
23 implements LaTeXConstants, YamParserTreeConstants, TranslationConstants
24 {
25 /** Create the test case. */
26 public LaTeXConstantsTests(String testName) { super(testName); }
27
28 /** Check LaTeXConstants against YamParserTreeConstants. */
29 public void testConstants() {
30 int numNodes = jjtNodeName.length;
31
32 for(int i=0; i<numNodes; i++) {
33 if(i >= latexConstantsTable.length)
34 fail("ran out of constants at jjtNodeName = " + jjtNodeName[i]);
35 if(! jjtNodeName[i].equals(latexConstantsTable[i][CONSTANTNAME]))
36 fail(
37 "node name mismatch, wanted " + jjtNodeName[i] +
38 " but got " + latexConstantsTable[i][CONSTANTNAME]
39 );
40 }
41
42 } // testConstants()
43
44 /** Get the path to the preamble resource (DUMMY). */
45 public String getPreamblePath() { return null; }
46
47 /** Array mapping node type name to start/end strings (DUMMY). */
48 public String[][] getConstantsTable() { return null; }
49
50 /** Array mapping predicate type name to attributes (DUMMY). */
51 public Object[][] getPredicatesTable() { return null; }
52
53 } // LaTeXConstantsTests
|