gemmellr commented on code in PR #5455:
URL: https://github.com/apache/activemq-artemis/pull/5455#discussion_r1930499272


##########
artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTestIndividualSettings.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.cli.commands;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.activemq.artemis.tests.extensions.TargetTempDirFactory;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.apache.activemq.cli.test.TestActionContext;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class CreateTestIndividualSettings {
+
+   @TempDir(factory = TargetTempDirFactory.class)
+   public File temporaryFolder;
+
+   public TestActionContext context;
+   public File testInstance;
+
+   @BeforeEach
+   public void setUp() {
+      context = new TestActionContext();
+      testInstance = new File(temporaryFolder, "test-instance");
+   }
+
+   @Test
+   public void testAioJournalMaxIo() throws Exception {
+      long aioJournalMaxIo = RandomUtil.randomLong();
+
+      Create c = new Create();
+      c.setAio(true);
+      c.setJournalMaxAio(aioJournalMaxIo);
+      c.setInstance(testInstance);
+      c.execute(context);
+
+      assertTrue(fileContains(new File(testInstance, "etc/" + 
Create.ETC_BROKER_XML), "<journal-max-io>" + aioJournalMaxIo + 
"</journal-max-io"));

Review Comment:
   Missing the ">" element close at end, both here and below.



##########
artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/CreateTestIndividualSettings.java:
##########
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.cli.commands;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.activemq.artemis.tests.extensions.TargetTempDirFactory;
+import org.apache.activemq.artemis.utils.RandomUtil;
+import org.apache.activemq.cli.test.TestActionContext;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class CreateTestIndividualSettings {
+
+   @TempDir(factory = TargetTempDirFactory.class)
+   public File temporaryFolder;
+
+   public TestActionContext context;
+   public File testInstance;
+
+   @BeforeEach
+   public void setUp() {
+      context = new TestActionContext();
+      testInstance = new File(temporaryFolder, "test-instance");
+   }
+
+   @Test
+   public void testAioJournalMaxIo() throws Exception {
+      long aioJournalMaxIo = RandomUtil.randomLong();
+
+      Create c = new Create();
+      c.setAio(true);
+      c.setJournalMaxAio(aioJournalMaxIo);
+      c.setInstance(testInstance);
+      c.execute(context);
+
+      assertTrue(fileContains(new File(testInstance, "etc/" + 
Create.ETC_BROKER_XML), "<journal-max-io>" + aioJournalMaxIo + 
"</journal-max-io"));
+   }
+
+   @Test
+   public void testAioJournalMaxIoNegative() throws Exception {
+      long aioJournalMaxIo = RandomUtil.randomLong();
+
+      Create c = new Create();
+      c.setNio(true);
+      c.setJournalMaxAio(aioJournalMaxIo);
+      c.setInstance(testInstance);
+      c.execute(context);
+
+      assertFalse(fileContains(new File(testInstance, "etc/" + 
Create.ETC_BROKER_XML), "<journal-max-io>" + aioJournalMaxIo + 
"</journal-max-io"));

Review Comment:
   Is it expected to write  "\<journal-max-io>1\</journal-max-io>" instead? If 
so should it perhaps assert that also?



##########
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java:
##########
@@ -327,6 +327,9 @@ public String[] getStaticNodes() {
    @Option(names = "--jdbc-lock-expiration", description = "Lock expiration 
(in milliseconds).")
    long jdbcLockExpiration = 
ActiveMQDefaultConfiguration.getDefaultJdbcLockExpirationMillis();
 
+   @Option(names = "--journal-max-aio", description = "The journal-max-io 
value to use when also using the ASYNCIO journal-type. When using NIO or MAPPED 
this value is always '1'. Default: 4096")

Review Comment:
   Regardless what it is called, I would move this up beside the other journal 
related options rather than adding it after all the jdbc options (if there isnt 
some constraint preventing it).
   
   The configuration impl class uses a suffix for its fields based on the 
journal type, JournalMaxIO_NIO and JournalMaxIO_AIO, so I'd wonder if such 
suffix naming convention transfers over to broker-properties usage somehow and 
if so might --journal-max-io-aio fit with it for alignment?



-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to