View Javadoc

1   package org.xmlhammer.cli;
2   
3   import java.io.File;
4   
5   import junit.framework.Test;
6   import junit.framework.TestSuite;
7   
8   public class XPathTest extends CLITestCase {
9       protected XPathTest(String test) {
10          super(test);
11      }
12  
13      public void testSimpleXPath() throws Exception {
14          assertOutput(
15                  new File("src/test/resources/output/cli/golden-xpath.out"), 
16                  run("src/test/resources/projects/xpath/xpath.xhp"));
17      }
18      
19      public void testXPathNamespaces() throws Exception {
20          assertOutput(
21                  new File("src/test/resources/output/cli/golden-xpath-namespaces.out"), 
22                  run("src/test/resources/projects/xpath/xpath-namespaces.xhp"));
23      }
24      
25      public void testXPathNumber() throws Exception {
26          assertOutput(
27                  new File("src/test/resources/output/cli/golden-xpath-number.out"), 
28                  run("src/test/resources/projects/xpath/xpath-number.xhp"));
29      }
30  
31      public void testXPathBoolean() throws Exception {
32          assertOutput(
33                  new File("src/test/resources/output/cli/golden-xpath-boolean.out"), 
34                  run("src/test/resources/projects/xpath/xpath-boolean.xhp"));
35      }
36  
37      public static Test suite() {
38          TestSuite suite = new TestSuite("XPath Command Line Test");
39          
40          suite.addTest(new XPathTest("testSimpleXPath"));
41          suite.addTest(new XPathTest("testXPathNamespaces"));
42          suite.addTest(new XPathTest("testXPathNumber"));
43          suite.addTest(new XPathTest("testXPathBoolean"));
44  
45          return suite;
46      }
47  }