1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.codehaus.castor.maven.xmlctf;
15
16 import junit.framework.Test;
17 import junit.framework.TestResult;
18 import junit.textui.TestRunner;
19
20 import org.apache.maven.plugin.MojoExecutionException;
21 import org.apache.maven.plugins.annotations.Mojo;
22 import org.apache.maven.plugins.annotations.ResolutionScope;
23
24
25
26
27
28
29 @Mojo(name = "xmlctf-text", requiresDependencyResolution = ResolutionScope.RUNTIME,
30 requiresProject = true)
31 public class TextTestSuiteMojo extends AbstractTestSuiteMojo {
32
33 public void runJUnit(Test testSuite) throws MojoExecutionException {
34 TestResult result = TestRunner.run(testSuite);
35
36 if (result.errorCount() > 0 || result.failureCount() > 0) {
37 throw new MojoExecutionException("Errors or Failures occured testing the MasterTestSuite!");
38 }
39 }
40
41 }