From fc03c4b4fed389f92b0ccceb427f6c4bc18f0aef Mon Sep 17 00:00:00 2001 From: sgaebel Date: Sun, 2 Aug 2020 20:14:56 +0200 Subject: removes some warning and unused objects --- test/java/net/yacy/cora/document/feed/RSSFeedTest.java | 6 +++--- .../net/yacy/cora/document/id/DigestURLHashPerfTest.java | 2 +- test/java/net/yacy/search/ranking/ReferenceOrderTest.java | 12 +++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/java/net/yacy/cora/document/feed/RSSFeedTest.java b/test/java/net/yacy/cora/document/feed/RSSFeedTest.java index 287e3de87..782feb821 100644 --- a/test/java/net/yacy/cora/document/feed/RSSFeedTest.java +++ b/test/java/net/yacy/cora/document/feed/RSSFeedTest.java @@ -1,8 +1,8 @@ package net.yacy.cora.document.feed; -import java.io.IOException; +import static org.junit.Assert.assertNotNull; + import org.junit.Test; -import static org.junit.Assert.*; public class RSSFeedTest { @@ -10,7 +10,7 @@ public class RSSFeedTest { * Test of getChannel method, of class RSSFeed. */ @Test - public void testGetChannel() throws IOException { + public void testGetChannel() { RSSFeed feed = new RSSFeed(Integer.MAX_VALUE); // channel is required in RSS 2.0 and accessed in code w/o != null checks diff --git a/test/java/net/yacy/cora/document/id/DigestURLHashPerfTest.java b/test/java/net/yacy/cora/document/id/DigestURLHashPerfTest.java index b2df145e4..f4a913429 100644 --- a/test/java/net/yacy/cora/document/id/DigestURLHashPerfTest.java +++ b/test/java/net/yacy/cora/document/id/DigestURLHashPerfTest.java @@ -62,7 +62,7 @@ public class DigestURLHashPerfTest { System.out.println(urls.size() + " URLs loaded from " + inFile.getAbsolutePath()); - try (OutputStream outStream = args.length >= 2 ? new FileOutputStream(args[1]) : new NullOutputStream(); + try (OutputStream outStream = args.length >= 2 ? new FileOutputStream(args[1]) : NullOutputStream.NULL_OUTPUT_STREAM; OutputStreamWriter writer = new OutputStreamWriter(outStream, StandardCharsets.UTF_8.name()); BufferedWriter out = new BufferedWriter(writer);) { diff --git a/test/java/net/yacy/search/ranking/ReferenceOrderTest.java b/test/java/net/yacy/search/ranking/ReferenceOrderTest.java index 45036de3e..d8c767d0d 100644 --- a/test/java/net/yacy/search/ranking/ReferenceOrderTest.java +++ b/test/java/net/yacy/search/ranking/ReferenceOrderTest.java @@ -1,16 +1,18 @@ package net.yacy.search.ranking; +import static org.junit.Assert.assertTrue; + import java.io.File; import java.io.IOException; import java.net.MalformedURLException; + +import org.apache.solr.common.SolrInputDocument; +import org.junit.Test; + import net.yacy.cora.document.analysis.Classification; import net.yacy.cora.document.id.DigestURL; -import net.yacy.cora.util.SpaceExceededException; import net.yacy.kelondro.data.meta.URIMetadataNode; import net.yacy.search.schema.CollectionConfiguration; -import org.apache.solr.common.SolrInputDocument; -import static org.junit.Assert.assertTrue; -import org.junit.Test; public class ReferenceOrderTest { @@ -20,7 +22,7 @@ public class ReferenceOrderTest { * (only used if no Solr score supplied) */ @Test - public void testCardinal_URIMetadataNode() throws MalformedURLException, IOException, SpaceExceededException { + public void testCardinal_URIMetadataNode() throws MalformedURLException, IOException { File config = new File("defaults/solr.collection.schema"); CollectionConfiguration cc = new CollectionConfiguration(config, true); -- cgit v1.2.3