Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

replace org.junit.Assert.assertThat by org.hamcrest.MatcherAssert.assertThat from hamcrest 2.2 to avoid deprecation-warning

sgaebeldd9d4b118884
diff --git a/.classpath b/.classpath
index b6616161c..805065059 100644
--- a/.classpath
+++ b/.classpath
@@ -106,5 +106,8 @@
<classpathentry kind="lib" path="lib/jwat-warc-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-collections4-4.1.jar"/>
<classpathentry kind="lib" path="lib/jaudiotagger-2.2.5.jar"/>
+ <classpathentry kind="lib" path="libt/hamcrest-2.2.jar"/>
+ <classpathentry kind="lib" path="libt/hamcrest-core-2.2.jar"/>
+ <classpathentry kind="lib" path="libt/hamcrest-library-2.2.jar"/>
<classpathentry kind="output" path="gen"/>
</classpath>
diff --git a/htroot/ConfigParser_p.java b/htroot/ConfigParser_p.java
index 6eef69fe7..1294cfba4 100644
--- a/htroot/ConfigParser_p.java
+++ b/htroot/ConfigParser_p.java
@@ -37,7 +37,7 @@ import net.yacy.server.serverSwitch;
public class ConfigParser_p {
- public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
+ public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
final Switchboard sb = (Switchboard) env;
diff --git a/htroot/IndexImportWarc_p.java b/htroot/IndexImportWarc_p.java
index ff88a5fc9..1af76d147 100644
--- a/htroot/IndexImportWarc_p.java
+++ b/htroot/IndexImportWarc_p.java
@@ -20,20 +20,18 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
+
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.protocol.ClientIdentification;
-
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.document.importer.WarcImporter;
-import net.yacy.search.Switchboard;
import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch;
public class IndexImportWarc_p {
- public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
+ public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, @SuppressWarnings("unused") final serverSwitch env) {
final serverObjects prop = new serverObjects();
- final Switchboard sb = (Switchboard) env;
if (WarcImporter.job != null && WarcImporter.job.isAlive()) {
// one import is running, no option to insert anything
diff --git a/htroot/TransNews_p.java b/htroot/TransNews_p.java
index 596e99084..323a1f004 100644
--- a/htroot/TransNews_p.java
+++ b/htroot/TransNews_p.java
@@ -45,7 +45,7 @@ import net.yacy.utils.translation.TranslationManager;
public class TransNews_p {
- public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
+ public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, final serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects();
diff --git a/libt/hamcrest-2.2.jar b/libt/hamcrest-2.2.jar
new file mode 100644
index 000000000..71065788d
Binary files /dev/null and b/libt/hamcrest-2.2.jar differ
diff --git a/libt/hamcrest-core-1.3.jar b/libt/hamcrest-core-1.3.jar
deleted file mode 100644
index 9d5fe16e3..000000000
Binary files a/libt/hamcrest-core-1.3.jar and /dev/null differ
diff --git a/libt/hamcrest-core-2.2.jar b/libt/hamcrest-core-2.2.jar
new file mode 100644
index 000000000..3068f1dd8
Binary files /dev/null and b/libt/hamcrest-core-2.2.jar differ
diff --git a/libt/hamcrest-library-2.2.jar b/libt/hamcrest-library-2.2.jar
new file mode 100644
index 000000000..08bcfa004
Binary files /dev/null and b/libt/hamcrest-library-2.2.jar differ
diff --git a/libt/junit-4.11.jar b/libt/junit-4.11.jar
deleted file mode 100644
index aaf744484..000000000
Binary files a/libt/junit-4.11.jar and /dev/null differ
diff --git a/libt/junit-4.13.jar b/libt/junit-4.13.jar
new file mode 100644
index 000000000..acc3c4320
Binary files /dev/null and b/libt/junit-4.13.jar differ
diff --git a/pom.xml b/pom.xml
index 2b25883b0..3173e5a41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -351,12 +351,24 @@
</repositories>
<dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.13</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<!-- Optional dependency of pdfbox for Encrypting and signing PDFs
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index b82435a0c..b1f47fe0b 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -3915,7 +3915,7 @@ public final class Switchboard extends serverSwitch {
}
}
- public void initBookmarks(boolean b) {
+ public void initBookmarks(@SuppressWarnings("unused") boolean b) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
diff --git a/test/java/net/yacy/document/ParserTest.java b/test/java/net/yacy/document/ParserTest.java
index c78ca12f9..9bf49969b 100644
--- a/test/java/net/yacy/document/ParserTest.java
+++ b/test/java/net/yacy/document/ParserTest.java
@@ -1,5 +1,8 @@
package net.yacy.document;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -8,14 +11,14 @@ import java.io.InputStreamReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
+
+import org.junit.Test;
+
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.document.parser.docParser;
import net.yacy.document.parser.odtParser;
import net.yacy.document.parser.pdfParser;
import net.yacy.document.parser.pptParser;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertThat;
-import org.junit.Test;
public class ParserTest {
diff --git a/test/java/net/yacy/document/parser/ooxmlParserTest.java b/test/java/net/yacy/document/parser/ooxmlParserTest.java
index 953747394..f5cf79e47 100644
--- a/test/java/net/yacy/document/parser/ooxmlParserTest.java
+++ b/test/java/net/yacy/document/parser/ooxmlParserTest.java
@@ -23,9 +23,9 @@
package net.yacy.document.parser;
import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
+import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.File;
diff --git a/test/java/net/yacy/document/parser/xlsParserTest.java b/test/java/net/yacy/document/parser/xlsParserTest.java
index 804776379..1d719ddd7 100644
--- a/test/java/net/yacy/document/parser/xlsParserTest.java
+++ b/test/java/net/yacy/document/parser/xlsParserTest.java
@@ -1,17 +1,20 @@
package net.yacy.document.parser;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
+
+import org.junit.Test;
+
import net.yacy.cora.document.id.AnchorURL;
import net.yacy.document.AbstractParser;
import net.yacy.document.Document;
import net.yacy.document.VocabularyScraper;
-import static org.hamcrest.CoreMatchers.containsString;
-import org.junit.Test;
-import static org.junit.Assert.*;
public class xlsParserTest {