Skip to content
Snippets Groups Projects
Unverified Commit 98712967 authored by Jason Tedor's avatar Jason Tedor
Browse files

[elasticsearch] switch test runner to JUnit

This commit switches the Elasticsearch test runner from TestNG to JUnit.
parent 4f299b80
No related branches found
No related tags found
No related merge requests found
...@@ -51,9 +51,9 @@ LICENSE file. ...@@ -51,9 +51,9 @@ LICENSE file.
<version>${elasticsearch-version}</version> <version>${elasticsearch-version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>junit</groupId>
<artifactId>testng</artifactId> <artifactId>junit</artifactId>
<version>6.1.1</version> <version>4.12</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -21,23 +21,22 @@ ...@@ -21,23 +21,22 @@
*/ */
package com.yahoo.ycsb.db; package com.yahoo.ycsb.db;
import static org.testng.AssertJUnit.assertEquals;
import com.yahoo.ycsb.ByteIterator; import com.yahoo.ycsb.ByteIterator;
import com.yahoo.ycsb.DBException; import com.yahoo.ycsb.DBException;
import com.yahoo.ycsb.Status; import com.yahoo.ycsb.Status;
import com.yahoo.ycsb.StringByteIterator; import com.yahoo.ycsb.StringByteIterator;
import org.junit.After;
import org.testng.annotations.AfterClass; import org.junit.AfterClass;
import org.testng.annotations.AfterMethod; import org.junit.Before;
import org.testng.annotations.BeforeClass; import org.junit.BeforeClass;
import org.testng.annotations.BeforeMethod; import org.junit.Test;
import org.testng.annotations.Test;
import java.util.HashMap; import java.util.HashMap;
import java.util.Set; import java.util.Set;
import java.util.Vector; import java.util.Vector;
import static org.junit.Assert.assertEquals;
public class ElasticsearchClientTest { public class ElasticsearchClientTest {
protected final static ElasticsearchClient instance = new ElasticsearchClient(); protected final static ElasticsearchClient instance = new ElasticsearchClient();
...@@ -64,13 +63,13 @@ public class ElasticsearchClientTest { ...@@ -64,13 +63,13 @@ public class ElasticsearchClientTest {
instance.cleanup(); instance.cleanup();
} }
@BeforeMethod @Before
public void setUp() { public void setUp() {
instance.insert(MOCK_TABLE, MOCK_KEY1, MOCK_DATA); instance.insert(MOCK_TABLE, MOCK_KEY1, MOCK_DATA);
instance.insert(MOCK_TABLE, MOCK_KEY2, MOCK_DATA); instance.insert(MOCK_TABLE, MOCK_KEY2, MOCK_DATA);
} }
@AfterMethod @After
public void tearDown() { public void tearDown() {
instance.delete(MOCK_TABLE, MOCK_KEY1); instance.delete(MOCK_TABLE, MOCK_KEY1);
instance.delete(MOCK_TABLE, MOCK_KEY2); instance.delete(MOCK_TABLE, MOCK_KEY2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment