From c702966daaaca0ebdf2847d3370b81e47c3f1293 Mon Sep 17 00:00:00 2001 From: Patrick Gotthard Date: Mon, 7 Oct 2013 22:11:49 +0200 Subject: [PATCH] Fixed tests --- pom.xml | 12 +++++------ .../sun/syndication}/feed/opml/Attribute.java | 2 +- .../sun/syndication}/feed/opml/Opml.java | 2 +- .../sun/syndication}/feed/opml/Outline.java | 2 +- .../sun/syndication}/feed/opml/package.html | 0 .../feed/synd/impl/ConverterForOPML10.java | 8 ++++---- .../feed/synd/impl/ConverterForOPML20.java | 2 +- .../feed/synd/impl/TreeCategoryImpl.java | 2 +- .../syndication}/feed/synd/impl/package.html | 0 .../syndication}/io/impl/OPML10Generator.java | 8 ++++---- .../syndication}/io/impl/OPML10Parser.java | 8 ++++---- .../syndication}/io/impl/OPML20Generator.java | 6 +++--- .../syndication}/io/impl/OPML20Parser.java | 8 ++++---- .../sun/syndication}/io/impl/package.html | 0 .../sun/syndication}/FeedOpsTest.java | 2 +- .../sun/syndication}/FeedTest.java | 2 +- .../sun/syndication}/SyndFeedTest.java | 2 +- .../sun/syndication}/TestOpsOPML10.java | 2 +- .../sun/syndication}/TestOpsOPML10links.java | 10 ++++++---- .../sun/syndication}/TestOpsOPML20.java | 2 +- .../sun/syndication}/TestXmlFixerReader.java | 2 +- .../sun/syndication}/TestXmlReader.java | 2 +- src/test/java/test/NullWriter.java | 20 +++++++++++++++++++ src/test/java/test/TestUtil.java | 15 ++++++++++++++ 24 files changed, 78 insertions(+), 41 deletions(-) rename src/main/java/{org/rometools => com/sun/syndication}/feed/opml/Attribute.java (98%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/opml/Opml.java (99%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/opml/Outline.java (99%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/opml/package.html (100%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/synd/impl/ConverterForOPML10.java (98%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/synd/impl/ConverterForOPML20.java (97%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/synd/impl/TreeCategoryImpl.java (94%) rename src/main/java/{org/rometools => com/sun/syndication}/feed/synd/impl/package.html (100%) rename src/main/java/{org/rometools => com/sun/syndication}/io/impl/OPML10Generator.java (97%) rename src/main/java/{org/rometools => com/sun/syndication}/io/impl/OPML10Parser.java (98%) rename src/main/java/{org/rometools => com/sun/syndication}/io/impl/OPML20Generator.java (94%) rename src/main/java/{org/rometools => com/sun/syndication}/io/impl/OPML20Parser.java (95%) rename src/main/java/{org/rometools => com/sun/syndication}/io/impl/package.html (100%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/FeedOpsTest.java (99%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/FeedTest.java (98%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/SyndFeedTest.java (99%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/TestOpsOPML10.java (97%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/TestOpsOPML10links.java (84%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/TestOpsOPML20.java (97%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/TestXmlFixerReader.java (99%) rename src/test/java/{org/rometools/unittest => com/sun/syndication}/TestXmlReader.java (99%) create mode 100644 src/test/java/test/NullWriter.java create mode 100644 src/test/java/test/TestUtil.java diff --git a/pom.xml b/pom.xml index 6aca63a..d7bce29 100644 --- a/pom.xml +++ b/pom.xml @@ -163,18 +163,18 @@ - - junit - junit - 4.11 - test - org.rometools rome 2.0.0-SNAPSHOT compile + + junit + junit + 4.11 + test + diff --git a/src/main/java/org/rometools/feed/opml/Attribute.java b/src/main/java/com/sun/syndication/feed/opml/Attribute.java similarity index 98% rename from src/main/java/org/rometools/feed/opml/Attribute.java rename to src/main/java/com/sun/syndication/feed/opml/Attribute.java index 934b106..a90662c 100644 --- a/src/main/java/org/rometools/feed/opml/Attribute.java +++ b/src/main/java/com/sun/syndication/feed/opml/Attribute.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.feed.opml; +package com.sun.syndication.feed.opml; import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.ToStringBean; diff --git a/src/main/java/org/rometools/feed/opml/Opml.java b/src/main/java/com/sun/syndication/feed/opml/Opml.java similarity index 99% rename from src/main/java/org/rometools/feed/opml/Opml.java rename to src/main/java/com/sun/syndication/feed/opml/Opml.java index 2773b0e..5e0e965 100644 --- a/src/main/java/org/rometools/feed/opml/Opml.java +++ b/src/main/java/com/sun/syndication/feed/opml/Opml.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.feed.opml; +package com.sun.syndication.feed.opml; import com.sun.syndication.feed.WireFeed; diff --git a/src/main/java/org/rometools/feed/opml/Outline.java b/src/main/java/com/sun/syndication/feed/opml/Outline.java similarity index 99% rename from src/main/java/org/rometools/feed/opml/Outline.java rename to src/main/java/com/sun/syndication/feed/opml/Outline.java index 691f764..950cd77 100644 --- a/src/main/java/org/rometools/feed/opml/Outline.java +++ b/src/main/java/com/sun/syndication/feed/opml/Outline.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.feed.opml; +package com.sun.syndication.feed.opml; import com.sun.syndication.feed.impl.EqualsBean; import com.sun.syndication.feed.impl.ToStringBean; diff --git a/src/main/java/org/rometools/feed/opml/package.html b/src/main/java/com/sun/syndication/feed/opml/package.html similarity index 100% rename from src/main/java/org/rometools/feed/opml/package.html rename to src/main/java/com/sun/syndication/feed/opml/package.html diff --git a/src/main/java/org/rometools/feed/synd/impl/ConverterForOPML10.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML10.java similarity index 98% rename from src/main/java/org/rometools/feed/synd/impl/ConverterForOPML10.java rename to src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML10.java index 110418f..74ba153 100644 --- a/src/main/java/org/rometools/feed/synd/impl/ConverterForOPML10.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML10.java @@ -15,7 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.feed.synd.impl; +package com.sun.syndication.feed.synd.impl; import java.util.ArrayList; import java.util.Collections; @@ -25,9 +25,9 @@ import java.util.Stack; import java.util.logging.Logger; import com.sun.syndication.feed.WireFeed; -import org.rometools.feed.opml.Attribute; -import org.rometools.feed.opml.Opml; -import org.rometools.feed.opml.Outline; +import com.sun.syndication.feed.opml.Attribute; +import com.sun.syndication.feed.opml.Opml; +import com.sun.syndication.feed.opml.Outline; import com.sun.syndication.feed.synd.Converter; import com.sun.syndication.feed.synd.SyndCategory; import com.sun.syndication.feed.synd.SyndCategoryImpl; diff --git a/src/main/java/org/rometools/feed/synd/impl/ConverterForOPML20.java b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML20.java similarity index 97% rename from src/main/java/org/rometools/feed/synd/impl/ConverterForOPML20.java rename to src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML20.java index d053bc7..53e5d9b 100644 --- a/src/main/java/org/rometools/feed/synd/impl/ConverterForOPML20.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/ConverterForOPML20.java @@ -6,7 +6,7 @@ * To change this template, choose Tools | Template Manager * and open the template in the editor. */ -package org.rometools.feed.synd.impl; +package com.sun.syndication.feed.synd.impl; import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.synd.SyndFeed; diff --git a/src/main/java/org/rometools/feed/synd/impl/TreeCategoryImpl.java b/src/main/java/com/sun/syndication/feed/synd/impl/TreeCategoryImpl.java similarity index 94% rename from src/main/java/org/rometools/feed/synd/impl/TreeCategoryImpl.java rename to src/main/java/com/sun/syndication/feed/synd/impl/TreeCategoryImpl.java index 8faea35..02ced72 100644 --- a/src/main/java/org/rometools/feed/synd/impl/TreeCategoryImpl.java +++ b/src/main/java/com/sun/syndication/feed/synd/impl/TreeCategoryImpl.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package org.rometools.feed.synd.impl; +package com.sun.syndication.feed.synd.impl; import com.sun.syndication.feed.synd.SyndCategory; import com.sun.syndication.feed.synd.SyndCategoryImpl; diff --git a/src/main/java/org/rometools/feed/synd/impl/package.html b/src/main/java/com/sun/syndication/feed/synd/impl/package.html similarity index 100% rename from src/main/java/org/rometools/feed/synd/impl/package.html rename to src/main/java/com/sun/syndication/feed/synd/impl/package.html diff --git a/src/main/java/org/rometools/io/impl/OPML10Generator.java b/src/main/java/com/sun/syndication/io/impl/OPML10Generator.java similarity index 97% rename from src/main/java/org/rometools/io/impl/OPML10Generator.java rename to src/main/java/com/sun/syndication/io/impl/OPML10Generator.java index 2246c1f..ca3b0d3 100644 --- a/src/main/java/org/rometools/io/impl/OPML10Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/OPML10Generator.java @@ -15,12 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.io.impl; +package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; -import org.rometools.feed.opml.Attribute; -import org.rometools.feed.opml.Opml; -import org.rometools.feed.opml.Outline; +import com.sun.syndication.feed.opml.Attribute; +import com.sun.syndication.feed.opml.Opml; +import com.sun.syndication.feed.opml.Outline; import com.sun.syndication.io.FeedException; import com.sun.syndication.io.WireFeedGenerator; import com.sun.syndication.io.impl.BaseWireFeedGenerator; diff --git a/src/main/java/org/rometools/io/impl/OPML10Parser.java b/src/main/java/com/sun/syndication/io/impl/OPML10Parser.java similarity index 98% rename from src/main/java/org/rometools/io/impl/OPML10Parser.java rename to src/main/java/com/sun/syndication/io/impl/OPML10Parser.java index 16be175..d40082a 100644 --- a/src/main/java/org/rometools/io/impl/OPML10Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/OPML10Parser.java @@ -15,12 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.io.impl; +package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; -import org.rometools.feed.opml.Attribute; -import org.rometools.feed.opml.Opml; -import org.rometools.feed.opml.Outline; +import com.sun.syndication.feed.opml.Attribute; +import com.sun.syndication.feed.opml.Opml; +import com.sun.syndication.feed.opml.Outline; import com.sun.syndication.io.FeedException; import com.sun.syndication.io.WireFeedParser; import com.sun.syndication.io.impl.BaseWireFeedParser; diff --git a/src/main/java/org/rometools/io/impl/OPML20Generator.java b/src/main/java/com/sun/syndication/io/impl/OPML20Generator.java similarity index 94% rename from src/main/java/org/rometools/io/impl/OPML20Generator.java rename to src/main/java/com/sun/syndication/io/impl/OPML20Generator.java index d1122b7..3034d01 100644 --- a/src/main/java/org/rometools/io/impl/OPML20Generator.java +++ b/src/main/java/com/sun/syndication/io/impl/OPML20Generator.java @@ -6,11 +6,11 @@ * To change this template, choose Tools | Template Manager * and open the template in the editor. */ -package org.rometools.io.impl; +package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; -import org.rometools.feed.opml.Opml; -import org.rometools.feed.opml.Outline; +import com.sun.syndication.feed.opml.Opml; +import com.sun.syndication.feed.opml.Outline; import com.sun.syndication.io.FeedException; import com.sun.syndication.io.impl.DateParser; diff --git a/src/main/java/org/rometools/io/impl/OPML20Parser.java b/src/main/java/com/sun/syndication/io/impl/OPML20Parser.java similarity index 95% rename from src/main/java/org/rometools/io/impl/OPML20Parser.java rename to src/main/java/com/sun/syndication/io/impl/OPML20Parser.java index 28ed5b2..e53cc6a 100644 --- a/src/main/java/org/rometools/io/impl/OPML20Parser.java +++ b/src/main/java/com/sun/syndication/io/impl/OPML20Parser.java @@ -15,12 +15,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.rometools.io.impl; +package com.sun.syndication.io.impl; import com.sun.syndication.feed.WireFeed; -import org.rometools.feed.opml.Attribute; -import org.rometools.feed.opml.Opml; -import org.rometools.feed.opml.Outline; +import com.sun.syndication.feed.opml.Attribute; +import com.sun.syndication.feed.opml.Opml; +import com.sun.syndication.feed.opml.Outline; import com.sun.syndication.io.FeedException; import com.sun.syndication.io.impl.DateParser; diff --git a/src/main/java/org/rometools/io/impl/package.html b/src/main/java/com/sun/syndication/io/impl/package.html similarity index 100% rename from src/main/java/org/rometools/io/impl/package.html rename to src/main/java/com/sun/syndication/io/impl/package.html diff --git a/src/test/java/org/rometools/unittest/FeedOpsTest.java b/src/test/java/com/sun/syndication/FeedOpsTest.java similarity index 99% rename from src/test/java/org/rometools/unittest/FeedOpsTest.java rename to src/test/java/com/sun/syndication/FeedOpsTest.java index 24c322e..2e1ddb0 100644 --- a/src/test/java/org/rometools/unittest/FeedOpsTest.java +++ b/src/test/java/com/sun/syndication/FeedOpsTest.java @@ -1,4 +1,4 @@ -package org.rometools.unittest; +package com.sun.syndication; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/org/rometools/unittest/FeedTest.java b/src/test/java/com/sun/syndication/FeedTest.java similarity index 98% rename from src/test/java/org/rometools/unittest/FeedTest.java rename to src/test/java/com/sun/syndication/FeedTest.java index 70552f1..2f6032b 100644 --- a/src/test/java/org/rometools/unittest/FeedTest.java +++ b/src/test/java/com/sun/syndication/FeedTest.java @@ -1,4 +1,4 @@ -package org.rometools.unittest; +package com.sun.syndication; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/src/test/java/org/rometools/unittest/SyndFeedTest.java b/src/test/java/com/sun/syndication/SyndFeedTest.java similarity index 99% rename from src/test/java/org/rometools/unittest/SyndFeedTest.java rename to src/test/java/com/sun/syndication/SyndFeedTest.java index 6686fcf..4fc0033 100644 --- a/src/test/java/org/rometools/unittest/SyndFeedTest.java +++ b/src/test/java/com/sun/syndication/SyndFeedTest.java @@ -4,7 +4,7 @@ * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ -package org.rometools.unittest; +package com.sun.syndication; /** * @author pat diff --git a/src/test/java/org/rometools/unittest/TestOpsOPML10.java b/src/test/java/com/sun/syndication/TestOpsOPML10.java similarity index 97% rename from src/test/java/org/rometools/unittest/TestOpsOPML10.java rename to src/test/java/com/sun/syndication/TestOpsOPML10.java index a796dd6..7c4691d 100644 --- a/src/test/java/org/rometools/unittest/TestOpsOPML10.java +++ b/src/test/java/com/sun/syndication/TestOpsOPML10.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package org.rometools.unittest; +package com.sun.syndication; import java.io.FileOutputStream; import java.io.PrintWriter; diff --git a/src/test/java/org/rometools/unittest/TestOpsOPML10links.java b/src/test/java/com/sun/syndication/TestOpsOPML10links.java similarity index 84% rename from src/test/java/org/rometools/unittest/TestOpsOPML10links.java rename to src/test/java/com/sun/syndication/TestOpsOPML10links.java index 1b9b143..202a342 100644 --- a/src/test/java/org/rometools/unittest/TestOpsOPML10links.java +++ b/src/test/java/com/sun/syndication/TestOpsOPML10links.java @@ -7,12 +7,14 @@ * and open the template in the editor. */ -package org.rometools.unittest; +package com.sun.syndication; -import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; +import test.NullWriter; +import test.TestUtil; + import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeedImpl; @@ -48,7 +50,7 @@ public class TestOpsOPML10links extends FeedOpsTest { public void testTemp() throws Exception { final WireFeedInput input = new WireFeedInput(); - final WireFeed wf = input.build(new File(System.getProperty("basedir") + "/src/test/resources/opml_1.0_links.xml")); + final WireFeed wf = input.build(TestUtil.loadFile("/opml_1.0_links.xml")); final WireFeedOutput output = new WireFeedOutput(); final SyndFeedImpl sf = new SyndFeedImpl(wf); @@ -56,7 +58,7 @@ public class TestOpsOPML10links extends FeedOpsTest { sf.setDescription(""); sf.setLink("http://foo.com"); sf.setFeedType("opml_1.0"); - output.output(sf.createWireFeed(), new File(System.getProperty("basedir") + "/target/test-reports/1.xml")); + output.output(sf.createWireFeed(), new NullWriter()); } } diff --git a/src/test/java/org/rometools/unittest/TestOpsOPML20.java b/src/test/java/com/sun/syndication/TestOpsOPML20.java similarity index 97% rename from src/test/java/org/rometools/unittest/TestOpsOPML20.java rename to src/test/java/com/sun/syndication/TestOpsOPML20.java index 74d58e1..cd219cb 100644 --- a/src/test/java/org/rometools/unittest/TestOpsOPML20.java +++ b/src/test/java/com/sun/syndication/TestOpsOPML20.java @@ -7,7 +7,7 @@ * and open the template in the editor. */ -package org.rometools.unittest; +package com.sun.syndication; import java.io.FileOutputStream; import java.io.PrintWriter; diff --git a/src/test/java/org/rometools/unittest/TestXmlFixerReader.java b/src/test/java/com/sun/syndication/TestXmlFixerReader.java similarity index 99% rename from src/test/java/org/rometools/unittest/TestXmlFixerReader.java rename to src/test/java/com/sun/syndication/TestXmlFixerReader.java index f232f34..c44a910 100644 --- a/src/test/java/org/rometools/unittest/TestXmlFixerReader.java +++ b/src/test/java/com/sun/syndication/TestXmlFixerReader.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package org.rometools.unittest; +package com.sun.syndication; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/org/rometools/unittest/TestXmlReader.java b/src/test/java/com/sun/syndication/TestXmlReader.java similarity index 99% rename from src/test/java/org/rometools/unittest/TestXmlReader.java rename to src/test/java/com/sun/syndication/TestXmlReader.java index 9b335fd..3b2d3af 100644 --- a/src/test/java/org/rometools/unittest/TestXmlReader.java +++ b/src/test/java/com/sun/syndication/TestXmlReader.java @@ -14,7 +14,7 @@ * limitations under the License. * */ -package org.rometools.unittest; +package com.sun.syndication; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/test/java/test/NullWriter.java b/src/test/java/test/NullWriter.java new file mode 100644 index 0000000..4039735 --- /dev/null +++ b/src/test/java/test/NullWriter.java @@ -0,0 +1,20 @@ +package test; + +import java.io.IOException; +import java.io.Writer; + +public class NullWriter extends Writer { + + @Override + public void write(final char[] cbuf, final int off, final int len) throws IOException { + } + + @Override + public void flush() throws IOException { + } + + @Override + public void close() throws IOException { + } + +} diff --git a/src/test/java/test/TestUtil.java b/src/test/java/test/TestUtil.java new file mode 100644 index 0000000..d2b3842 --- /dev/null +++ b/src/test/java/test/TestUtil.java @@ -0,0 +1,15 @@ +package test; + +import java.io.InputStreamReader; +import java.io.Reader; + +public final class TestUtil { + + private TestUtil() { + } + + public static Reader loadFile(final String path) { + return new InputStreamReader(TestUtil.class.getResourceAsStream(path)); + } + +}