View Javadoc

1   package org.xmlhammer.gui.acceptance;
2   
3   import java.util.List;
4   
5   import junit.framework.Test;
6   import junit.framework.TestSuite;
7   
8   import org.xmlhammer.gui.ProjectView;
9   import org.xmlhammer.gui.xslt.XSLTProjectView;
10  import org.xmlhammer.model.project.Document;
11  import org.xmlhammer.model.project.Project;
12  
13  public class NewTransformerTest extends NewProjectTestCase {
14      private NewTransformerTest(String test) {
15          super(test);
16      }
17  
18      public void newProject() throws Exception {
19          getApplication().getNewXSLTAction().runWithoutWizard();
20          
21          ProjectView view = getApplication().getProjectsView().getSelectedView();
22          assertNotNull(view);
23          assertTrue(view instanceof XSLTProjectView);
24      }
25      
26      public void checkProject() {
27          ProjectView view = getApplication().getProjectsView().getSelectedView();
28          Project project = view.getProject(null);
29      
30          List<Document> list = project.getInput().getSourceOrSourceAndResult();
31          assertEquals(0, list.size());
32          
33          assertNotNull(project.getXSLT());
34          assertNull(project.getSchemaValidator());
35          assertNull(project.getXPath());
36          assertNotNull(project.getParser());
37          assertNotNull(project.getJAXPSettings().getJAXPTransformerFactory());
38          assertNull(project.getJAXPSettings().getJAXPXPathFactory());
39          assertNotNull(project.getJAXPSettings().getJAXPDocumentBuilderFactory());
40          assertNotNull(project.getJAXPSettings().getJAXPSAXParserFactory());
41          assertNotNull(project.getJAXPSettings().getJAXPSchemaFactory());
42      }
43  
44  
45      public static Test suite() {
46          TestSuite suite = new TestSuite("New Transformer Project");
47          
48          suite.addTest(new NewTransformerTest("newProject"));
49          suite.addTest(new NewTransformerTest("checkProject"));
50          suite.addTest(new NewTransformerTest("initialPage"));
51          suite.addTest(new NewTransformerTest("hasChanged"));
52          suite.addTest(new NewTransformerTest("closeProject"));
53          suite.addTest(new NewTransformerTest("closeApplication"));
54  
55          return suite;
56      }
57  }