From 98712967173e6c817268bd996a27200181a3199a Mon Sep 17 00:00:00 2001
From: Jason Tedor <jason@tedor.me>
Date: Tue, 12 Jul 2016 08:18:32 -0400
Subject: [PATCH] [elasticsearch] switch test runner to JUnit

This commit switches the Elasticsearch test runner from TestNG to JUnit.
---
 elasticsearch/pom.xml                         |  6 +++---
 .../ycsb/db/ElasticsearchClientTest.java      | 19 +++++++++----------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/elasticsearch/pom.xml b/elasticsearch/pom.xml
index fc028291..334c580d 100644
--- a/elasticsearch/pom.xml
+++ b/elasticsearch/pom.xml
@@ -51,9 +51,9 @@ LICENSE file.
             <version>${elasticsearch-version}</version>
         </dependency>
         <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <version>6.1.1</version>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.12</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java b/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java
index 69e52ff6..3912c221 100644
--- a/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java
+++ b/elasticsearch/src/test/java/com/yahoo/ycsb/db/ElasticsearchClientTest.java
@@ -21,23 +21,22 @@
  */
 package com.yahoo.ycsb.db;
 
-import static org.testng.AssertJUnit.assertEquals;
-
 import com.yahoo.ycsb.ByteIterator;
 import com.yahoo.ycsb.DBException;
 import com.yahoo.ycsb.Status;
 import com.yahoo.ycsb.StringByteIterator;
-
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
 
 import java.util.HashMap;
 import java.util.Set;
 import java.util.Vector;
 
+import static org.junit.Assert.assertEquals;
+
 public class ElasticsearchClientTest {
 
     protected final static ElasticsearchClient instance = new ElasticsearchClient();
@@ -64,13 +63,13 @@ public class ElasticsearchClientTest {
         instance.cleanup();
     }
 
-    @BeforeMethod
+    @Before
     public void setUp() {
         instance.insert(MOCK_TABLE, MOCK_KEY1, MOCK_DATA);
         instance.insert(MOCK_TABLE, MOCK_KEY2, MOCK_DATA);
     }
 
-    @AfterMethod
+    @After
     public void tearDown() {
         instance.delete(MOCK_TABLE, MOCK_KEY1);
         instance.delete(MOCK_TABLE, MOCK_KEY2);
-- 
GitLab