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   *
30   * @author nwright
31   */
32  public class KSDictionaryCreatorMojoTest {
33  
34      private static final String CORE_DIRECTORY =
35              "C:/svn/ks-1.3/ks-core/ks-core-api/src/main/java";
36      // "C:/svn/maven-dictionary-generator/trunk/src/main/java/org/kuali/student/core";
37      private static final String COMMON_DIRECTORY =
38              "C:/svn/ks-1.3/ks-common/ks-common-api/src/main/java";
39      private static final String ENROLL_PROJECT_SRC_MAIN = "C:/svn/ks-1.3/ks-enroll/ks-enroll-api/src/main";
40      private static final String ENROLL_PROJECT_JAVA_DIRECTORY = ENROLL_PROJECT_SRC_MAIN + "/java";
41      private static final String ENROLL_PROJECT_RESOURCES_DIRECTORY = ENROLL_PROJECT_SRC_MAIN + "/resources";
42      private static final String LUM_DIRECTORY =
43              "C:/svn/ks-1.3/ks-lum/ks-lum-api/src/main/java";
44      private static final String RICE_DIRECTORY =
45              "C:/svn/rice/rice-release-1-0-2-1-br/api/src/main/java";
46      private static final String TEST_SOURCE_DIRECTORY =
47              "src/test/java/org/kuali/student/contract/model/test/source";
48      private static final String TARGET_GENERATED_SOURCES = "target/generated-sources";
49      private static final String RESOURCES_DIRECTORY =
50              // "C:/svn/student/ks-core/ks-core-api/src/main/java";
51              "src/main/resources";
52      private static final String PESC_CORE_MAIN = RESOURCES_DIRECTORY
53              + "/CoreMain_v1.8.0.xsd";
54  
55      public KSDictionaryCreatorMojoTest() {
56      }
57  
58      @BeforeClass
59      public static void setUpClass() throws Exception {
60      }
61  
62      @AfterClass
63      public static void tearDownClass() throws Exception {
64      }
65  
66      @Before
67      public void setUp() {
68      }
69  
70      @After
71      public void tearDown() {
72      }
73  
74      /**
75       * Test of execute method, of class KSDictionaryCreatorMojo.
76       */
77      @Test
78      public void testExecute() throws Exception {
79          System.out.println("execute");
80          List<String> srcDirs = new ArrayList<String>();
81  //        srcDirs.add(TEST_SOURCE_DIRECTORY);
82          srcDirs.add(ENROLL_PROJECT_JAVA_DIRECTORY);
83  //		srcDirs.add(CORE_DIRECTORY);
84  //		srcDirs.add(COMMON_DIRECTORY);
85  //		srcDirs.add(LUM_DIRECTORY);
86          KSDictionaryCreatorMojo instance = new KSDictionaryCreatorMojo();
87          instance.setSourceDirs(srcDirs);
88  //        instance.setOutputDirectory(new File(TARGET_GENERATED_SOURCES)); 
89          instance.setOutputDirectory(new File(ENROLL_PROJECT_RESOURCES_DIRECTORY));
90          // Be careful when you uncomment this one it will overwrite stuff in another project
91  //        instance.setOutputDirectory(new File(ENROLL_PROJECT_RESOURCES_DIRECTORY));
92          instance.setWriteManual(true);
93          instance.setWriteGenerated(true);
94          instance.setThrowExceptionIfNotAllFilesProcessed(false);
95          List<String> classNames = new ArrayList();
96          // Atp
97  //        classNames.add("AtpInfo");
98  //        classNames.add("MilestoneInfo");
99  //        classNames.add("AtpMilestoneRelationInfo");
100 //        classNames.add("AtpAtpRelationInfo");
101 //        // Acal
102 //        classNames.add("AcademicCalendarInfo");
103 //        classNames.add("CampusCalendarInfo");
104 //        classNames.add("TermInfo");
105 //        classNames.add("RegistrationDateGroupInfo");
106 //        classNames.add("HolidayInfo");
107 //        classNames.add("KeyDateInfo");
108 //        // LPR 
109 //        classNames.add("LuiPersonRelationInfo");
110 //        classNames.add("LprRosterInfo");
111 //        classNames.add("LprRosterEntryInfo");
112 //        classNames.add("LprTransactionInfo");
113 //        classNames.add("LprTransactionItemInfo");
114 //        classNames.add("RequestOptionInfo");
115 //        classNames.add("LprTransactionItemResultInfo");
116 //        // Hold
117 //        classNames.add("HoldInfo");
118 //        classNames.add("IssueInfo");
119 //        classNames.add("RestrictionInfo");
120 //        // LUI 
121 //        classNames.add("LuiInfo");
122 //        classNames.add("LuiIdentifierInfo");
123 //        classNames.add("LuCodeInfo");
124 //        classNames.add("FeeInfo");
125 //        classNames.add("CurrencyAmountInfo");
126 //        classNames.add("RevenueInfo");
127 //        classNames.add("AffiliatedOrgInfo");
128 //        classNames.add("MeetingScheduleInfo");
129 //        classNames.add("LuiLuiRelationInfo");
130 //        classNames.add("LuiCapacityInfo");
131         
132 //        // Course Offering
133 //        classNames.add("CourseOfferingInfo");
134 //        classNames.add("CourseWaitlistEntryInfo");
135 //        classNames.add("OfferingInstructorInfo");
136 //        classNames.add("ActivityOfferingInfo");
137 //        classNames.add("RegistrationGroupInfo");
138 //        classNames.add("SeatPoolDefinitionInfo");
139 //        classNames.add("StatementTreeViewInfo");
140 //        classNames.add("ReqComponentInfo");
141 //        classNames.add("ReqCompFieldInfo");
142 
143 //        // Course registration
144 //        classNames.add("CourseRegistrationInfo");
145 //        classNames.add("ActivityRegistrationInfo");
146 //        classNames.add("RegGroupRegistrationInfo");
147 //        classNames.add("RegRequestInfo");
148 //        classNames.add("RegRequestItemInfo");
149 //        classNames.add("RegResponseInfo");
150 //        classNames.add("RegResponseItemInfo");
151 //
152 //          // Exemption
153 //        classNames.add("ExemptionInfo");
154 //        classNames.add("ExemptionRequestInfo");
155 //
156 //        // Grading
157 //        classNames.add("GradeRosterInfo");
158 //        classNames.add("GradeRosterEntryInfo");
159 //        classNames.add("GradeValuesGroupInfo"); 
160 //        
161 //        // LRR
162 //        classNames.add("LearningResultRecordInfo");
163 //        classNames.add("ResultSourceInfo");       
164 //        
165 //        // LRC
166 //        classNames.add("ResultValuesGroupInfo");
167 //        classNames.add("ResultValueInfo");     
168 //        classNames.add("ResultScaleInfo"); 
169         
170         instance.setClassNames(classNames);
171         instance.execute();
172 //        assertTrue(new File(instance.getOutputDirectory() + "/" + "ks-LprInfo-dictionary.xml").exists());
173     }
174 }