ankitsinghal commented on a change in pull request #838:
URL: https://github.com/apache/phoenix/pull/838#discussion_r480321805



##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java
##########
@@ -43,27 +46,39 @@
 import org.apache.phoenix.schema.types.PInteger;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-
 
 public class InListIT extends ParallelStatsDisabledIT {
     private static final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=tenant1";
-    String tableName;
-    String descViewName;
-    String ascViewName;
+    private static boolean isInitialized = false;
+    private static String tableName = generateUniqueName();
+    private static String tableName2 = generateUniqueName();
+    private static String descViewName = generateUniqueName();
+    private static String ascViewName = generateUniqueName();
+    private static String viewName1 = generateUniqueName();
+    private static String viewName2 = generateUniqueName();
+    private static String prefix = generateUniqueName();
 
     @Before
     public void setup() throws Exception {
-        tableName = generateUniqueName();

Review comment:
       > would the whole test still work if we only change @before to 
@BeforeClass?
   Yeah , actually @BeforeClass requires a method to be static so all the data 
structures need to be updated as static. I didn't spend time doing that 
probably because of being lazy though could have used @BeforeAll and make the 
Junit lifecycle to be @TestInstance(Lifecycle.PER_CLASS) to avoid an 
initialized variable.

##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java
##########
@@ -43,27 +46,39 @@
 import org.apache.phoenix.schema.types.PInteger;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.PropertiesUtil;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-
 
 public class InListIT extends ParallelStatsDisabledIT {
     private static final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + 
TENANT_ID_ATTRIB + "=tenant1";
-    String tableName;
-    String descViewName;
-    String ascViewName;
+    private static boolean isInitialized = false;
+    private static String tableName = generateUniqueName();
+    private static String tableName2 = generateUniqueName();
+    private static String descViewName = generateUniqueName();
+    private static String ascViewName = generateUniqueName();
+    private static String viewName1 = generateUniqueName();
+    private static String viewName2 = generateUniqueName();
+    private static String prefix = generateUniqueName();
 
     @Before
     public void setup() throws Exception {
-        tableName = generateUniqueName();

Review comment:
       > would the whole test still work if we only change @before to 
@BeforeClass?
   
   Yeah , actually @BeforeClass requires a method to be static so all the data 
structures need to be updated as static. I didn't spend time doing that 
probably because of being lazy though could have used @BeforeAll and make the 
Junit lifecycle to be @TestInstance(Lifecycle.PER_CLASS) to avoid an 
initialized variable.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to