shahrs87 commented on code in PR #1664:
URL: https://github.com/apache/phoenix/pull/1664#discussion_r1310805918


##########
phoenix-core/src/it/java/org/apache/phoenix/jdbc/PhoenixTestDriverIT.java:
##########
@@ -31,13 +49,48 @@ public static synchronized void doSetup() throws Exception {
         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
     }
 
+    /**
+     * Test that connections created using the same url have the same CQSI 
object.
+     */
+    @Test
+    public void testSameCQSI() throws SQLException {
+        Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES);
+        String url = QueryUtil.getConnectionUrl(props, config, "client1");
+        try (Connection conn1 = DriverManager.getConnection(url);
+             Connection conn2 = DriverManager.getConnection(url)) {
+            ConnectionQueryServices cqs1 = 
conn1.unwrap(PhoenixConnection.class).getQueryServices();
+            ConnectionQueryServices cqs2 = 
conn2.unwrap(PhoenixConnection.class).getQueryServices();
+            Assert.assertNotNull(cqs1);
+            Assert.assertNotNull(cqs2);
+            Assert.assertTrue("Connections using the same URL should have the 
same CQSI object.", cqs1.equals(cqs2));

Review Comment:
   You could have used assertEquals.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to