You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by po...@apache.org on 2019/05/30 21:24:14 UTC
[creadur-rat] branch trunk updated: RAT-244: Fix adding test
annotations to actually run tests
This is an automated email from the ASF dual-hosted git repository.
pottlinger pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/creadur-rat.git
The following commit(s) were added to refs/heads/trunk by this push:
new 6b20c36 RAT-244: Fix adding test annotations to actually run tests
6b20c36 is described below
commit 6b20c366f72bff467975b40c33a460b2a4116143
Author: Hugo Hirsch <gi...@hugo-hirsch.de>
AuthorDate: Thu May 30 23:24:09 2019 +0200
RAT-244: Fix adding test annotations to actually run tests
---
.../src/test/java/org/apache/rat/anttasks/ReportTest.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java b/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
index 0690574..a55d0fb 100644
--- a/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
+++ b/apache-rat-tasks/src/test/java/org/apache/rat/anttasks/ReportTest.java
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.rat.document.impl.guesser.BinaryGuesser;
+import org.junit.Test;
import org.w3c.dom.Document;
import static org.junit.Assert.*;
@@ -41,11 +42,13 @@ public class ReportTest extends AbstractRatAntTaskTest {
return antFile;
}
+ @Test
public void testWithReportSentToAnt() throws Exception {
buildRule.executeTarget("testWithReportSentToAnt");
assertLogMatches("AL +\\Q" + getAntFileName() + "\\E");
}
+ @Test
public void testWithReportSentToFile() throws Exception {
final File reportFile = new File(getTempDir(), "selftest.report");
if (!getTempDir().mkdirs() && !getTempDir().isDirectory()) {
@@ -61,18 +64,21 @@ public class ReportTest extends AbstractRatAntTaskTest {
assertFileMatches(reportFile, alLine);
}
+ @Test
public void testWithALUnknown() throws Exception {
buildRule.executeTarget("testWithALUnknown");
assertLogDoesNotMatch("AL +\\Q" + getAntFileName() + "\\E");
assertLogMatches("\\!\\?\\?\\?\\?\\? +\\Q" + getAntFileName() + "\\E");
}
+ @Test
public void testCustomMatcher() throws Exception {
buildRule.executeTarget("testCustomMatcher");
assertLogDoesNotMatch("AL +\\Q" + getAntFileName() + "\\E");
assertLogMatches("EXMPL +\\Q" + getAntFileName() + "\\E");
}
+ @Test
public void testNoResources() throws Exception {
try {
buildRule.executeTarget("testNoResources");
@@ -84,6 +90,7 @@ public class ReportTest extends AbstractRatAntTaskTest {
}
}
+ @Test
public void testNoLicenseMatchers() throws Exception {
try {
buildRule.executeTarget("testNoLicenseMatchers");
@@ -117,6 +124,7 @@ public class ReportTest extends AbstractRatAntTaskTest {
}
}
+ @Test
public void testAddLicenseHeaders() throws Exception {
buildRule.executeTarget("testAddLicenseHeaders");
@@ -133,6 +141,7 @@ public class ReportTest extends AbstractRatAntTaskTest {
/**
* Test correct generation of string result if non-UTF8 file.encoding is set.
*/
+ @Test
public void testISO88591() throws Exception {
String origEncoding = overrideFileEncoding("ISO-8859-1");
buildRule.executeTarget("testISO88591");
@@ -143,6 +152,7 @@ public class ReportTest extends AbstractRatAntTaskTest {
/**
* Test correct generation of XML file if non-UTF8 file.encoding is set.
*/
+ @Test
public void testISO88591WithFile() throws Exception {
Charset.defaultCharset();
String outputDir = System.getProperty("output.dir", "target/anttasks");