ASTERIXDB-1280: avoid junit.framework.Assert
Change-Id: I4e2cfc9bc7e78b4807acd4c73e41a204d63f8023
Reviewed-on: https://asterix-gerrit.ics.uci.edu/606
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java b/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java
index 83beb7c..e950da5 100644
--- a/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/ConnectorAPIServletTest.java
@@ -36,6 +36,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import junit.extensions.PA;
+
import org.apache.asterix.feed.CentralFeedManager;
import org.apache.asterix.metadata.MetadataManager;
import org.apache.asterix.metadata.MetadataTransactionContext;
@@ -53,11 +55,9 @@
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;
+import org.junit.Assert;
import org.junit.Test;
-import junit.extensions.PA;
-import junit.framework.Assert;
-
@SuppressWarnings("deprecation")
public class ConnectorAPIServletTest {
diff --git a/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/VersionAPIServletTest.java b/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/VersionAPIServletTest.java
index 25ba2a6..cf9665b 100644
--- a/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/VersionAPIServletTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/api/http/servlet/VersionAPIServletTest.java
@@ -19,19 +19,10 @@
package org.apache.asterix.api.http.servlet;
-import junit.framework.Assert;
-import org.apache.asterix.common.config.AsterixBuildProperties;
-import org.apache.asterix.om.util.AsterixAppContextInfo;
-import org.apache.asterix.test.runtime.ExecutionTest;
-import org.apache.hyracks.api.client.IHyracksClientConnection;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.junit.Test;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
@@ -39,11 +30,19 @@
import java.util.HashMap;
import java.util.Map;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
+import org.apache.asterix.common.config.AsterixBuildProperties;
+import org.apache.asterix.om.util.AsterixAppContextInfo;
+import org.apache.asterix.test.runtime.ExecutionTest;
+import org.apache.hyracks.api.client.IHyracksClientConnection;
+import org.json.JSONObject;
+import org.json.JSONTokener;
+import org.junit.Assert;
+import org.junit.Test;
@SuppressWarnings("deprecation")
public class VersionAPIServletTest {
@@ -77,38 +76,39 @@
when(mockCtx.getBuildProperties()).thenReturn(mockProperties);
when(mockProperties.getAllProps()).thenReturn(propMap);
- propMap.put("git.build.user.email","foo@bar.baz");
- propMap.put("git.build.host","fulliautomatix");
- propMap.put("git.dirty","true");
- propMap.put("git.remote.origin.url","git@github.com:apache/incubator-asterixdb.git");
- propMap.put("git.closest.tag.name","asterix-0.8.7-incubating");
- propMap.put("git.commit.id.describe-short","asterix-0.8.7-incubating-19-dirty");
- propMap.put("git.commit.user.email","foo@bar.baz");
- propMap.put("git.commit.time","21.10.2015 @ 23:36:41 PDT");
- propMap.put("git.commit.message.full","ASTERIXDB-1045: fix log file reading during recovery\n\nChange-Id: Ic83ee1dd2d7ba88180c25f4ec6c7aa8d0a5a7162\nReviewed-on: https://asterix-gerrit.ics.uci.edu/465\nTested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>");
- propMap.put("git.build.version","0.8.8-SNAPSHOT");
- propMap.put("git.commit.message.short","ASTERIXDB-1045: fix log file reading during recovery");
- propMap.put("git.commit.id.abbrev","e1dad19");
- propMap.put("git.branch","foo/bar");
- propMap.put("git.build.user.name","Asterix");
- propMap.put("git.closest.tag.commit.count","19");
- propMap.put("git.commit.id.describe","asterix-0.8.7-incubating-19-ge1dad19-dirty");
- propMap.put("git.commit.id","e1dad1984640517366a7e73e323c9de27b0676f7");
- propMap.put("git.tags","");
- propMap.put("git.build.time","22.10.2015 @ 17:11:07 PDT");
- propMap.put("git.commit.user.name","Obelix");
+ propMap.put("git.build.user.email", "foo@bar.baz");
+ propMap.put("git.build.host", "fulliautomatix");
+ propMap.put("git.dirty", "true");
+ propMap.put("git.remote.origin.url", "git@github.com:apache/incubator-asterixdb.git");
+ propMap.put("git.closest.tag.name", "asterix-0.8.7-incubating");
+ propMap.put("git.commit.id.describe-short", "asterix-0.8.7-incubating-19-dirty");
+ propMap.put("git.commit.user.email", "foo@bar.baz");
+ propMap.put("git.commit.time", "21.10.2015 @ 23:36:41 PDT");
+ propMap.put("git.commit.message.full",
+ "ASTERIXDB-1045: fix log file reading during recovery\n\nChange-Id: Ic83ee1dd2d7ba88180c25f4ec6c7aa8d0a5a7162\nReviewed-on: https://asterix-gerrit.ics.uci.edu/465\nTested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>");
+ propMap.put("git.build.version", "0.8.8-SNAPSHOT");
+ propMap.put("git.commit.message.short", "ASTERIXDB-1045: fix log file reading during recovery");
+ propMap.put("git.commit.id.abbrev", "e1dad19");
+ propMap.put("git.branch", "foo/bar");
+ propMap.put("git.build.user.name", "Asterix");
+ propMap.put("git.closest.tag.commit.count", "19");
+ propMap.put("git.commit.id.describe", "asterix-0.8.7-incubating-19-ge1dad19-dirty");
+ propMap.put("git.commit.id", "e1dad1984640517366a7e73e323c9de27b0676f7");
+ propMap.put("git.tags", "");
+ propMap.put("git.build.time", "22.10.2015 @ 17:11:07 PDT");
+ propMap.put("git.commit.user.name", "Obelix");
// Calls VersionAPIServlet.formResponseObject.
servlet.doGet(mockRequest, mockResponse);
// Constructs the actual response.
- JSONTokener tokener = new JSONTokener(new InputStreamReader(
- new ByteArrayInputStream(outputStream.toByteArray())));
+ JSONTokener tokener = new JSONTokener(
+ new InputStreamReader(new ByteArrayInputStream(outputStream.toByteArray())));
JSONObject actualResponse = new JSONObject(tokener);
JSONObject expectedResponse = new JSONObject(propMap);
// Checks the response contains all the expected keys.
- Assert.assertEquals(actualResponse.toString(),expectedResponse.toString());
+ Assert.assertEquals(actualResponse.toString(), expectedResponse.toString());
// Tears down the asterixdb cluster.
ExecutionTest.tearDown();
diff --git a/asterix-app/src/test/java/org/apache/asterix/aql/translator/QueryTranslatorTest.java b/asterix-app/src/test/java/org/apache/asterix/aql/translator/QueryTranslatorTest.java
index 89350aa..a397875 100644
--- a/asterix-app/src/test/java/org/apache/asterix/aql/translator/QueryTranslatorTest.java
+++ b/asterix-app/src/test/java/org/apache/asterix/aql/translator/QueryTranslatorTest.java
@@ -28,6 +28,8 @@
import java.util.Arrays;
import java.util.List;
+import junit.extensions.PA;
+
import org.apache.asterix.api.common.SessionConfig;
import org.apache.asterix.common.config.AsterixExternalProperties;
import org.apache.asterix.compiler.provider.AqlCompilationProvider;
@@ -37,11 +39,9 @@
import org.apache.asterix.lang.common.statement.RunStatement;
import org.apache.asterix.om.util.AsterixAppContextInfo;
import org.apache.asterix.om.util.AsterixClusterProperties;
+import org.junit.Assert;
import org.junit.Test;
-import junit.extensions.PA;
-import junit.framework.Assert;
-
@SuppressWarnings({ "unchecked", "deprecation" })
public class QueryTranslatorTest {
diff --git a/asterix-om/src/test/java/org/apache/asterix/om/util/JSONDeserializerForTypesTest.java b/asterix-om/src/test/java/org/apache/asterix/om/util/JSONDeserializerForTypesTest.java
index 39041b4..2993b87 100644
--- a/asterix-om/src/test/java/org/apache/asterix/om/util/JSONDeserializerForTypesTest.java
+++ b/asterix-om/src/test/java/org/apache/asterix/om/util/JSONDeserializerForTypesTest.java
@@ -22,17 +22,14 @@
import java.util.ArrayList;
import java.util.List;
-import junit.framework.Assert;
-
-import org.junit.Test;
-
import org.apache.asterix.om.types.AOrderedListType;
import org.apache.asterix.om.types.ARecordType;
import org.apache.asterix.om.types.AUnionType;
import org.apache.asterix.om.types.AUnorderedListType;
import org.apache.asterix.om.types.BuiltinType;
import org.apache.asterix.om.types.IAType;
-import org.apache.asterix.om.util.JSONDeserializerForTypes;
+import org.junit.Assert;
+import org.junit.Test;
@SuppressWarnings("deprecation")
public class JSONDeserializerForTypesTest {