View Javadoc

1   package org.xmlhammer.gui.acceptance;
2   
3   import java.io.File;
4   
5   import javax.swing.tree.MutableTreeNode;
6   
7   import junit.framework.Test;
8   import junit.framework.TestSuite;
9   
10  import org.xmlhammer.gui.output.ResultTreeModel;
11  
12  public class SchemaValidatorTest extends ProjectTestCase {
13      private SchemaValidatorTest(String test) {
14          super(test);
15      }
16  
17      public void openProject() throws Exception {
18          openProject(new File("src/test/resources/projects/schema-invalid-validator.xhp"));
19      }
20      
21      public void execute() {
22          super.execute();
23  
24          ResultTreeModel model = getApplication().getProjectsView().getSelectedView().getResultPanel().getModel();
25          assertEquals(3, ((MutableTreeNode)model.getRoot()).getChildAt(0).getChildCount());
26      }
27  
28      public static Test suite() {
29          TestSuite suite = new TestSuite("Schema Validator Projects");
30          
31          suite.addTest(new SchemaValidatorTest("openProject"));
32          suite.addTest(new SchemaValidatorTest("initialPage"));
33          suite.addTest(new SchemaValidatorTest("hasChanged"));
34          suite.addTest(new SchemaValidatorTest("execute"));
35          suite.addTest(new SchemaValidatorTest("closeProject"));
36          suite.addTest(new SchemaValidatorTest("closeApplication"));
37  
38          return suite;
39      }
40  
41  }