From 6cec622b6406374cf31effe172dce10697f2ba50 Mon Sep 17 00:00:00 2001 From: vkamble60 Date: Thu, 13 Jul 2017 13:42:18 +0530 Subject: [PATCH] [WFLY-8767]Changing the max-pool-size of the datasource pool should indicate a "reload required" in the CLI output --- .../subsystems/common/pool/Constants.java | 2 + .../pool/PoolConfigurationRWHandler.java | 3 +- .../DatasourceMaxPoolAttributeTestCase.java | 200 ++++++++++++++++++ .../DatasourceMinPoolAttributeTestCase.java | 200 ++++++++++++++++++ .../DatasourcePoolAttributesTestCase.java | 11 +- ...ResourceAdapterPoolAttributesTestCase.java | 20 +- 6 files changed, 419 insertions(+), 17 deletions(-) create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMaxPoolAttributeTestCase.java create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMinPoolAttributeTestCase.java diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/Constants.java b/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/Constants.java index 58bf7cc10e85..33b2168d27e0 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/Constants.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/Constants.java @@ -133,12 +133,14 @@ public class Constants { .setXmlName(Pool.Tag.MAX_POOL_SIZE.getLocalName()) .setAllowExpression(true) .setDefaultValue(new ModelNode(Defaults.MAX_POOL_SIZE)) + .setRestartAllServices() .build(); public static final SimpleAttributeDefinition MIN_POOL_SIZE = new SimpleAttributeDefinitionBuilder(MIN_POOL_SIZE_NAME, ModelType.INT, true) .setXmlName(Pool.Tag.MIN_POOL_SIZE.getLocalName()) .setAllowExpression(true) .setDefaultValue(new ModelNode(Defaults.MIN_POOL_SIZE)) + .setRestartAllServices() .build(); public static final SimpleAttributeDefinition INITIAL_POOL_SIZE = new SimpleAttributeDefinitionBuilder(INITIAL_POOL_SIZE_NAME, ModelType.INT) diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/PoolConfigurationRWHandler.java b/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/PoolConfigurationRWHandler.java index 45ceb2bef686..d31a9a504261 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/PoolConfigurationRWHandler.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/common/pool/PoolConfigurationRWHandler.java @@ -113,7 +113,8 @@ protected boolean applyUpdateToRuntime(final OperationContext context, final Mod return (IDLETIMEOUTMINUTES.getName().equals(parameterName) || BACKGROUNDVALIDATION.getName().equals(parameterName) || BACKGROUNDVALIDATIONMILLIS.getName().equals(parameterName) - || POOL_PREFILL.getName().equals(parameterName) || POOL_FLUSH_STRATEGY.getName().equals(parameterName)); + || POOL_PREFILL.getName().equals(parameterName) || POOL_FLUSH_STRATEGY.getName().equals(parameterName) + || MAX_POOL_SIZE.getName().equals(parameterName) || MIN_POOL_SIZE.getName().equals(parameterName)); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMaxPoolAttributeTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMaxPoolAttributeTestCase.java new file mode 100644 index 000000000000..d1eda0ff7c95 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMaxPoolAttributeTestCase.java @@ -0,0 +1,200 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017, Red Hat Middleware LLC, and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * + */ + +package org.jboss.as.test.integration.jca.poolattributes; + +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; + +import javax.annotation.Resource; +import javax.sql.DataSource; + +import org.jboss.arquillian.container.test.api.ContainerController; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.as.arquillian.api.ServerSetup; +import org.jboss.as.arquillian.container.ManagementClient; +import org.jboss.as.connector.subsystems.common.pool.Constants; +import org.jboss.as.connector.subsystems.datasources.WildFlyDataSource; +import org.jboss.as.controller.client.ModelControllerClient; +import org.jboss.as.test.integration.jca.JcaMgmtBase; +import org.jboss.as.test.integration.jca.JcaMgmtServerSetupTask; +import org.jboss.as.test.integration.jca.JcaTestsUtil; +import org.jboss.as.test.integration.jca.datasource.Datasource; +import org.jboss.as.test.integration.jca.datasource.DatasourceNonCcmTestCase; +import org.jboss.as.test.integration.management.ManagementOperations; +import org.jboss.as.test.integration.management.base.AbstractMgmtServerSetupTask; +import org.jboss.as.test.integration.management.base.AbstractMgmtTestBase; +import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase; +import org.jboss.as.test.integration.management.util.MgmtOperationException; +import org.jboss.as.test.shared.ServerReload; +import org.jboss.dmr.ModelNode; +import org.jboss.jca.adapters.jdbc.WrapperDataSource; +import org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Checks that pool attributes can be set and do (not) require a reload. + * + * @author Tomas Hofman + */ +@RunWith(Arquillian.class) +@ServerSetup(DatasourceMaxPoolAttributeTestCase.DatasourceServerSetupTask.class) +public class DatasourceMaxPoolAttributeTestCase extends JcaMgmtBase { + + private static final String DS_NAME = "DS"; + private static final ModelNode DS_ADDRESS = new ModelNode().add(SUBSYSTEM, "datasources") + .add("data-source", DS_NAME); + + static { + DS_ADDRESS.protect(); + } + + @Deployment + public static Archive createDeployment() { + JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "deployment.jar"); + + jar.addClasses( + DatasourceNonCcmTestCase.class, + Datasource.class, + WildFlyDataSource.class, + WrapperDataSource.class, + JcaMgmtServerSetupTask.class, + DatasourceMaxPoolAttributeTestCase.class, + AbstractMgmtServerSetupTask.class, + AbstractMgmtTestBase.class, + JcaMgmtBase.class, + ContainerResourceMgmtTestBase.class, + MgmtOperationException.class, + ManagementOperations.class, + JcaTestsUtil.class, + ServerReload.class); + + jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api," + + "org.jboss.as.connector," + + "org.jboss.as.controller," + + "org.jboss.dmr," + + "org.jboss.as.cli," + + "org.jboss.staxmapper," + + "org.jboss.ironjacamar.api," + + "org.jboss.ironjacamar.impl," + + "org.jboss.ironjacamar.jdbcadapters\n"), "MANIFEST.MF"); + + return jar; + } + + @Resource(mappedName = "java:jboss/datasources/" + DS_NAME) + private DataSource datasource; + + @ArquillianResource + private ManagementClient managementClient; + + @ArquillianResource + private static ContainerController container; + + @Override + protected ModelControllerClient getModelControllerClient() { + return managementClient.getControllerClient(); + } + + @Test + public void testModifyMinPoolAttribute() throws Exception { + WrapperDataSource wrapperDataSource = JcaTestsUtil.extractWrapperDatasource((WildFlyDataSource) datasource); + PoolConfiguration poolConfiguration = JcaTestsUtil.exctractPoolConfiguration(wrapperDataSource); + + // check initial values + Assert.assertNotNull(poolConfiguration); + Assert.assertEquals(20, poolConfiguration.getMaxSize()); + + // modify values + writeAttribute(DS_ADDRESS, Constants.MAX_POOL_SIZE.getName(), "10"); + + // check that server is reload-required state + ModelNode serverState = readAttribute(new ModelNode(), "server-state"); + Assert.assertEquals("reload-required", serverState.asString()); + + // check that runtime was updated + Assert.assertEquals(10, poolConfiguration.getMaxSize()); + + } + + + static class DatasourceServerSetupTask extends JcaMgmtServerSetupTask { + + @Override + protected void doSetup(ManagementClient managementClient) throws Exception { + setupDs(managementClient, DS_NAME, true); + reload(); + } + + private void setupDs(ManagementClient managementClient, String dsName, boolean jta) throws Exception { + Datasource ds = Datasource.Builder(dsName).build(); + ModelNode address = new ModelNode(); + address.add("subsystem", "datasources"); + address.add("data-source", dsName); + + ModelNode operation = new ModelNode(); + operation.get(OP).set(ADD); + operation.get(OP_ADDR).set(address); + operation.get("jndi-name").set(ds.getJndiName()); + operation.get("use-java-context").set("true"); + operation.get("driver-name").set(ds.getDriverName()); + operation.get("enabled").set("true"); + operation.get("user-name").set(ds.getUserName()); + operation.get("password").set(ds.getPassword()); + operation.get("jta").set(jta); + operation.get("use-ccm").set("true"); + operation.get("connection-url").set(ds.getConnectionUrl()); + managementClient.getControllerClient().execute(operation); + } + + @Override + public void tearDown(ManagementClient managementClient, String containerId) throws Exception { + removeDs(managementClient, DS_NAME); + reload(); + } + + private void removeDs(ManagementClient managementClient, String dsName) throws Exception { + ModelNode address = new ModelNode(); + address.add("subsystem", "datasources"); + address.add("data-source", dsName); + ModelNode operation = new ModelNode(); + operation.get(OP).set(REMOVE); + operation.get(OP_ADDR).set(address); + managementClient.getControllerClient().execute(operation); + } + + } + + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMinPoolAttributeTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMinPoolAttributeTestCase.java new file mode 100644 index 000000000000..d85066490752 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourceMinPoolAttributeTestCase.java @@ -0,0 +1,200 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2017, Red Hat Middleware LLC, and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * + */ + +package org.jboss.as.test.integration.jca.poolattributes; + +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE; +import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; + +import javax.annotation.Resource; +import javax.sql.DataSource; + +import org.jboss.arquillian.container.test.api.ContainerController; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.arquillian.test.api.ArquillianResource; +import org.jboss.as.arquillian.api.ServerSetup; +import org.jboss.as.arquillian.container.ManagementClient; +import org.jboss.as.connector.subsystems.common.pool.Constants; +import org.jboss.as.connector.subsystems.datasources.WildFlyDataSource; +import org.jboss.as.controller.client.ModelControllerClient; +import org.jboss.as.test.integration.jca.JcaMgmtBase; +import org.jboss.as.test.integration.jca.JcaMgmtServerSetupTask; +import org.jboss.as.test.integration.jca.JcaTestsUtil; +import org.jboss.as.test.integration.jca.datasource.Datasource; +import org.jboss.as.test.integration.jca.datasource.DatasourceNonCcmTestCase; +import org.jboss.as.test.integration.management.ManagementOperations; +import org.jboss.as.test.integration.management.base.AbstractMgmtServerSetupTask; +import org.jboss.as.test.integration.management.base.AbstractMgmtTestBase; +import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase; +import org.jboss.as.test.integration.management.util.MgmtOperationException; +import org.jboss.as.test.shared.ServerReload; +import org.jboss.dmr.ModelNode; +import org.jboss.jca.adapters.jdbc.WrapperDataSource; +import org.jboss.jca.core.api.connectionmanager.pool.PoolConfiguration; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.StringAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Checks that pool attributes can be set and do (not) require a reload. + * + * @author Tomas Hofman + */ +@RunWith(Arquillian.class) +@ServerSetup(DatasourceMinPoolAttributeTestCase.DatasourceServerSetupTask.class) +public class DatasourceMinPoolAttributeTestCase extends JcaMgmtBase { + + private static final String DS_NAME = "DS"; + private static final ModelNode DS_ADDRESS = new ModelNode().add(SUBSYSTEM, "datasources") + .add("data-source", DS_NAME); + + static { + DS_ADDRESS.protect(); + } + + @Deployment + public static Archive createDeployment() { + JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "deployment.jar"); + + jar.addClasses( + DatasourceNonCcmTestCase.class, + Datasource.class, + WildFlyDataSource.class, + WrapperDataSource.class, + JcaMgmtServerSetupTask.class, + DatasourceMinPoolAttributeTestCase.class, + AbstractMgmtServerSetupTask.class, + AbstractMgmtTestBase.class, + JcaMgmtBase.class, + ContainerResourceMgmtTestBase.class, + MgmtOperationException.class, + ManagementOperations.class, + JcaTestsUtil.class, + ServerReload.class); + + jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api," + + "org.jboss.as.connector," + + "org.jboss.as.controller," + + "org.jboss.dmr," + + "org.jboss.as.cli," + + "org.jboss.staxmapper," + + "org.jboss.ironjacamar.api," + + "org.jboss.ironjacamar.impl," + + "org.jboss.ironjacamar.jdbcadapters\n"), "MANIFEST.MF"); + + return jar; + } + + @Resource(mappedName = "java:jboss/datasources/" + DS_NAME) + private DataSource datasource; + + @ArquillianResource + private ManagementClient managementClient; + + @ArquillianResource + private static ContainerController container; + + @Override + protected ModelControllerClient getModelControllerClient() { + return managementClient.getControllerClient(); + } + + @Test + public void testModifyMinPoolAttribute() throws Exception { + WrapperDataSource wrapperDataSource = JcaTestsUtil.extractWrapperDatasource((WildFlyDataSource) datasource); + PoolConfiguration poolConfiguration = JcaTestsUtil.exctractPoolConfiguration(wrapperDataSource); + + // check initial values + Assert.assertNotNull(poolConfiguration); + Assert.assertEquals(0, poolConfiguration.getMinSize()); + + // modify values + writeAttribute(DS_ADDRESS, Constants.MIN_POOL_SIZE.getName(), "4"); + + // check that server is in reload-required state + ModelNode serverState = readAttribute(new ModelNode(), "server-state"); + Assert.assertEquals("reload-required", serverState.asString()); + + // check that runtime was updated + Assert.assertEquals(4, poolConfiguration.getMinSize()); + + } + + + static class DatasourceServerSetupTask extends JcaMgmtServerSetupTask { + + @Override + protected void doSetup(ManagementClient managementClient) throws Exception { + setupDs(managementClient, DS_NAME, true); + reload(); + } + + private void setupDs(ManagementClient managementClient, String dsName, boolean jta) throws Exception { + Datasource ds = Datasource.Builder(dsName).build(); + ModelNode address = new ModelNode(); + address.add("subsystem", "datasources"); + address.add("data-source", dsName); + + ModelNode operation = new ModelNode(); + operation.get(OP).set(ADD); + operation.get(OP_ADDR).set(address); + operation.get("jndi-name").set(ds.getJndiName()); + operation.get("use-java-context").set("true"); + operation.get("driver-name").set(ds.getDriverName()); + operation.get("enabled").set("true"); + operation.get("user-name").set(ds.getUserName()); + operation.get("password").set(ds.getPassword()); + operation.get("jta").set(jta); + operation.get("use-ccm").set("true"); + operation.get("connection-url").set(ds.getConnectionUrl()); + managementClient.getControllerClient().execute(operation); + } + + @Override + public void tearDown(ManagementClient managementClient, String containerId) throws Exception { + removeDs(managementClient, DS_NAME); + reload(); + } + + private void removeDs(ManagementClient managementClient, String dsName) throws Exception { + ModelNode address = new ModelNode(); + address.add("subsystem", "datasources"); + address.add("data-source", dsName); + ModelNode operation = new ModelNode(); + operation.get(OP).set(REMOVE); + operation.get(OP_ADDR).set(address); + managementClient.getControllerClient().execute(operation); + } + + } + + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourcePoolAttributesTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourcePoolAttributesTestCase.java index 630d26225c9d..2974374a9e4b 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourcePoolAttributesTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/DatasourcePoolAttributesTestCase.java @@ -137,17 +137,13 @@ public void testModifyNonReloadAttributes() throws Exception { // check initial values Assert.assertNotNull(poolConfiguration); - Assert.assertEquals(0, poolConfiguration.getMinSize()); - Assert.assertEquals(20, poolConfiguration.getMaxSize()); Assert.assertEquals(0, poolConfiguration.getInitialSize()); Assert.assertEquals(30000, poolConfiguration.getBlockingTimeout()); Assert.assertEquals(true, poolConfiguration.isFair()); Assert.assertEquals(false, poolConfiguration.isStrictMin()); // modify values - writeAttribute(DS_ADDRESS, Constants.MIN_POOL_SIZE.getName(), "4"); - writeAttribute(DS_ADDRESS, Constants.MAX_POOL_SIZE.getName(), "10"); - writeAttribute(DS_ADDRESS, Constants.INITIAL_POOL_SIZE.getName(), "6"); + writeAttribute(DS_ADDRESS, Constants.INITIAL_POOL_SIZE.getName(), "4"); writeAttribute(DS_ADDRESS, Constants.BLOCKING_TIMEOUT_WAIT_MILLIS.getName(), "10000"); writeAttribute(DS_ADDRESS, Constants.POOL_FAIR.getName(), "false"); writeAttribute(DS_ADDRESS, Constants.POOL_USE_STRICT_MIN.getName(), "true"); @@ -155,11 +151,8 @@ public void testModifyNonReloadAttributes() throws Exception { // check that server is not in reload-required state ModelNode serverState = readAttribute(new ModelNode(), "server-state"); Assert.assertEquals("running", serverState.asString()); - // check that runtime was updated - Assert.assertEquals(4, poolConfiguration.getMinSize()); - Assert.assertEquals(10, poolConfiguration.getMaxSize()); - Assert.assertEquals(6, poolConfiguration.getInitialSize()); + Assert.assertEquals(4, poolConfiguration.getInitialSize()); Assert.assertEquals(10000, poolConfiguration.getBlockingTimeout()); Assert.assertEquals(false, poolConfiguration.isFair()); Assert.assertEquals(true, poolConfiguration.isStrictMin()); diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/ResourceAdapterPoolAttributesTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/ResourceAdapterPoolAttributesTestCase.java index 45c967b7e151..e8f0cec005db 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/ResourceAdapterPoolAttributesTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/poolattributes/ResourceAdapterPoolAttributesTestCase.java @@ -156,9 +156,7 @@ public void testModifyPoolAttributes() throws Exception { Assert.assertEquals(false, poolConfiguration.isStrictMin()); // modify values - writeAttribute(CONNECTION_ADDRESS, Constants.MIN_POOL_SIZE.getName(), "4"); - writeAttribute(CONNECTION_ADDRESS, Constants.MAX_POOL_SIZE.getName(), "10"); - writeAttribute(CONNECTION_ADDRESS, Constants.INITIAL_POOL_SIZE.getName(), "6"); + writeAttribute(CONNECTION_ADDRESS, Constants.INITIAL_POOL_SIZE.getName(), "4"); writeAttribute(CONNECTION_ADDRESS, Constants.BLOCKING_TIMEOUT_WAIT_MILLIS.getName(), "10000"); writeAttribute(CONNECTION_ADDRESS, Constants.POOL_FAIR.getName(), "false"); writeAttribute(CONNECTION_ADDRESS, Constants.POOL_USE_STRICT_MIN.getName(), "true"); @@ -166,14 +164,22 @@ public void testModifyPoolAttributes() throws Exception { // check that server is not in reload-required state ModelNode serverState = readAttribute(new ModelNode(), "server-state"); Assert.assertEquals("running", serverState.asString()); - // check that runtime was updated - Assert.assertEquals(4, poolConfiguration.getMinSize()); - Assert.assertEquals(10, poolConfiguration.getMaxSize()); - Assert.assertEquals(6, poolConfiguration.getInitialSize()); + Assert.assertEquals(4, poolConfiguration.getInitialSize()); Assert.assertEquals(10000, poolConfiguration.getBlockingTimeout()); Assert.assertEquals(false, poolConfiguration.isFair()); Assert.assertEquals(true, poolConfiguration.isStrictMin()); + + writeAttribute(CONNECTION_ADDRESS, Constants.MIN_POOL_SIZE.getName(), "4"); + writeAttribute(CONNECTION_ADDRESS, Constants.MAX_POOL_SIZE.getName(), "10"); + + // check that server is in reload-required state + serverState = readAttribute(new ModelNode(), "server-state"); + Assert.assertEquals("reload-required", serverState.asString()); + + // check that runtime was updated + Assert.assertEquals(4, poolConfiguration.getMinSize()); + Assert.assertEquals(10, poolConfiguration.getMaxSize()); } static class ResourceAdapterCapacityPoliciesServerSetupTask extends JcaMgmtServerSetupTask {