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