You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2009/05/22 22:19:35 UTC
svn commit: r777691 - in /incubator/rat/main/trunk:
apache-rat-core/src/main/java/org/apache/rat/analysis/
apache-rat-core/src/main/java/org/apache/rat/analysis/generation/
apache-rat-core/src/main/java/org/apache/rat/analysis/license/
apache-rat-core/...
Author: rdonkin
Date: Fri May 22 20:19:34 2009
New Revision: 777691
URL: http://svn.apache.org/viewvc?rev=777691&view=rev
Log:
RAT-53 HeaderMatchers shouldn't need reporters any more. https://issues.apache.org/jira/browse/RAT-53
Modified:
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/DojoLicenseHeader.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/TMF854LicenseHeader.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CDocLicense.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CLicense.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/report/analyser/HeaderCheckWorker.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/MockLicenseMatcher.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20Test.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/W3CLicenseTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/util/MatcherMultiplexerTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/analyser/AnalyserFactoryTest.java
incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
incubator/rat/main/trunk/apache-rat-tasks/src/test/java/org/example/Matcher.java
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java Fri May 22 20:19:34 2009
@@ -19,7 +19,6 @@
package org.apache.rat.analysis;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
/**
* Matches text headers to known licenses.
@@ -38,8 +37,7 @@
* TODO probably a poor design choice - hope to fix later
* @param subject TODO
* @param line next line of text, not null
- * @param reporter TODO
* @return TODO
*/
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException;
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequired.java Fri May 22 20:19:34 2009
@@ -64,19 +64,19 @@
this.numberOfPatterns = linePatterns.length;
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = false;
for (int i=0;i<numberOfPatterns;i++) {
if (linePatterns[i].matcher(line).matches()) {
result = true;
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
break;
}
}
return result;
}
- private void reportOnLicense(Document subject, Reporter reporter) throws RatHeaderAnalysisException {
+ private void reportOnLicense(Document subject) throws RatHeaderAnalysisException {
subject.getMetaData().set(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_GEN);
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequired.java Fri May 22 20:19:34 2009
@@ -23,7 +23,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
/**
@@ -36,15 +35,15 @@
private static final Pattern JAVADOC_REGEX = Pattern.compile(JAVADOC_REGEX_DEFN);
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = JAVADOC_REGEX.matcher(line).matches();
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
- private void reportOnLicense(Document subject, Reporter reporter) throws RatHeaderAnalysisException {
+ private void reportOnLicense(Document subject) throws RatHeaderAnalysisException {
subject.getMetaData().set(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_GEN);
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
/**
@@ -38,10 +37,10 @@
super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_ASL, MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_APACHE_LICENSE_VERSION_2_0, "");
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
final boolean result = matches(line);
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java Fri May 22 20:19:34 2009
@@ -20,7 +20,6 @@
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
public class BaseLicense {
@@ -35,7 +34,7 @@
this.notes = notes;
}
- public final void reportOnLicense(Document subject, Reporter reporter) throws RatHeaderAnalysisException {
+ public final void reportOnLicense(Document subject) throws RatHeaderAnalysisException {
final MetaData metaData = subject.getMetaData();
metaData.set(new MetaData.Datum(MetaData.RAT_URL_HEADER_SAMPLE, notes));
metaData.set(new MetaData.Datum(MetaData.RAT_URL_HEADER_CATEGORY,licenseFamilyCategory.getValue()));
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/DojoLicenseHeader.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/DojoLicenseHeader.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/DojoLicenseHeader.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/DojoLicenseHeader.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
@@ -49,10 +48,10 @@
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
final boolean result = matches(line);
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/OASISLicense.java Fri May 22 20:19:34 2009
@@ -23,7 +23,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
/**
@@ -48,7 +47,7 @@
super(MetaData.RAT_LICENSE_FAMILY_CATEGORY_DATUM_OASIS, MetaData.RAT_LICENSE_FAMILY_NAME_DATUM_OASIS_OPEN_LICENSE, "No modifications allowed");
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = false;
if (copyrightMatch) {
line = line.toLowerCase();
@@ -57,7 +56,7 @@
final boolean clauseMatch = CLAUSE_PATTERN.matcher(buffer).matches();
if (clauseMatch) {
result = true;
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
} else {
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/TMF854LicenseHeader.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/TMF854LicenseHeader.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/TMF854LicenseHeader.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/TMF854LicenseHeader.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
@@ -42,10 +41,10 @@
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
final boolean result = matches(line);
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CDocLicense.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CDocLicense.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CDocLicense.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CDocLicense.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
public class W3CDocLicense extends BaseLicense implements IHeaderMatcher {
@@ -37,10 +36,10 @@
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = line != null && line.indexOf(COPYRIGHT_URL) != -1;
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CLicense.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CLicense.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CLicense.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/license/W3CLicense.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
public class W3CLicense extends BaseLicense implements IHeaderMatcher {
@@ -37,10 +36,10 @@
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = line != null && line.indexOf(COPYRIGHT_URL) != -1;
if (result) {
- reportOnLicense(subject, reporter);
+ reportOnLicense(subject);
}
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/analysis/util/HeaderMatcherMultiplexer.java Fri May 22 20:19:34 2009
@@ -21,7 +21,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
/**
* Delegates to an ordered set of matchers.
@@ -37,10 +36,10 @@
numberOfMatchers = matchers.length;
}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
boolean result = false;
for (int i=0;i<numberOfMatchers;i++) {
- result = matchers[i].match(subject, line, reporter);
+ result = matchers[i].match(subject, line);
if (result) {
break;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/report/analyser/HeaderCheckWorker.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/report/analyser/HeaderCheckWorker.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/report/analyser/HeaderCheckWorker.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/main/java/org/apache/rat/report/analyser/HeaderCheckWorker.java Fri May 22 20:19:34 2009
@@ -115,7 +115,7 @@
headers.append(line);
headers.append('\n');
}
- match = matcher.match(subject, line, reporter);
+ match = matcher.match(subject, line);
result = !match;
}
return result;
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/MockLicenseMatcher.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/MockLicenseMatcher.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/MockLicenseMatcher.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/MockLicenseMatcher.java Fri May 22 20:19:34 2009
@@ -22,7 +22,6 @@
import java.util.List;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
public class MockLicenseMatcher implements IHeaderMatcher {
@@ -30,7 +29,7 @@
public int resets = 0;
public boolean result = true;
- public boolean match(Document subject, String line, Reporter reporter) {
+ public boolean match(Document subject, String line) {
lines.add(line);
return result;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/GeneratedLicenseNotRequiredTest.java Fri May 22 20:19:34 2009
@@ -44,7 +44,7 @@
public void testMatch() throws Exception {
final Document subject = new MockLocation("subject");
- assertFalse("Does not match regex", license.match(subject, "Not at all", reporter));
- assertTrue("Matches regex", license.match(subject, "This is Generated", reporter));
+ assertFalse("Does not match regex", license.match(subject, "Not at all"));
+ assertTrue("Matches regex", license.match(subject, "This is Generated"));
}
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/generation/JavaDocLicenseNotRequiredTest.java Fri May 22 20:19:34 2009
@@ -66,7 +66,7 @@
String line = in.readLine();
final Document subject = new MockLocation("subject");
while (line != null && !result) {
- result = license.match(subject, line, reporter);
+ result = license.match(subject, line);
line = in.readLine();
}
return result;
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20Test.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20Test.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20Test.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/ApacheSoftwareLicense20Test.java Fri May 22 20:19:34 2009
@@ -54,16 +54,16 @@
public void testMatch() throws Exception {
ApacheSoftwareLicense20 worker = new ApacheSoftwareLicense20();
final Document subject = new MockLocation("subject");
- assertTrue(worker.match(subject, ApacheSoftwareLicense20.FIRST_LICENSE_LINE, reporter));
- assertTrue(worker.match(subject, " Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, "Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " * Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " // Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " /* Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " ## Licensed under the Apache License, Version 2.0 (the \"License\");", reporter));
- assertTrue(worker.match(subject, " ## Licensed under the Apache License, Version 2.0 (the \"License\") ##);", reporter));
- assertFalse(worker.match(subject, "'Behold, Telemachus! (nor fear the sight,)", reporter));
+ assertTrue(worker.match(subject, ApacheSoftwareLicense20.FIRST_LICENSE_LINE));
+ assertTrue(worker.match(subject, " Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, "Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " * Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " // Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " /* Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " ## Licensed under the Apache License, Version 2.0 (the \"License\");"));
+ assertTrue(worker.match(subject, " ## Licensed under the Apache License, Version 2.0 (the \"License\") ##);"));
+ assertFalse(worker.match(subject, "'Behold, Telemachus! (nor fear the sight,)"));
}
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/OASISLicenseTest.java Fri May 22 20:19:34 2009
@@ -70,12 +70,12 @@
boolean result = false;
final Document subject = new MockLocation("subject");
while (line != null) {
- result = license.match(subject, line, reporter);
+ result = license.match(subject, line);
line = in.readLine();
}
assertTrue("OASIS license should be matched", result);
license.reset();
- result = license.match(subject, "New line", reporter);
+ result = license.match(subject, "New line");
assertFalse("After reset, content should build up again", result);
}
@@ -85,7 +85,7 @@
boolean result = false;
final Document subject = new MockLocation("subject");
while (line != null) {
- result = license.match(subject, line, reporter);
+ result = license.match(subject, line);
line = in.readLine();
}
assertFalse("OASIS license should not be matched", result);
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/W3CLicenseTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/W3CLicenseTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/W3CLicenseTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/license/W3CLicenseTest.java Fri May 22 20:19:34 2009
@@ -50,9 +50,9 @@
public void testMatch() throws Exception {
final Document subject = new MockLocation("subject");
- assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL, reporter));
- assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL_COMMENTED, reporter));
- assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL_XML, reporter));
- assertFalse("Return null if the license isn't matched", license.match(subject, "Bogus", reporter));
+ assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL));
+ assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL_COMMENTED));
+ assertTrue("Expected matcher to return license", license.match(subject, COPYRIGHT_URL_XML));
+ assertFalse("Return null if the license isn't matched", license.match(subject, "Bogus"));
}
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/util/MatcherMultiplexerTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/util/MatcherMultiplexerTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/util/MatcherMultiplexerTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/analysis/util/MatcherMultiplexerTest.java Fri May 22 20:19:34 2009
@@ -54,12 +54,12 @@
matcherOne.result = false;
matcherTwo.result = false;
final Document subject = new MockLocation("subject");
- multiplexer.match(subject, LINE_ONE, reporter);
+ multiplexer.match(subject, LINE_ONE);
assertEquals("One line", 1, matcherOne.lines.size());
assertEquals("Same as line passed", LINE_ONE, matcherOne.lines.get(0));
assertEquals("One line", 1, matcherTwo.lines.size());
assertEquals("Same as line passed", LINE_ONE, matcherTwo.lines.get(0));
- multiplexer.match(subject, LINE_TWO, reporter);
+ multiplexer.match(subject, LINE_TWO);
assertEquals("One line", 2, matcherOne.lines.size());
assertEquals("Same as line passed", LINE_TWO, matcherOne.lines.get(1));
assertEquals("One line", 2, matcherTwo.lines.size());
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/analyser/AnalyserFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/analyser/AnalyserFactoryTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/analyser/AnalyserFactoryTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/analyser/AnalyserFactoryTest.java Fri May 22 20:19:34 2009
@@ -26,7 +26,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.document.IDocumentAnalyser;
import org.apache.rat.document.impl.MonolithicFileDocument;
import org.apache.rat.report.claim.impl.xml.SimpleXmlClaimReporter;
@@ -45,7 +44,7 @@
reporter = new SimpleXmlClaimReporter(writer);
matcherStub = new IHeaderMatcher() {
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
return false;
}
Modified: incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java (original)
+++ incubator/rat/main/trunk/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java Fri May 22 20:19:34 2009
@@ -28,7 +28,6 @@
import org.apache.rat.analysis.IHeaderMatcher;
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.document.IDocumentAnalyser;
import org.apache.rat.report.analyser.DefaultAnalyserFactory;
import org.apache.rat.report.claim.impl.xml.SimpleXmlClaimReporter;
@@ -51,7 +50,7 @@
final SimpleXmlClaimReporter reporter = new SimpleXmlClaimReporter(writer);
final IHeaderMatcher matcher = new IHeaderMatcher() {
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
return false;
}
Modified: incubator/rat/main/trunk/apache-rat-tasks/src/test/java/org/example/Matcher.java
URL: http://svn.apache.org/viewvc/incubator/rat/main/trunk/apache-rat-tasks/src/test/java/org/example/Matcher.java?rev=777691&r1=777690&r2=777691&view=diff
==============================================================================
--- incubator/rat/main/trunk/apache-rat-tasks/src/test/java/org/example/Matcher.java (original)
+++ incubator/rat/main/trunk/apache-rat-tasks/src/test/java/org/example/Matcher.java Fri May 22 20:19:34 2009
@@ -20,7 +20,6 @@
import org.apache.rat.analysis.RatHeaderAnalysisException;
import org.apache.rat.analysis.license.BaseLicense;
import org.apache.rat.api.Document;
-import org.apache.rat.api.Reporter;
import org.apache.rat.api.MetaData;
@@ -31,8 +30,8 @@
}
public void reset() {}
- public boolean match(Document subject, String line, Reporter reporter) throws RatHeaderAnalysisException {
- reportOnLicense(subject, reporter);
+ public boolean match(Document subject, String line) throws RatHeaderAnalysisException {
+ reportOnLicense(subject);
return true;
}
}