keith-turner commented on code in PR #5864:
URL: https://github.com/apache/accumulo/pull/5864#discussion_r2323716638
##########
test/src/main/java/org/apache/accumulo/test/conf/ResourceGroupConfigIT.java:
##########
@@ -207,4 +212,132 @@ private void checkProperty(InstanceOperations iops,
ResourceGroupOperations ops,
System.clearProperty(TServerClient.DEBUG_HOST);
}
+ @Test
+ public void testDefaultResourceGroup() throws Exception {
+ try (var client = Accumulo.newClient().from(getClientProps()).build()) {
+ Set<ResourceGroupId> rgs = client.resourceGroupOperations().list();
+ assertEquals(1, rgs.size());
+ assertEquals(ResourceGroupId.DEFAULT, rgs.iterator().next());
+ client.resourceGroupOperations().create(ResourceGroupId.DEFAULT);
+ assertThrows(AccumuloException.class,
+ () ->
client.resourceGroupOperations().remove(ResourceGroupId.DEFAULT));
+ }
+ }
+
Review Comment:
If not tested already, would be useful to test the following cases.
```java
client.resourceGroupOperations().create("g1");
client.resourceGroupOperations().create("g1"); // what happens here?
client.resourceGroupOperations().remove("g0"); // what happens when
removing rg that does not exists?
```
##########
test/src/main/java/org/apache/accumulo/test/conf/ResourceGroupConfigIT.java:
##########
@@ -207,4 +212,132 @@ private void checkProperty(InstanceOperations iops,
ResourceGroupOperations ops,
System.clearProperty(TServerClient.DEBUG_HOST);
}
+ @Test
+ public void testDefaultResourceGroup() throws Exception {
+ try (var client = Accumulo.newClient().from(getClientProps()).build()) {
+ Set<ResourceGroupId> rgs = client.resourceGroupOperations().list();
+ assertEquals(1, rgs.size());
+ assertEquals(ResourceGroupId.DEFAULT, rgs.iterator().next());
+ client.resourceGroupOperations().create(ResourceGroupId.DEFAULT);
+ assertThrows(AccumuloException.class,
+ () ->
client.resourceGroupOperations().remove(ResourceGroupId.DEFAULT));
+ }
+ }
+
Review Comment:
If not tested already, would be useful to test the following cases.
```java
client.resourceGroupOperations().create("g1");
client.resourceGroupOperations().create("g1"); // what happens here when
adding more than once?
client.resourceGroupOperations().remove("g0"); // what happens when
removing rg that does not exists?
```
--
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]