Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
EsbTestPackageMojo |
|
| 1.0;1 |
1 | package com.aurea.maven.plugins.sonic.esb; | |
2 | ||
3 | import java.io.File; | |
4 | import java.util.ArrayList; | |
5 | import java.util.List; | |
6 | ||
7 | import org.apache.maven.model.Resource; | |
8 | ||
9 | ||
10 | ||
11 | /** | |
12 | * packages the test artifacts from an ESB project as a .zip file. | |
13 | * | |
14 | * <ol> | |
15 | * <li>artifacts from the deploy/generated-src/test-xar folder project are bundled into a .xar file | |
16 | * <li>the various .snippets files are generated | |
17 | * <li>artifact specific tailorings are generated | |
18 | * <li>the .xar file, snippets and tailoring files are is wrapped up into a .zip file | |
19 | * </ol> | |
20 | * | |
21 | * @goal esb-test-package | |
22 | */ | |
23 | 0 | public class EsbTestPackageMojo extends AbstractEsbPackageMojo { |
24 | ||
25 | ||
26 | /** | |
27 | * Directory containing the test classes and resource files that should be packaged into the JAR. | |
28 | * | |
29 | * @parameter property="project.build.testOutputDirectory" | |
30 | * @required | |
31 | */ | |
32 | @SuppressWarnings("unused") | |
33 | private File testClassesDirectory; | |
34 | ||
35 | ||
36 | // /** | |
37 | // * {@inheritDoc} | |
38 | // */ | |
39 | // protected void copyGeneratedSrcToXarDir() throws MojoExecutionException { | |
40 | // | |
41 | // super.copyGeneratedSrcToXarDir(); | |
42 | // | |
43 | // // now copy target/generated-test-sources/sonicesb to the XarDir too | |
44 | // copyProcessFilesReplacingEsbpWithXml(project.getBuild().getDirectory() + "/generated-test-sources/sonicesb", | |
45 | // getPackageXarDir()); | |
46 | // } | |
47 | ||
48 | /** | |
49 | * {@inheritDoc} | |
50 | */ | |
51 | @Override | |
52 | protected String getGeneratedSrcDir() { | |
53 | ||
54 | 0 | return testableDeployGenSrcDir.getPath(); |
55 | } | |
56 | ||
57 | /** | |
58 | * {@inheritDoc} | |
59 | */ | |
60 | @Override | |
61 | protected String getAssemblyDir() { | |
62 | ||
63 | 0 | return getOutputDirectory() + "/sonicesb/testAssembly"; |
64 | } | |
65 | ||
66 | /** | |
67 | * {@inheritDoc} | |
68 | */ | |
69 | @Override | |
70 | protected String getPackageXarDir() { | |
71 | ||
72 | 0 | return getOutputDirectory() + "/sonicesb/testPackageXar/fileSystem"; |
73 | } | |
74 | ||
75 | /** | |
76 | * {@inheritDoc} | |
77 | */ | |
78 | @Override | |
79 | protected File getSonicEsbSourceDirectory() { | |
80 | ||
81 | 0 | return sonicesbTestSourceDirectory; |
82 | } | |
83 | ||
84 | /** | |
85 | * {@inheritDoc} | |
86 | */ | |
87 | protected String getClassifier() { | |
88 | ||
89 | 0 | return "tests"; |
90 | } | |
91 | ||
92 | /** | |
93 | * @return type of the generated artifact | |
94 | */ | |
95 | protected String getType() { | |
96 | ||
97 | 0 | return "esb"; |
98 | } | |
99 | ||
100 | ||
101 | /** | |
102 | * {@inheritDoc} | |
103 | */ | |
104 | @Override | |
105 | protected File getEsbTailorPropFile() { | |
106 | ||
107 | 0 | return testEsbTailorPropFile; |
108 | } | |
109 | ||
110 | /** | |
111 | * @return the directory to contain any dependencies | |
112 | */ | |
113 | protected String getDependencyDirectory() { | |
114 | ||
115 | 0 | return getTestDependencyDirectory(); |
116 | } | |
117 | ||
118 | ||
119 | /** | |
120 | * {@inheritDoc} | |
121 | */ | |
122 | @Override | |
123 | protected ArrayList<String> getParameterMatches() { | |
124 | ||
125 | 0 | return testParameterMatches; |
126 | } | |
127 | ||
128 | @Override | |
129 | protected List<Resource> getResources() { | |
130 | ||
131 | 0 | return project.getTestResources(); |
132 | } | |
133 | ||
134 | } |