View Javadoc

1   /*
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may	obtain a copy of the License at
7    *
8    * 	http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.datadictionary.mojo;
17  
18  import java.io.File;
19  import java.util.ArrayList;
20  import java.util.List;
21  import org.junit.After;
22  import org.junit.AfterClass;
23  import org.junit.Before;
24  import org.junit.BeforeClass;
25  import org.junit.Test;
26  import static org.junit.Assert.*;
27  /**
28   *
29   * @author nwright
30   */
31  public class KSDictionaryDocMojoTest {
32      private static final String DICTIONARY_DOC_DIRECTORY = "target/site/dictionary";
33      public KSDictionaryDocMojoTest() {
34      }
35  
36      @BeforeClass
37      public static void setUpClass() throws Exception {
38      }
39  
40      @AfterClass
41      public static void tearDownClass() throws Exception {
42      }
43      
44      @Before
45      public void setUp() {
46      }
47      
48      @After
49      public void tearDown() {
50      }
51  
52      /**
53       * Test of execute method, of class KSDictionaryDocMojo.
54       */
55      @Test
56      public void testExecute() throws Exception {
57          System.out.println("execute");
58          KSDictionaryDocMojo instance = new KSDictionaryDocMojo();
59          List<String> supportFiles = new ArrayList ();
60  //        supportFiles.add("ks-AtpInfo-dictionary-generated.xml");        
61          supportFiles.add("ks-base-dictionary.xml");          
62          supportFiles.add("ks-base-dictionary-validchars.xml");
63          supportFiles.add("org/kuali/rice/krad/bo/datadictionary/DataDictionaryBaseTypes.xml");
64          supportFiles.add("org/kuali/rice/krad/uif/UifControlDefinitions.xml");
65          supportFiles.add("org/kuali/rice/krad/uif/UifWidgetDefinitions.xml");        
66          supportFiles.add("org/kuali/rice/krad/uif/UifFieldDefinitions.xml");
67          supportFiles.add("org/kuali/rice/krad/uif/UifGroupDefinitions.xml");
68          instance.setSupportFiles(supportFiles);        
69          List<String> inputFiles = new ArrayList ();
70          inputFiles.add("ks-AtpInfo-dictionary.xml");        
71  //        inputFiles.add("ks-LprInfo-dictionary.xml");            
72          instance.setInputFiles(inputFiles);
73          instance.setHtmlDirectory(new File (DICTIONARY_DOC_DIRECTORY));
74          instance.execute();
75          assertTrue(new File(instance.getHtmlDirectory() + "/" + "index.html").exists());        
76          assertTrue(new File(instance.getHtmlDirectory() + "/" + "AtpInfo.html").exists());
77      }
78  }