001 /* 002 * Copyright 2011 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.osedu.org/licenses/ECL-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.student.datadictionary.mojo; 017 018 import java.io.File; 019 import java.util.ArrayList; 020 import java.util.List; 021 import org.junit.After; 022 import org.junit.AfterClass; 023 import org.junit.Before; 024 import org.junit.BeforeClass; 025 import org.junit.Test; 026 import static org.junit.Assert.*; 027 028 /** 029 * 030 * @author nwright 031 */ 032 public class KSDictionaryCreatorMojoTest { 033 034 private static final String CORE_DIRECTORY = 035 "C:/svn/ks-1.3/ks-core/ks-core-api/src/main/java"; 036 // "C:/svn/maven-dictionary-generator/trunk/src/main/java/org/kuali/student/core"; 037 private static final String COMMON_DIRECTORY = 038 "C:/svn/ks-1.3/ks-common/ks-common-api/src/main/java"; 039 private static final String ENROLL_PROJECT_SRC_MAIN = "C:/svn/ks-1.3/ks-enroll/ks-enroll-api/src/main"; 040 private static final String ENROLL_PROJECT_JAVA_DIRECTORY = ENROLL_PROJECT_SRC_MAIN + "/java"; 041 private static final String ENROLL_PROJECT_RESOURCES_DIRECTORY = ENROLL_PROJECT_SRC_MAIN + "/resources"; 042 private static final String LUM_DIRECTORY = 043 "C:/svn/ks-1.3/ks-lum/ks-lum-api/src/main/java"; 044 private static final String RICE_DIRECTORY = 045 "C:/svn/rice/rice-release-1-0-2-1-br/api/src/main/java"; 046 private static final String TEST_SOURCE_DIRECTORY = 047 "src/test/java/org/kuali/student/contract/model/test/source"; 048 private static final String TARGET_GENERATED_SOURCES = "target/generated-sources"; 049 private static final String RESOURCES_DIRECTORY = 050 // "C:/svn/student/ks-core/ks-core-api/src/main/java"; 051 "src/main/resources"; 052 private static final String PESC_CORE_MAIN = RESOURCES_DIRECTORY 053 + "/CoreMain_v1.8.0.xsd"; 054 055 public KSDictionaryCreatorMojoTest() { 056 } 057 058 @BeforeClass 059 public static void setUpClass() throws Exception { 060 } 061 062 @AfterClass 063 public static void tearDownClass() throws Exception { 064 } 065 066 @Before 067 public void setUp() { 068 } 069 070 @After 071 public void tearDown() { 072 } 073 074 /** 075 * Test of execute method, of class KSDictionaryCreatorMojo. 076 */ 077 @Test 078 public void testExecute() throws Exception { 079 System.out.println("execute"); 080 List<String> srcDirs = new ArrayList<String>(); 081 // srcDirs.add(TEST_SOURCE_DIRECTORY); 082 srcDirs.add(ENROLL_PROJECT_JAVA_DIRECTORY); 083 084 // srcDirs.add(CORE_DIRECTORY); 085 // srcDirs.add(COMMON_DIRECTORY); 086 // srcDirs.add(LUM_DIRECTORY); 087 KSDictionaryCreatorMojo instance = new KSDictionaryCreatorMojo(); 088 instance.setSourceDirs(srcDirs); 089 // instance.setOutputDirectory(new File(TARGET_GENERATED_SOURCES)); 090 instance.setOutputDirectory(new File(ENROLL_PROJECT_RESOURCES_DIRECTORY)); 091 // Be careful when you uncomment this one it will overwrite stuff in another project 092 // instance.setOutputDirectory(new File(ENROLL_PROJECT_RESOURCES_DIRECTORY)); 093 instance.setWriteManual(true); 094 instance.setWriteGenerated(true); 095 instance.setThrowExceptionIfNotAllFilesProcessed(false); 096 List<String> classNames = new ArrayList(); 097 // Atp 098 // classNames.add("AtpInfo"); 099 // classNames.add("MilestoneInfo"); 100 // classNames.add("AtpMilestoneRelationInfo"); 101 // classNames.add("AtpAtpRelationInfo"); 102 // // Acal 103 // classNames.add("AcademicCalendarInfo"); 104 // classNames.add("CampusCalendarInfo"); 105 // classNames.add("TermInfo"); 106 // classNames.add("RegistrationDateGroupInfo"); 107 // classNames.add("HolidayInfo"); 108 // classNames.add("KeyDateInfo"); 109 // // LPR 110 // classNames.add("LuiPersonRelationInfo"); 111 // classNames.add("LprRosterInfo"); 112 // classNames.add("LprRosterEntryInfo"); 113 // classNames.add("LprTransactionInfo"); 114 // classNames.add("LprTransactionItemInfo"); 115 // classNames.add("RequestOptionInfo"); 116 // classNames.add("LprTransactionItemResultInfo"); 117 // // Hold 118 // classNames.add("HoldInfo"); 119 // classNames.add("IssueInfo"); 120 // classNames.add("RestrictionInfo"); 121 // // LUI 122 // classNames.add("LuiInfo"); 123 // classNames.add("LuiIdentifierInfo"); 124 // classNames.add("LuCodeInfo"); 125 // classNames.add("FeeInfo"); 126 // classNames.add("CurrencyAmountInfo"); 127 // classNames.add("RevenueInfo"); 128 // classNames.add("AffiliatedOrgInfo"); 129 // classNames.add("MeetingScheduleInfo"); 130 // classNames.add("LuiLuiRelationInfo"); 131 // classNames.add("LuiCapacityInfo"); 132 133 // // Course Offering 134 // classNames.add("CourseOfferingInfo"); 135 // classNames.add("CourseWaitlistEntryInfo"); 136 // classNames.add("OfferingInstructorInfo"); 137 // classNames.add("ActivityOfferingInfo"); 138 // classNames.add("RegistrationGroupInfo"); 139 // classNames.add("SeatPoolDefinitionInfo"); 140 // classNames.add("StatementTreeViewInfo"); 141 // classNames.add("ReqComponentInfo"); 142 // classNames.add("ReqCompFieldInfo"); 143 144 // // Course registration 145 // classNames.add("CourseRegistrationInfo"); 146 // classNames.add("ActivityRegistrationInfo"); 147 // classNames.add("RegGroupRegistrationInfo"); 148 // classNames.add("RegRequestInfo"); 149 // classNames.add("RegRequestItemInfo"); 150 // classNames.add("RegResponseInfo"); 151 // classNames.add("RegResponseItemInfo"); 152 // 153 // // Exemption 154 // classNames.add("ExemptionInfo"); 155 // classNames.add("ExemptionRequestInfo"); 156 // 157 // // Grading 158 // classNames.add("GradeRosterInfo"); 159 // classNames.add("GradeRosterEntryInfo"); 160 // classNames.add("GradeValuesGroupInfo"); 161 // 162 // // LRR 163 // classNames.add("LearningResultRecordInfo"); 164 // classNames.add("ResultSourceInfo"); 165 // 166 // // LRC 167 // classNames.add("ResultValuesGroupInfo"); 168 // classNames.add("ResultValueInfo"); 169 // classNames.add("ResultScaleInfo"); 170 171 instance.execute(); 172 // assertTrue(new File(instance.getOutputDirectory() + "/" + "ks-LprInfo-dictionary.xml").exists()); 173 } 174 }