Formatted and cleaned up sources
This commit is contained in:
parent
6fc3c3ffe1
commit
c83d2b9ec1
14 changed files with 162 additions and 143 deletions
|
@ -29,8 +29,8 @@ import com.sun.syndication.feed.impl.ToStringBean;
|
|||
*/
|
||||
public class Attribute implements Cloneable, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String _name;
|
||||
private String _value;
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@ import java.util.List;
|
|||
import com.sun.syndication.feed.WireFeed;
|
||||
|
||||
/**
|
||||
* This class represents the root of an OPML 1/2 feed and contains the elements that may appear in the <head> tag of the feed.
|
||||
* This class represents the root of an OPML 1/2 feed and contains the elements that may appear in
|
||||
* the <head> tag of the feed.
|
||||
*
|
||||
* @author <a href="mailto:cooper@screaming-penguin.com"> Robert "kebernet" Cooper</a>
|
||||
*/
|
||||
|
@ -71,8 +72,9 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* (OPML 2) <docs> is the http address of documentation for the format used in the OPML file. It's probably a pointer to <a
|
||||
* href="http://www.opml.org/spec2">this page</a> for people who might stumble across the file on a web server 25 years from now and wonder what it is.
|
||||
* (OPML 2) <docs> is the http address of documentation for the format used in the OPML
|
||||
* file. It's probably a pointer to <a href="http://www.opml.org/spec2">this page</a> for people
|
||||
* who might stumble across the file on a web server 25 years from now and wonder what it is.
|
||||
*
|
||||
* @param docs http address of documentation for the format used
|
||||
*/
|
||||
|
@ -81,8 +83,9 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* (OPML 2) <docs> is the http address of documentation for the format used in the OPML file. It's probably a pointer to <a
|
||||
* href="http://www.opml.org/spec2">this page</a> for people who might stumble across the file on a web server 25 years from now and wonder what it is.
|
||||
* (OPML 2) <docs> is the http address of documentation for the format used in the OPML
|
||||
* file. It's probably a pointer to <a href="http://www.opml.org/spec2">this page</a> for people
|
||||
* who might stumble across the file on a web server 25 years from now and wonder what it is.
|
||||
*
|
||||
* @return http address of documentation for the format used
|
||||
*/
|
||||
|
@ -91,9 +94,10 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* <expansionState>is a comma-separated list of line numbers that are expanded. The line numbers in the list tell you which headlines to expand. The
|
||||
* order is important. For each element in the list, X, starting at the first summit, navigate flatdown X times and expand. Repeat for each element in the
|
||||
* list.
|
||||
* <expansionState>is a comma-separated list of line numbers that are expanded. The line
|
||||
* numbers in the list tell you which headlines to expand. The order is important. For each
|
||||
* element in the list, X, starting at the first summit, navigate flatdown X times and expand.
|
||||
* Repeat for each element in the list.
|
||||
*
|
||||
* @param expansionState int array containing expanded elements.
|
||||
*/
|
||||
|
@ -102,9 +106,10 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* <expansionState> is a comma-separated list of line numbers that are expanded. The line numbers in the list tell you which headlines to expand. The
|
||||
* order is important. For each element in the list, X, starting at the first summit, navigate flatdown X times and expand. Repeat for each element in the
|
||||
* list.
|
||||
* <expansionState> is a comma-separated list of line numbers that are expanded. The line
|
||||
* numbers in the list tell you which headlines to expand. The order is important. For each
|
||||
* element in the list, X, starting at the first summit, navigate flatdown X times and expand.
|
||||
* Repeat for each element in the list.
|
||||
*
|
||||
* @return int array containing expanded elements.
|
||||
*/
|
||||
|
@ -171,22 +176,26 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* (OPML 2) <ownerId> is the http address of a web page that contains <strike>an HTML</strike> a form that allows a human reader to communicate with
|
||||
* the author of the document via email or other means.
|
||||
* (OPML 2) <ownerId> is the http address of a web page that contains <strike>an
|
||||
* HTML</strike> a form that allows a human reader to communicate with the author of the
|
||||
* document via email or other means.
|
||||
*
|
||||
* @param ownerId http address of a web page that contains <strike>an HTML</strike> a form that allows a human reader to communicate with the author of the
|
||||
* document via email or other means.
|
||||
* @param ownerId http address of a web page that contains <strike>an HTML</strike> a form that
|
||||
* allows a human reader to communicate with the author of the document via email or
|
||||
* other means.
|
||||
*/
|
||||
public void setOwnerId(final String ownerId) {
|
||||
_ownerId = ownerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* (OPML 2) <ownerId> is the http address of a web page that contains <strike>an HTML</strike> a form that allows a human reader to communicate with
|
||||
* the author of the document via email or other means.
|
||||
* (OPML 2) <ownerId> is the http address of a web page that contains <strike>an
|
||||
* HTML</strike> a form that allows a human reader to communicate with the author of the
|
||||
* document via email or other means.
|
||||
*
|
||||
* @return http address of a web page that contains <strike>an HTML</strike> a form that allows a human reader to communicate with the author of the
|
||||
* document via email or other means.
|
||||
* @return http address of a web page that contains <strike>an HTML</strike> a form that allows
|
||||
* a human reader to communicate with the author of the document via email or other
|
||||
* means.
|
||||
*/
|
||||
public String getOwnerId() {
|
||||
return _ownerId;
|
||||
|
@ -229,20 +238,22 @@ public class Opml extends WireFeed {
|
|||
}
|
||||
|
||||
/**
|
||||
* <vertScrollState> is a number, saying which line of the outline is displayed on the top line of the window. This number is calculated with the
|
||||
* expansion state already applied.
|
||||
* <vertScrollState> is a number, saying which line of the outline is displayed on the top
|
||||
* line of the window. This number is calculated with the expansion state already applied.
|
||||
*
|
||||
* @param verticalScrollState which line of the outline is displayed on the top line of the window.
|
||||
* @param verticalScrollState which line of the outline is displayed on the top line of the
|
||||
* window.
|
||||
*/
|
||||
public void setVerticalScrollState(final Integer verticalScrollState) {
|
||||
_verticalScrollState = verticalScrollState;
|
||||
}
|
||||
|
||||
/**
|
||||
* <vertScrollState> is a number, saying which line of the outline is displayed on the top line of the window. This number is calculated with the
|
||||
* expansion state already applied.
|
||||
* <vertScrollState> is a number, saying which line of the outline is displayed on the top
|
||||
* line of the window. This number is calculated with the expansion state already applied.
|
||||
*
|
||||
* @return which line of the outline is displayed on the top line of the window. This number is calculated with the expansion state already applied.
|
||||
* @return which line of the outline is displayed on the top line of the window. This number is
|
||||
* calculated with the expansion state already applied.
|
||||
*/
|
||||
public Integer getVerticalScrollState() {
|
||||
return _verticalScrollState;
|
||||
|
|
|
@ -66,7 +66,8 @@ public class Outline implements Cloneable, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates an outline with the given title, xmlUrl and htmlUrl. This is traditionally used for aggregator feed lists and will get a type of "rss".
|
||||
* Creates an outline with the given title, xmlUrl and htmlUrl. This is traditionally used for
|
||||
* aggregator feed lists and will get a type of "rss".
|
||||
*
|
||||
* @param title Title of the entry.
|
||||
* @param xmlUrl link to XML file.
|
||||
|
@ -110,8 +111,9 @@ public class Outline implements Cloneable, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* isBreakpoint is a string, either "true" or "false", indicating whether a breakpoint is set on this outline. This attribute is mainly necessary for
|
||||
* outlines used to edit scripts. If it's not present, the value is false.
|
||||
* isBreakpoint is a string, either "true" or "false", indicating whether a breakpoint is set on
|
||||
* this outline. This attribute is mainly necessary for outlines used to edit scripts. If it's
|
||||
* not present, the value is false.
|
||||
*
|
||||
* @param breakpoint whether a breakpoint is set on this outline.
|
||||
*/
|
||||
|
@ -120,8 +122,9 @@ public class Outline implements Cloneable, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* isBreakpoint is a string, either "true" or "false", indicating whether a breakpoint is set on this outline. This attribute is mainly necessary for
|
||||
* outlines used to edit scripts. If it's not present, the value is false.
|
||||
* isBreakpoint is a string, either "true" or "false", indicating whether a breakpoint is set on
|
||||
* this outline. This attribute is mainly necessary for outlines used to edit scripts. If it's
|
||||
* not present, the value is false.
|
||||
*
|
||||
* @return whether a breakpoint is set on this outline
|
||||
*/
|
||||
|
@ -174,8 +177,9 @@ public class Outline implements Cloneable, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* isComment is a string, either "true" or "false", indicating whether the outline is commented or not. By convention if an outline is commented, all
|
||||
* subordinate outlines are considered to also be commented. If it's not present, the value is false.
|
||||
* isComment is a string, either "true" or "false", indicating whether the outline is commented
|
||||
* or not. By convention if an outline is commented, all subordinate outlines are considered to
|
||||
* also be commented. If it's not present, the value is false.
|
||||
*
|
||||
* @param comment whether the outline is commented
|
||||
*/
|
||||
|
@ -184,8 +188,9 @@ public class Outline implements Cloneable, Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* isComment is a string, either "true" or "false", indicating whether the outline is commented or not. By convention if an outline is commented, all
|
||||
* subordinate outlines are considered to also be commented. If it's not present, the value is false.
|
||||
* isComment is a string, either "true" or "false", indicating whether the outline is commented
|
||||
* or not. By convention if an outline is commented, all subordinate outlines are considered to
|
||||
* also be commented. If it's not present, the value is false.
|
||||
*
|
||||
* @return whether the outline is commented
|
||||
*/
|
||||
|
|
|
@ -205,12 +205,12 @@ public class ConverterForOPML10 implements Converter {
|
|||
final List<SyndEntry> entries = Collections.synchronizedList(syndFeed.getEntries());
|
||||
|
||||
final HashMap<String, Outline> entriesByNode = new HashMap<String, Outline>();
|
||||
|
||||
|
||||
// this will hold entries that we can't parent the first time.
|
||||
final ArrayList<OutlineHolder> doAfterPass = new ArrayList<OutlineHolder>();
|
||||
final ArrayList<OutlineHolder> doAfterPass = new ArrayList<OutlineHolder>();
|
||||
|
||||
// this holds root level outlines;
|
||||
final ArrayList<Outline> root = new ArrayList<Outline>();
|
||||
final ArrayList<Outline> root = new ArrayList<Outline>();
|
||||
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
final SyndEntry entry = entries.get(i);
|
||||
|
|
|
@ -12,7 +12,7 @@ import com.sun.syndication.feed.WireFeed;
|
|||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author cooper
|
||||
*/
|
||||
public class ConverterForOPML20 extends ConverterForOPML10 {
|
||||
|
@ -24,7 +24,7 @@ public class ConverterForOPML20 extends ConverterForOPML10 {
|
|||
/**
|
||||
* Returns the type (version) of the real feed this converter handles.
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @return the real feed type.
|
||||
* @see WireFeed for details on the format of this string.
|
||||
* <p>
|
||||
|
@ -39,9 +39,10 @@ public class ConverterForOPML20 extends ConverterForOPML10 {
|
|||
* <p>
|
||||
* It assumes the given SyndFeedImpl has no properties set.
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @param feed real feed to copy/convert.
|
||||
* @param syndFeed the SyndFeedImpl that will contain the copied/converted values of the real feed.
|
||||
* @param syndFeed the SyndFeedImpl that will contain the copied/converted values of the real
|
||||
* feed.
|
||||
*/
|
||||
@Override
|
||||
public void copyInto(final WireFeed feed, final SyndFeed syndFeed) {
|
||||
|
@ -51,7 +52,7 @@ public class ConverterForOPML20 extends ConverterForOPML10 {
|
|||
/**
|
||||
* Creates real feed with a deep copy/conversion of the values of a SyndFeedImpl.
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @param syndFeed SyndFeedImpl to copy/convert value from.
|
||||
* @return a real feed with copied/converted values of the SyndFeedImpl.
|
||||
*/
|
||||
|
|
|
@ -52,7 +52,8 @@ public class OPML10Generator extends BaseWireFeedGenerator implements WireFeedGe
|
|||
*
|
||||
* @param feed the feed bean to generate the XML document from.
|
||||
* @return the generated XML document (JDOM).
|
||||
* @throws IllegalArgumentException thrown if the type of the given feed bean does not match with the type of the WireFeedGenerator.
|
||||
* @throws IllegalArgumentException thrown if the type of the given feed bean does not match
|
||||
* with the type of the WireFeedGenerator.
|
||||
* @throws FeedException thrown if the XML Document could not be created.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ import com.sun.syndication.feed.opml.Outline;
|
|||
import com.sun.syndication.io.FeedException;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author cooper
|
||||
*/
|
||||
public class OPML20Generator extends OPML10Generator {
|
||||
|
@ -30,7 +30,7 @@ public class OPML20Generator extends OPML10Generator {
|
|||
/**
|
||||
* Returns the type of feed the generator creates.
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @return the type of feed the generator creates.
|
||||
* @see WireFeed for details on the format of this string.
|
||||
* <p>
|
||||
|
@ -43,10 +43,11 @@ public class OPML20Generator extends OPML10Generator {
|
|||
/**
|
||||
* Creates an XML document (JDOM) for the given feed bean.
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @param feed the feed bean to generate the XML document from.
|
||||
* @return the generated XML document (JDOM).
|
||||
* @throws IllegalArgumentException thrown if the type of the given feed bean does not match with the type of the WireFeedGenerator.
|
||||
* @throws IllegalArgumentException thrown if the type of the given feed bean does not match
|
||||
* with the type of the WireFeedGenerator.
|
||||
* @throws FeedException thrown if the XML Document could not be created.
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class OPML20Parser extends OPML10Parser {
|
|||
|
||||
if (e.getName().equals("opml")
|
||||
&& (e.getChild("head") != null && e.getChild("head").getChild("docs") != null || e.getAttributeValue("version") != null
|
||||
&& e.getAttributeValue("version").equals("2.0") || e.getChild("head") != null && e.getChild("head").getChild("ownerId") != null)) {
|
||||
&& e.getAttributeValue("version").equals("2.0") || e.getChild("head") != null && e.getChild("head").getChild("ownerId") != null)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ import com.sun.syndication.feed.synd.SyndFeed;
|
|||
import com.sun.syndication.feed.synd.SyndFeedImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* @author Alejandro Abdelnur
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class FeedOpsTest extends FeedTest {
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.sun.syndication;
|
|||
|
||||
/**
|
||||
* @author pat
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class SyndFeedTest extends FeedTest {
|
||||
private String _prefix = null;
|
||||
|
@ -29,100 +29,100 @@ public abstract class SyndFeedTest extends FeedTest {
|
|||
}
|
||||
|
||||
/*
|
||||
* public void testType() throws Exception { assertEquals(getPrefix(), getCachedSyndFeed().getFeedType()); }
|
||||
*
|
||||
* public void testTitle() throws Exception { assertEqualsStr("channel.title", getCachedSyndFeed().getTitle()); }
|
||||
*
|
||||
* public void testLink() throws Exception { assertEqualsStr("channel.link", getCachedSyndFeed().getLink()); }
|
||||
*
|
||||
* public void testDescription() throws Exception { assertEqualsStr("channel.description", getCachedSyndFeed().getDescription()); }
|
||||
*
|
||||
* public void testLanguage() throws Exception { assertEqualsStr("channel.language", getCachedSyndFeed().getLanguage()); }
|
||||
*
|
||||
* public void testCategories() throws Exception { List catlist = getCachedSyndFeed().getCategories(); //don't understand why this one fails assertEquals(2,
|
||||
* catlist.size()); SyndCategory cat = (SyndCategory)catlist.get(0); assertEqualsStr("channel.category[0]", cat.getName());
|
||||
* assertEqualsStr("channel.category[0]^domain", cat.getTaxonomyUri()); cat = (SyndCategory)catlist.get(1); assertEqualsStr("channel.category[1]",
|
||||
* cat.getName()); assertEqualsStr("channel.category[1]^domain", cat.getTaxonomyUri()); }
|
||||
*
|
||||
* public void testPublishedDate() throws Exception { assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getCachedSyndFeed().getPublishedDate()); }
|
||||
*
|
||||
* //how do i get height and width? public void testImage() throws Exception { SyndImage img = getCachedSyndFeed().getImage();
|
||||
* assertEqualsStr("channel.image.description", img.getDescription()); assertEqualsStr("channel.image.link", img.getLink());
|
||||
* assertEqualsStr("channel.image.title", img.getTitle()); assertEqualsStr("channel.image.url", img.getUrl()); }
|
||||
*
|
||||
* public void testEntries() throws Exception { List entrylist = getCachedSyndFeed().getEntries(); assertEquals(2, entrylist.size()); }
|
||||
*
|
||||
* public void testEntryTitle() throws Exception { assertEqualsStr("channel.item[0].title", getEntryTitle(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].title", getEntryTitle(getCachedSyndFeed().getEntries().get(1))); }
|
||||
*
|
||||
* public String getEntryTitle(Object o) throws Exception { SyndEntry e = (SyndEntry) o; return e.getTitle(); }
|
||||
*
|
||||
* public void testEntryDescription() throws Exception { assertEqualsStr("channel.item[0].description",
|
||||
* getEntryDescription(getCachedSyndFeed().getEntries().get(0))); assertEqualsStr("channel.item[1].description",
|
||||
* getEntryDescription(getCachedSyndFeed().getEntries().get(1))); }
|
||||
*
|
||||
* public String getEntryDescription(Object o) throws Exception { SyndEntry e = (SyndEntry) o; return e.getDescription().getValue(); }
|
||||
*
|
||||
* public void testEntryLink() throws Exception { assertEqualsStr("channel.item[0].link", getEntryLink(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].link", getEntryLink(getCachedSyndFeed().getEntries().get(1))); }
|
||||
*
|
||||
* public String getEntryLink(Object o) { SyndEntry e = (SyndEntry) o; return e.getLink(); }
|
||||
*
|
||||
* public void testEntryPublishedDate() throws Exception { assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getEntryPublishedDate(getCachedSyndFeed().getEntries().get(0))); assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getEntryPublishedDate(getCachedSyndFeed().getEntries().get(1))); }
|
||||
*
|
||||
* public Date getEntryPublishedDate(Object o) { SyndEntry e = (SyndEntry) o; return e.getPublishedDate(); }
|
||||
*
|
||||
* public void testEntryCategories() throws Exception { SyndEntry e = (SyndEntry)getCachedSyndFeed().getEntries().get(0); List catlist = e.getCategories();
|
||||
* //don't understand why this one fails assertEquals(2, catlist.size()); SyndCategory cat = (SyndCategory)catlist.get(0);
|
||||
* assertEqualsStr("channel.item[0].category[0]", cat.getName()); assertEqualsStr("channel.item[0].category[0]^domain", cat.getTaxonomyUri()); cat =
|
||||
* (SyndCategory)catlist.get(1); assertEqualsStr("channel.item[0].category[1]", cat.getName()); assertEqualsStr("channel.item[0].category[1]^domain",
|
||||
* cat.getTaxonomyUri()); //DO 2nd set of items }
|
||||
*
|
||||
* public void testEntryAuthor() throws Exception { assertEqualsStr("channel.item[0].author", getEntryAuthor(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].author", getEntryAuthor(getCachedSyndFeed().getEntries().get(1))); }
|
||||
*
|
||||
* public String getEntryAuthor(Object o) { SyndEntry e = (SyndEntry) o; return e.getAuthor(); }
|
||||
* public void testType() throws Exception { assertEquals(getPrefix(),
|
||||
* getCachedSyndFeed().getFeedType()); } public void testTitle() throws Exception {
|
||||
* assertEqualsStr("channel.title", getCachedSyndFeed().getTitle()); } public void testLink()
|
||||
* throws Exception { assertEqualsStr("channel.link", getCachedSyndFeed().getLink()); } public
|
||||
* void testDescription() throws Exception { assertEqualsStr("channel.description",
|
||||
* getCachedSyndFeed().getDescription()); } public void testLanguage() throws Exception {
|
||||
* assertEqualsStr("channel.language", getCachedSyndFeed().getLanguage()); } public void
|
||||
* testCategories() throws Exception { List catlist = getCachedSyndFeed().getCategories();
|
||||
* //don't understand why this one fails assertEquals(2, catlist.size()); SyndCategory cat =
|
||||
* (SyndCategory)catlist.get(0); assertEqualsStr("channel.category[0]", cat.getName());
|
||||
* assertEqualsStr("channel.category[0]^domain", cat.getTaxonomyUri()); cat =
|
||||
* (SyndCategory)catlist.get(1); assertEqualsStr("channel.category[1]", cat.getName());
|
||||
* assertEqualsStr("channel.category[1]^domain", cat.getTaxonomyUri()); } public void
|
||||
* testPublishedDate() throws Exception {
|
||||
* assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getCachedSyndFeed().getPublishedDate()); } //how do i get height and width? public void
|
||||
* testImage() throws Exception { SyndImage img = getCachedSyndFeed().getImage();
|
||||
* assertEqualsStr("channel.image.description", img.getDescription());
|
||||
* assertEqualsStr("channel.image.link", img.getLink()); assertEqualsStr("channel.image.title",
|
||||
* img.getTitle()); assertEqualsStr("channel.image.url", img.getUrl()); } public void
|
||||
* testEntries() throws Exception { List entrylist = getCachedSyndFeed().getEntries();
|
||||
* assertEquals(2, entrylist.size()); } public void testEntryTitle() throws Exception {
|
||||
* assertEqualsStr("channel.item[0].title",
|
||||
* getEntryTitle(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].title",
|
||||
* getEntryTitle(getCachedSyndFeed().getEntries().get(1))); } public String getEntryTitle(Object
|
||||
* o) throws Exception { SyndEntry e = (SyndEntry) o; return e.getTitle(); } public void
|
||||
* testEntryDescription() throws Exception { assertEqualsStr("channel.item[0].description",
|
||||
* getEntryDescription(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].description",
|
||||
* getEntryDescription(getCachedSyndFeed().getEntries().get(1))); } public String
|
||||
* getEntryDescription(Object o) throws Exception { SyndEntry e = (SyndEntry) o; return
|
||||
* e.getDescription().getValue(); } public void testEntryLink() throws Exception {
|
||||
* assertEqualsStr("channel.item[0].link",
|
||||
* getEntryLink(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].link",
|
||||
* getEntryLink(getCachedSyndFeed().getEntries().get(1))); } public String getEntryLink(Object
|
||||
* o) { SyndEntry e = (SyndEntry) o; return e.getLink(); } public void testEntryPublishedDate()
|
||||
* throws Exception { assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getEntryPublishedDate(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEquals(DateParser.parseRFC822("Mon, 01 Jan 2001 00:00:00 GMT"),
|
||||
* getEntryPublishedDate(getCachedSyndFeed().getEntries().get(1))); } public Date
|
||||
* getEntryPublishedDate(Object o) { SyndEntry e = (SyndEntry) o; return e.getPublishedDate(); }
|
||||
* public void testEntryCategories() throws Exception { SyndEntry e =
|
||||
* (SyndEntry)getCachedSyndFeed().getEntries().get(0); List catlist = e.getCategories(); //don't
|
||||
* understand why this one fails assertEquals(2, catlist.size()); SyndCategory cat =
|
||||
* (SyndCategory)catlist.get(0); assertEqualsStr("channel.item[0].category[0]", cat.getName());
|
||||
* assertEqualsStr("channel.item[0].category[0]^domain", cat.getTaxonomyUri()); cat =
|
||||
* (SyndCategory)catlist.get(1); assertEqualsStr("channel.item[0].category[1]", cat.getName());
|
||||
* assertEqualsStr("channel.item[0].category[1]^domain", cat.getTaxonomyUri()); //DO 2nd set of
|
||||
* items } public void testEntryAuthor() throws Exception {
|
||||
* assertEqualsStr("channel.item[0].author",
|
||||
* getEntryAuthor(getCachedSyndFeed().getEntries().get(0)));
|
||||
* assertEqualsStr("channel.item[1].author",
|
||||
* getEntryAuthor(getCachedSyndFeed().getEntries().get(1))); } public String
|
||||
* getEntryAuthor(Object o) { SyndEntry e = (SyndEntry) o; return e.getAuthor(); }
|
||||
*/
|
||||
/*
|
||||
* //things you cannot get from SyndEntryImpl // <source url="http://localhost:8080/item0/source.url">item[0].source</source> // <enclosure
|
||||
* url="http://localhost:8080/item0/enclosure0.url" length="100" type="audio/mpeg"/> // <enclosure url="http://localhost:8080/item0/enclosure1.url"
|
||||
* length="1000" type="audio/mpeg"/> <category domain="item0.domain0">item0.category0</category> <category domain="item0.domain1">item0.category1</category>
|
||||
* <pubDate>Thu, 08 Jul 1999 08:00:00 GMT</pubDate> <expirationDate>Thu, 08 Jul 1999 09:00:00 GMT</.expirationDate> <author>item0.author</author>
|
||||
* <comments>http://localhost:8080/item0/comments</comments> <guid isPermaLink="true">http://localhost:8080/item0/guid</guid> //TODO: I still have the
|
||||
* elements to test
|
||||
* //things you cannot get from SyndEntryImpl // <source
|
||||
* url="http://localhost:8080/item0/source.url">item[0].source</source> // <enclosure
|
||||
* url="http://localhost:8080/item0/enclosure0.url" length="100" type="audio/mpeg"/> //
|
||||
* <enclosure url="http://localhost:8080/item0/enclosure1.url" length="1000" type="audio/mpeg"/>
|
||||
* <category domain="item0.domain0">item0.category0</category> <category
|
||||
* domain="item0.domain1">item0.category1</category> <pubDate>Thu, 08 Jul 1999 08:00:00
|
||||
* GMT</pubDate> <expirationDate>Thu, 08 Jul 1999 09:00:00 GMT</.expirationDate>
|
||||
* <author>item0.author</author> <comments>http://localhost:8080/item0/comments</comments> <guid
|
||||
* isPermaLink="true">http://localhost:8080/item0/guid</guid> //TODO: I still have the elements
|
||||
* to test
|
||||
*/
|
||||
/*
|
||||
* public void test() { assertEqualsStr(feed, ""); }
|
||||
*
|
||||
* public void test() { assertEqualsStr(feed, ""); }
|
||||
* public void test() { assertEqualsStr(feed, ""); } public void test() { assertEqualsStr(feed,
|
||||
* ""); }
|
||||
*/
|
||||
// Things that you cannot get form a SyndFeedImpl today
|
||||
// these need to be put in a RSS 2.0 module
|
||||
// or is a roundtrip to wirefeed the right way to do this?
|
||||
/*
|
||||
* <textInput> <title>Search</title> <description>Search this site:</description> <name>q</name> <link>http://example.org/mt/mt-search.cgi</link>
|
||||
* </textInput>
|
||||
*
|
||||
* image height and width
|
||||
*
|
||||
* //<copyright>Copyright 2004, Mark Pilgrim</copyright> public void test() { assertEqualsStr(getCachedSyndFeed()., ""); }
|
||||
*
|
||||
* //<generator>Sample Toolkit</generator> public void test() { assertEqualsStr(feed, ""); }
|
||||
*
|
||||
* // <managingEditor>editor@example.org</managingEditor> public void test() { assertEqualsStr(feed, ""); }
|
||||
*
|
||||
* // <webMaster>webmaster@example.org</webMaster> public void test() { assertEqualsStr(feed, ""); }
|
||||
*
|
||||
* <docs>http://blogs.law.harvard.edu/tech/rss</docs> <cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/>
|
||||
* <ttl>60</ttl> <rating></rating>
|
||||
*
|
||||
* <skiphours> <hour>0</hour> <hour>1</hour> <hour>2</hour> <hour>3</hour> <hour>4</hour> <hour>5</hour> <hour>6</hour> <hour>7</hour> <hour>8</hour>
|
||||
* <hour>9.5</hour> <hour>10</hour> <hour>11</hour> <hour>12</hour> <hour>13</hour> <hour>14</hour> <hour>15</hour> <hour>16</hour> <hour>17</hour>
|
||||
* <hour>18</hour> <hour>19</hour> <hour>20</hour> <hour>21</hour> <hour>22</hour> <hour>23</hour> </skiphours> <skipdays> <day>Monday</day>
|
||||
* <day>Tuesday</day> <day>Wednesday</day> <day>Thursday</day> <day>Friday</day> <day>Saturday</day> <day>Sunday</day> </skipdays>
|
||||
* <textInput> <title>Search</title> <description>Search this site:</description> <name>q</name>
|
||||
* <link>http://example.org/mt/mt-search.cgi</link> </textInput> image height and width
|
||||
* //<copyright>Copyright 2004, Mark Pilgrim</copyright> public void test() {
|
||||
* assertEqualsStr(getCachedSyndFeed()., ""); } //<generator>Sample Toolkit</generator> public
|
||||
* void test() { assertEqualsStr(feed, ""); } //
|
||||
* <managingEditor>editor@example.org</managingEditor> public void test() {
|
||||
* assertEqualsStr(feed, ""); } // <webMaster>webmaster@example.org</webMaster> public void
|
||||
* test() { assertEqualsStr(feed, ""); } <docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
* <cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe"
|
||||
* protocol="soap"/> <ttl>60</ttl> <rating></rating> <skiphours> <hour>0</hour> <hour>1</hour>
|
||||
* <hour>2</hour> <hour>3</hour> <hour>4</hour> <hour>5</hour> <hour>6</hour> <hour>7</hour>
|
||||
* <hour>8</hour> <hour>9.5</hour> <hour>10</hour> <hour>11</hour> <hour>12</hour>
|
||||
* <hour>13</hour> <hour>14</hour> <hour>15</hour> <hour>16</hour> <hour>17</hour>
|
||||
* <hour>18</hour> <hour>19</hour> <hour>20</hour> <hour>21</hour> <hour>22</hour>
|
||||
* <hour>23</hour> </skiphours> <skipdays> <day>Monday</day> <day>Tuesday</day>
|
||||
* <day>Wednesday</day> <day>Thursday</day> <day>Friday</day> <day>Saturday</day>
|
||||
* <day>Sunday</day> </skipdays>
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.sun.syndication.feed.synd.SyndFeed;
|
|||
import com.sun.syndication.feed.synd.SyndFeedImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author cooper
|
||||
*/
|
||||
public class TestOpsOPML10 extends FeedOpsTest {
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.sun.syndication.test.NullWriter;
|
|||
import com.sun.syndication.test.TestUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author cooper
|
||||
*/
|
||||
public class TestOpsOPML10links extends FeedOpsTest {
|
||||
|
|
|
@ -17,7 +17,7 @@ import com.sun.syndication.feed.synd.SyndFeed;
|
|||
import com.sun.syndication.feed.synd.SyndFeedImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author cooper
|
||||
*/
|
||||
public class TestOpsOPML20 extends FeedOpsTest {
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.sun.syndication.io.impl.XmlFixerReader;
|
|||
|
||||
/**
|
||||
* @author pat, tucu
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TestXmlFixerReader extends TestCase {
|
||||
private static final String XML_PROLOG = "<?xml version=\"1.0\" ?>";
|
||||
|
|
Loading…
Reference in a new issue