Clover Coverage Report - KS Contract Documentation Generator 0.0.1-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
21   95   5   5.25
2   53   0.24   4
4     1.25  
1    
 
  PureJavaInterfaceWriterRun       Line # 32 21 0% 5 27 0% 0.0
 
No Tests
 
1    /*
2    * Copyright 2009 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.contract.command.run;
17   
18    import java.util.ArrayList;
19    import java.util.Collection;
20    import java.util.List;
21   
22    import org.kuali.student.contract.model.ServiceContractModel;
23    import org.kuali.student.contract.model.impl.ServiceContractModelCache;
24    import org.kuali.student.contract.model.impl.ServiceContractModelQDoxLoader;
25    import org.kuali.student.contract.model.validation.ServiceContractModelValidator;
26    import org.kuali.student.contract.writer.service.PureJavaInfcWriter;
27   
28    /**
29    *
30    * @author nwright
31    */
 
32    public class PureJavaInterfaceWriterRun {
33   
 
34  0 toggle public PureJavaInterfaceWriterRun() {
35    }
36    private static final String CORE_DIRECTORY =
37    "C:/svn/student/ks-core/ks-core-api/src/main/java";
38    // "C:/svn/maven-dictionary-generator/trunk/src/main/java/org/kuali/student/core";
39    private static final String COMMON_DIRECTORY =
40    "C:/svn/student/ks-common/ks-common-api/src/main/java";
41    private static final String LUM_DIRECTORY =
42    "C:/svn/student/ks-lum/ks-lum-api/src/main/java";
43   
 
44  0 toggle private static ServiceContractModel getModel() {
45  0 List<String> srcDirs = new ArrayList();
46  0 srcDirs.add(CORE_DIRECTORY);
47  0 srcDirs.add(COMMON_DIRECTORY);
48  0 srcDirs.add(LUM_DIRECTORY);
49  0 ServiceContractModel instance = new ServiceContractModelQDoxLoader(srcDirs);
50  0 return new ServiceContractModelCache(instance);
51    }
52   
 
53  0 toggle private static void validate(ServiceContractModel model) {
54  0 Collection<String> errors =
55    new ServiceContractModelValidator(model).validate();
56  0 if (errors.size() > 0) {
57  0 StringBuffer buf = new StringBuffer();
58  0 buf.append(errors.size() + " errors found while validating the data.");
59  0 int cnt = 0;
60  0 for (String msg : errors) {
61  0 cnt++;
62  0 buf.append("\n");
63  0 buf.append("*error*" + cnt + ":" + msg);
64    }
65   
66  0 throw new IllegalArgumentException(buf.toString());
67    }
68    }
69   
 
70  0 toggle public static void main(String[] args) {
71  0 ServiceContractModel model = getModel();
72  0 validate(model);
73    // List<String> servicesToProcess = new ArrayList ();
74    // servicesToProcess.add ("atp");
75    // servicesToProcess.add ("lu");
76    // servicesToProcess.add ("lo");
77    // servicesToProcess.add ("organization");
78    // servicesToProcess.add ("proposal");
79    //// servicesToProcess.add ("comment");
80    // servicesToProcess.add ("dictionary");
81    // servicesToProcess.add ("document");
82    // servicesToProcess.add ("enumerable");
83    // servicesToProcess.add ("search");
84    // ServicesFilter filter = new ServicesFilterByKeys (servicesToProcess);
85  0 String targetDir = "target/gen-src";
86    // targetDir = "src/main/java";
87  0 PureJavaInfcWriter instance =
88    new PureJavaInfcWriter(model,
89    targetDir,
90    PureJavaInfcWriter.DEFAULT_ROOT_PACKAGE,
91    null);
92  0 instance.write();
93   
94    }
95    }