Remove uses of junit, closes #2133
This commit is contained in:
parent
46acc21a43
commit
29f3cef3ec
@ -1,6 +1,6 @@
|
||||
package org.openrefine.wikidata.commands;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.commands;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.openrefine.wikidata.testing.TestingData.jsonFromFile;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.commands;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.openrefine.wikidata.testing.TestingData.jsonFromFile;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.commands;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.editing;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.editing;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.editing;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.openrefine.wikidata.testing.TestingData;
|
||||
import org.openrefine.wikidata.updates.ItemUpdate;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.exporters;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.exporters;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.operations;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.LineNumberReader;
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.operations;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
||||
import java.io.LineNumberReader;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.qa;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.openrefine.wikidata.testing.JacksonSerializationTest;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.qa;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import org.openrefine.wikidata.testing.JacksonSerializationTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
@ -23,8 +23,8 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.qa.scrutinizers;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
|
@ -23,8 +23,8 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
@ -23,8 +23,8 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
||||
import org.openrefine.wikidata.testing.JacksonSerializationTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -23,10 +23,10 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.schema.entityvalues;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.testing;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -23,10 +23,10 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.updates;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertFalse;
|
||||
import static org.testng.Assert.assertNotEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.updates.scheduler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.updates.scheduler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.updates.scheduler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -23,7 +23,7 @@
|
||||
******************************************************************************/
|
||||
package org.openrefine.wikidata.updates.scheduler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
18
main/pom.xml
18
main/pom.xml
@ -458,24 +458,6 @@
|
||||
<version>2.23.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-module-junit4</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.powermock</groupId>
|
||||
<artifactId>powermock-api-mockito2</artifactId>
|
||||
<version>1.7.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
|
@ -33,7 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package com.google.refine.exporters.sql;
|
||||
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.testng.Assert.assertNotEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
******************************************************************************/
|
||||
package com.google.refine.expr.functions.strings;
|
||||
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
|
||||
import java.util.Properties;
|
||||
@ -36,7 +36,6 @@ import org.testng.annotations.BeforeTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.refine.expr.EvalError;
|
||||
import com.google.refine.expr.functions.strings.SmartSplit;
|
||||
import com.google.refine.grel.ControlFunctionRegistry;
|
||||
import com.google.refine.grel.Function;
|
||||
import com.google.refine.util.TestUtils;
|
||||
@ -66,7 +65,7 @@ public class SmartSplitTests {
|
||||
String testString = "teststring1,teststring2,teststring3,teststring4";
|
||||
String[] expected = { "teststring1", "teststring2", "teststring3", "teststring4" };
|
||||
String[] actual = (String[]) invoke("smartSplit", testString);
|
||||
assertArrayEquals(expected, actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -74,7 +73,7 @@ public class SmartSplitTests {
|
||||
String testString = "teststring1 teststring2 teststring3 teststring4";
|
||||
String[] expected = { "teststring1", "teststring2", "teststring3", "teststring4" };
|
||||
String[] actual = (String[]) invoke("smartSplit", testString);
|
||||
assertArrayEquals(expected, actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -82,7 +81,7 @@ public class SmartSplitTests {
|
||||
String testString = "teststring1#teststring2#teststring3#teststring4";
|
||||
String[] expected = { "teststring1", "teststring2", "teststring3", "teststring4" };
|
||||
String[] actual = (String[]) invoke("smartSplit", testString, '#');
|
||||
assertArrayEquals(expected, actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -90,7 +89,7 @@ public class SmartSplitTests {
|
||||
String testString = "teststring1 teststring2 teststring3 teststring4";
|
||||
String[] expected = { "teststring1", "teststring2", "teststring3", "teststring4" };
|
||||
String[] actual = (String[]) invoke("smartSplit", testString, ' ');
|
||||
assertArrayEquals(expected, actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -98,7 +97,7 @@ public class SmartSplitTests {
|
||||
String testString = "teststring1#@$teststring2#@$teststring3#@$teststring4";
|
||||
String[] expected = { "teststring1", "teststring2", "teststring3", "teststring4" };
|
||||
String[] actual = (String[]) invoke("smartSplit", testString, "#@$");
|
||||
assertArrayEquals(expected, actual);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,12 +29,10 @@ package com.google.refine.expr.util;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.refine.expr.util.JsonValueConverter;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
public class JsonValueConverterTests {
|
||||
|
@ -30,7 +30,7 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.testng.Assert.assertNull;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
******************************************************************************/
|
||||
package com.google.refine.model.changes;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -26,8 +26,8 @@
|
||||
******************************************************************************/
|
||||
package com.google.refine.operations.recon;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.testng.Assert.assertEquals;
|
||||
import static org.testng.Assert.assertNull;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
@ -26,8 +26,8 @@
|
||||
******************************************************************************/
|
||||
package com.google.refine.util;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.testng.Assert.assertTrue;
|
||||
import static org.testng.Assert.fail;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -35,7 +35,6 @@ import java.io.LineNumberReader;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonFactory.Feature;
|
||||
import com.fasterxml.jackson.core.JsonParseException;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
@ -46,7 +45,6 @@ import com.fasterxml.jackson.databind.MapperFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.google.refine.util.ParsingUtilities;
|
||||
|
||||
|
||||
public class TestUtils {
|
||||
@ -86,7 +84,7 @@ public class TestUtils {
|
||||
if (!jsonA.equals(jsonB)) {
|
||||
jsonDiff(expected, actual);
|
||||
}
|
||||
assertEquals(jsonA, jsonB);
|
||||
assertTrue(jsonA.equals(jsonB));
|
||||
} catch(Exception e) {
|
||||
fail("\""+expected+"\" and \""+actual+"\" are not equal as JSON strings.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user