[ 
https://issues.apache.org/jira/browse/QPID-8666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17814393#comment-17814393
 ] 

ASF GitHub Bot commented on QPID-8666:
--------------------------------------

gemmellr commented on code in PR #239:
URL: https://github.com/apache/qpid-broker-j/pull/239#discussion_r1478374918


##########
broker-core/src/test/java/org/apache/qpid/server/store/VirtualHostStoreUpgraderAndRecovererTest.java:
##########
@@ -323,29 +323,36 @@ public void 
testContextVariableUpgradeFromBoneCPToHikariCPProvider(final String
         context.put("qpid.jdbcstore.bonecp.partitionCount", partitionCount);
         context.put("qpid.jdbcstore.bonecp.maxConnectionsPerPartition", 
maxConnectionsPerPartition);
         context.put("qpid.jdbcstore.bonecp.minConnectionsPerPartition", 
minConnectionsPerPartition);
+
         final Map<String, Object> attributes = Map.of("name", getTestName(),
                 "modelVersion", "9.0",
                 "type", "JDBC",
                 "connectionPoolType", "BONECP",
                 "context", context);
+
         final ConfiguredObjectRecord virtualHostRecord = 
mock(ConfiguredObjectRecord.class);;
         when(virtualHostRecord.getId()).thenReturn(randomUUID());
         when(virtualHostRecord.getType()).thenReturn("VirtualHost");
         when(virtualHostRecord.getAttributes()).thenReturn(attributes);
 
-        final List<ConfiguredObjectRecord> records = List.of(rootRecord, 
virtualHostRecord);
+        final ConfiguredObjectRecord virtualHostLoggerRecord = 
mock(ConfiguredObjectRecord.class);;
+        when(virtualHostLoggerRecord.getId()).thenReturn(randomUUID());
+        
when(virtualHostLoggerRecord.getType()).thenReturn("VirtualHostLogger");
+        when(virtualHostLoggerRecord.getAttributes()).thenReturn(attributes);

Review Comment:
   This test isnt taking steps to copy the attributes map (or again the context 
map), as was just introduced in the other test, seems strange for them to 
differ in that sense when doing essentially the same.



##########
broker-core/src/test/java/org/apache/qpid/server/store/BrokerStoreUpgraderAndRecovererTest.java:
##########
@@ -898,10 +897,75 @@ public void 
testContextVariableUpgradeFromBoneCPToHikariCPProvider(final String
         context.put("qpid.jdbcstore.bonecp.partitionCount", partitionCount);
         context.put("qpid.jdbcstore.bonecp.maxConnectionsPerPartition", 
maxConnectionsPerPartition);
         context.put("qpid.jdbcstore.bonecp.minConnectionsPerPartition", 
minConnectionsPerPartition);
+        context.put("qpid.jdbcstore.property1", "1");
+        context.put("qpid.jdbcstore.property2", "two");
+        context.put("qpid.jdbcstore.property3", "_3_");
+
         final Map<String, Object> attributes = Map.of("name", getTestName(),
                 "type", "JDBC",
                 "connectionPoolType", "BONECP",
                 "context", context);
+
+        _brokerRecord.getAttributes().put("context", context);
+
+        final ConfiguredObjectRecord systemConfigRecord = 
mock(ConfiguredObjectRecord.class);;
+        when(systemConfigRecord.getId()).thenReturn(randomUUID());
+        when(systemConfigRecord.getType()).thenReturn("SystemConfig");
+        
when(systemConfigRecord.getAttributes()).thenReturn(Map.copyOf(attributes));

Review Comment:
   The test is taking care to copy the attributes map used for each record, but 
the copies still all then contain the same context original map which isnt 
copied. Should it be, to check each record is handled as expected, and given 
the test later asserts on each record's context as if they are different maps?





> [Broker-J] Broker plugin jdbc-provider-bone replacement
> -------------------------------------------------------
>
>                 Key: QPID-8666
>                 URL: https://issues.apache.org/jira/browse/QPID-8666
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Broker-J
>    Affects Versions: qpid-java-broker-9.1.0
>            Reporter: Daniil Kirilyuk
>            Priority: Major
>             Fix For: qpid-java-broker-9.2.0
>
>
> Broker plugin jdbc-provider-bone relies on JDBC connection pooling library 
> bonecp, which is no longer developed or updated. The [github project 
> page|https://github.com/wwadge/bonecp] states:
> "BoneCP is a Java JDBC connection pool implementation that is tuned for high 
> performance by minimizing lock contention to give greater throughput for your 
> applications. It beats older connection pools such as C3P0 and DBCP but 
> should now be considered deprecated in favour of HikariCP".
> Plugin jdbc-provider-bone should be replaced with the new one 
> jdbc-provider-hikaricp based on 
> [HikariCP|https://github.com/brettwooldridge/HikariCP] library. Both 
> libraries use Apache-2.0 license.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to