Author: rdonkin
Date: Mon Aug 6 20:08:22 2012
New Revision: 1369964
URL: http://svn.apache.org/viewvc?rev=1369964&view=rev
Log:
Add support for primary copyright notice
Modified:
creadur/whisker/trunk/apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java
creadur/whisker/trunk/apache-whisker-xml/src/test/java/org/apache/creadur/whisker/fromxml/JDomBuilderWorkTest.java
Modified:
creadur/whisker/trunk/apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java
URL:
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java?rev=1369964&r1=1369963&r2=1369964&view=diff
==============================================================================
---
creadur/whisker/trunk/apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java
(original)
+++
creadur/whisker/trunk/apache-whisker-xml/src/main/java/org/apache/creadur/whisker/fromxml/JDomBuilder.java
Mon Aug 6 20:08:22 2012
@@ -488,10 +488,12 @@ public class JDomBuilder {
final Map<String, License> licenses = mapLicenses(document);
final Map<String, String> notices = mapNotices(document);
final License primaryLicense = primaryLicense(document, licenses);
+ final String primaryCopyrightNotice = primaryCopyrightNotice(document);
final String primaryNotice = primaryNotice(document);
final String primaryOrganisationId = primaryOrganisationId(document);
final Collection<WithinDirectory> contents = collectContents(document,
licenses, organisations);
- return new Descriptor(primaryLicense, primaryOrganisationId,
primaryNotice,
+ return new Descriptor(primaryLicense, primaryCopyrightNotice,
+ primaryOrganisationId, primaryNotice,
licenses, notices, organisations, contents);
}
Modified:
creadur/whisker/trunk/apache-whisker-xml/src/test/java/org/apache/creadur/whisker/fromxml/JDomBuilderWorkTest.java
URL:
http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-xml/src/test/java/org/apache/creadur/whisker/fromxml/JDomBuilderWorkTest.java?rev=1369964&r1=1369963&r2=1369964&view=diff
==============================================================================
---
creadur/whisker/trunk/apache-whisker-xml/src/test/java/org/apache/creadur/whisker/fromxml/JDomBuilderWorkTest.java
(original)
+++
creadur/whisker/trunk/apache-whisker-xml/src/test/java/org/apache/creadur/whisker/fromxml/JDomBuilderWorkTest.java
Mon Aug 6 20:08:22 2012
@@ -245,6 +245,20 @@ public class JDomBuilderWorkTest extends
assertEquals("Builder should set primary copyright notice", result,
copyrightNoticeSet);
}
+ public void testBuildPrimaryCopyright() throws Exception {
+ final String copyrightNoticeSet = "Some Copyright Claim";
+ final String result = subject.build(new Document().setRootElement(
+ new Element("manifest")
+ .addContent(
+ new Element("licenses").addContent(
+ new Element("license").setAttribute("id",
"The primary ID")))
+ .addContent(
+ new Element("primary-license").setAttribute("id", "The
primary ID")
+ .addContent(
+ new
Element("copyright-notice").addContent(copyrightNoticeSet))))
+ ).getPrimaryCopyrightNotice();
+ assertEquals("Builder should set primary copyright notice", result,
copyrightNoticeSet);
+ }
public void testThrowsMissingIDExceptionWhenPrimaryLicenseMissing() throws
Exception {
final String id = "The primary ID";