Fixed tests

This commit is contained in:
Patrick Gotthard 2013-10-07 22:11:49 +02:00
parent 14696ebed0
commit c702966daa
24 changed files with 78 additions and 41 deletions

12
pom.xml
View file

@ -163,18 +163,18 @@
</reporting> </reporting>
<dependencies> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.rometools</groupId> <groupId>org.rometools</groupId>
<artifactId>rome</artifactId> <artifactId>rome</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View file

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean; import com.sun.syndication.feed.impl.ToStringBean;

View file

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.feed.opml; package com.sun.syndication.feed.opml;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;

View file

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * 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.EqualsBean;
import com.sun.syndication.feed.impl.ToStringBean; import com.sun.syndication.feed.impl.ToStringBean;

View file

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.feed.synd.impl; package com.sun.syndication.feed.synd.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -25,9 +25,9 @@ import java.util.Stack;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;
import org.rometools.feed.opml.Attribute; import com.sun.syndication.feed.opml.Attribute;
import org.rometools.feed.opml.Opml; import com.sun.syndication.feed.opml.Opml;
import org.rometools.feed.opml.Outline; import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.feed.synd.Converter; import com.sun.syndication.feed.synd.Converter;
import com.sun.syndication.feed.synd.SyndCategory; import com.sun.syndication.feed.synd.SyndCategory;
import com.sun.syndication.feed.synd.SyndCategoryImpl; import com.sun.syndication.feed.synd.SyndCategoryImpl;

View file

@ -6,7 +6,7 @@
* To change this template, choose Tools | Template Manager * To change this template, choose Tools | Template Manager
* and open the template in the editor. * 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.WireFeed;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;

View file

@ -7,7 +7,7 @@
* and open the template in the editor. * 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.SyndCategory;
import com.sun.syndication.feed.synd.SyndCategoryImpl; import com.sun.syndication.feed.synd.SyndCategoryImpl;

View file

@ -15,12 +15,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.io.impl; package com.sun.syndication.io.impl;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;
import org.rometools.feed.opml.Attribute; import com.sun.syndication.feed.opml.Attribute;
import org.rometools.feed.opml.Opml; import com.sun.syndication.feed.opml.Opml;
import org.rometools.feed.opml.Outline; import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.WireFeedGenerator; import com.sun.syndication.io.WireFeedGenerator;
import com.sun.syndication.io.impl.BaseWireFeedGenerator; import com.sun.syndication.io.impl.BaseWireFeedGenerator;

View file

@ -15,12 +15,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.io.impl; package com.sun.syndication.io.impl;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;
import org.rometools.feed.opml.Attribute; import com.sun.syndication.feed.opml.Attribute;
import org.rometools.feed.opml.Opml; import com.sun.syndication.feed.opml.Opml;
import org.rometools.feed.opml.Outline; import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.WireFeedParser; import com.sun.syndication.io.WireFeedParser;
import com.sun.syndication.io.impl.BaseWireFeedParser; import com.sun.syndication.io.impl.BaseWireFeedParser;

View file

@ -6,11 +6,11 @@
* To change this template, choose Tools | Template Manager * To change this template, choose Tools | Template Manager
* and open the template in the editor. * 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 com.sun.syndication.feed.WireFeed;
import org.rometools.feed.opml.Opml; import com.sun.syndication.feed.opml.Opml;
import org.rometools.feed.opml.Outline; import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.impl.DateParser; import com.sun.syndication.io.impl.DateParser;

View file

@ -15,12 +15,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.rometools.io.impl; package com.sun.syndication.io.impl;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;
import org.rometools.feed.opml.Attribute; import com.sun.syndication.feed.opml.Attribute;
import org.rometools.feed.opml.Opml; import com.sun.syndication.feed.opml.Opml;
import org.rometools.feed.opml.Outline; import com.sun.syndication.feed.opml.Outline;
import com.sun.syndication.io.FeedException; import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.impl.DateParser; import com.sun.syndication.io.impl.DateParser;

View file

@ -1,4 +1,4 @@
package org.rometools.unittest; package com.sun.syndication;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;

View file

@ -1,4 +1,4 @@
package org.rometools.unittest; package com.sun.syndication;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;

View file

@ -4,7 +4,7 @@
* TODO To change the template for this generated file go to * TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Generation - Code and Comments * Window - Preferences - Java - Code Generation - Code and Comments
*/ */
package org.rometools.unittest; package com.sun.syndication;
/** /**
* @author pat * @author pat

View file

@ -7,7 +7,7 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
package org.rometools.unittest; package com.sun.syndication;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;

View file

@ -7,12 +7,14 @@
* and open the template in the editor. * 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.FileOutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import test.NullWriter;
import test.TestUtil;
import com.sun.syndication.feed.WireFeed; import com.sun.syndication.feed.WireFeed;
import com.sun.syndication.feed.synd.SyndFeed; import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl; import com.sun.syndication.feed.synd.SyndFeedImpl;
@ -48,7 +50,7 @@ public class TestOpsOPML10links extends FeedOpsTest {
public void testTemp() throws Exception { public void testTemp() throws Exception {
final WireFeedInput input = new WireFeedInput(); 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 WireFeedOutput output = new WireFeedOutput();
final SyndFeedImpl sf = new SyndFeedImpl(wf); final SyndFeedImpl sf = new SyndFeedImpl(wf);
@ -56,7 +58,7 @@ public class TestOpsOPML10links extends FeedOpsTest {
sf.setDescription(""); sf.setDescription("");
sf.setLink("http://foo.com"); sf.setLink("http://foo.com");
sf.setFeedType("opml_1.0"); 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());
} }
} }

View file

@ -7,7 +7,7 @@
* and open the template in the editor. * and open the template in the editor.
*/ */
package org.rometools.unittest; package com.sun.syndication;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.unittest; package com.sun.syndication;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;

View file

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
* *
*/ */
package org.rometools.unittest; package com.sun.syndication;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;

View file

@ -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 {
}
}

View file

@ -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));
}
}