1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.mock.mojo;
17
18 import org.apache.maven.plugin.MojoExecutionException;
19 import org.apache.maven.plugin.MojoFailureException;
20 import org.apache.maven.project.MavenProject;
21 import org.kuali.student.common.mojo.AbstractKSMojo;
22 import org.kuali.student.contract.model.ServiceContractModel;
23 import org.kuali.student.contract.model.impl.ServiceContractModelPescXsdLoader;
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26
27 import java.util.ArrayList;
28 import java.util.HashMap;
29 import java.util.List;
30 import java.util.Map;
31
32
33
34
35
36
37
38
39
40 public class KSCreateConformanceTestMojo extends AbstractKSMojo {
41
42 private static Logger log = LoggerFactory.getLogger(KSCreateConformanceTestMojo.class);
43
44
45
46
47
48 private String targetDir;
49
50
51
52
53
54 public String getTargetDir() {
55 return targetDir;
56 }
57
58 public void setTargetDir(String targetDir) {
59 this.targetDir = targetDir;
60 }
61
62
63
64
65
66 public KSCreateConformanceTestMojo() {}
67
68
69
70
71
72 @Override
73 public void execute() throws MojoExecutionException, MojoFailureException {
74
75 ServiceContractModel model = getModel();
76 validate(model);
77 if (targetDir == null) {
78 targetDir = "target/generated-conf-tests";
79 }
80 boolean isR1 = false;
81 ConformanceTestWriter instance =
82 new ConformanceTestWriter(model,
83 targetDir,
84 MockImplWriter.ROOT_PACKAGE,
85 null,
86 isR1);
87 instance.write();
88 }
89
90 public static void main (String [] args) {
91 log.info("execute");
92 List<String> srcDirs = new ArrayList<String>();
93 srcDirs.add("C:/Users/mahtabme/kuali/student/enrollment/aggregate/branches/services/ks-api/ks-common-api/src/main/java");
94 srcDirs.add("C:/Users/mahtabme/kuali/student/enrollment/aggregate/branches/services/ks-api/ks-core-api/src/main");
95 srcDirs.add("C:/Users/mahtabme/kuali/student/enrollment/aggregate/branches/services/ks-api/ks-lum-api/src/main/java");
96 srcDirs.add("C:/Users/mahtabme/kuali/student/enrollment/aggregate/branches/services/ks-api/ks-enroll-api/src/main/java");
97 KSCreateConformanceTestMojo instance = new KSCreateConformanceTestMojo();
98 Map pluginContext = new HashMap();
99 MavenProject project = new MavenProject();
100 pluginContext.put("project", project);
101 instance.setPluginContext(pluginContext);
102 instance.setSourceDirs(srcDirs);
103 instance.setTargetDir("C:/Users/mahtabme.CC4NPBS1/kuali/student/enrollment/aggregate/branches/services/target/generated-conf-tests");
104 try {
105 instance.execute();
106
107 } catch (MojoExecutionException ex) {
108 throw new RuntimeException(ex);
109 } catch (MojoFailureException ex) {
110 throw new RuntimeException(ex);
111 }
112
113 }
114
115
116 }