From 6f7be35fbb022b5537779303f9efbb857b69f07c Mon Sep 17 00:00:00 2001 From: Lin Gao Date: Sun, 19 Aug 2018 21:15:32 +0800 Subject: [PATCH] [WFLY-10640] driver-datasource-class-name and driver-xa-datasource-class-name need to be validated when updating --- .../as/connector/logging/ConnectorLogger.java | 6 +- .../AbstractDataSourceService.java | 32 +++- .../subsystems/datasources/JdbcDriverAdd.java | 28 ++++ .../jca/DataSourceClassInfoTestCase.java | 60 -------- .../DatasourceWrongDsClassTestCase.java | 141 ++++++++++++++++++ .../jca/datasource/DummyDataSource.java | 34 +++++ .../jca/datasource/DummyXADataSource.java | 34 +++++ .../jca/datasource/TestDriver.java | 87 +++++++++++ .../metrics/DriverCfgMetricUnitTestCase.java | 3 +- .../metrics/data-sources/complex-driver.xml | 3 +- 10 files changed, 362 insertions(+), 66 deletions(-) create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DatasourceWrongDsClassTestCase.java create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DummyDataSource.java create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DummyXADataSource.java create mode 100644 testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/TestDriver.java diff --git a/connector/src/main/java/org/jboss/as/connector/logging/ConnectorLogger.java b/connector/src/main/java/org/jboss/as/connector/logging/ConnectorLogger.java index 4e5eaa038343..5f8d0b8da95f 100644 --- a/connector/src/main/java/org/jboss/as/connector/logging/ConnectorLogger.java +++ b/connector/src/main/java/org/jboss/as/connector/logging/ConnectorLogger.java @@ -910,11 +910,15 @@ public interface ConnectorLogger extends BasicLogger { void unexceptedWorkerCompletionError(String errorMessage, @Cause Throwable t); @Message(id = 114, value = "Failed to load datasource class: %s") - IllegalStateException failedToLoadDataSourceClass(String clsName, @Cause Throwable t); + OperationFailedException failedToLoadDataSourceClass(String clsName, @Cause Throwable t); @Message(id = 115, value = "Module for driver [%s] or one of it dependencies is missing: [%s]") String missingDependencyInModuleDriver(String moduleName, String missingModule); @Message(id = 116, value = "Failed to load module for RA [%s] - the module or one of its dependencies is missing [%s]") String raModuleNotFound(String moduleName, String missingModule); + + @Message(id = 117, value = "%s is not a valid %s implementation") + OperationFailedException notAValidDataSourceClass(String clz, String dsClz); + } diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/AbstractDataSourceService.java b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/AbstractDataSourceService.java index af91c4484239..a8d5fc8c2a69 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/AbstractDataSourceService.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/AbstractDataSourceService.java @@ -42,6 +42,7 @@ import javax.resource.spi.ManagedConnectionFactory; import javax.security.auth.Subject; import javax.sql.DataSource; +import javax.sql.XADataSource; import org.jboss.as.connector.logging.ConnectorLogger; import org.jboss.as.connector.metadata.api.common.Credential; @@ -49,6 +50,7 @@ import org.jboss.as.connector.services.driver.InstalledDriver; import org.jboss.as.connector.services.driver.registry.DriverRegistry; import org.jboss.as.connector.util.Injection; +import org.jboss.as.controller.OperationFailedException; import org.jboss.as.core.security.ServerSecurityManager; import org.jboss.as.naming.deployment.ContextNames; import org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory; @@ -93,8 +95,8 @@ import org.jboss.msc.service.StopContext; import org.jboss.msc.value.InjectedValue; import org.jboss.security.SubjectFactory; -import org.wildfly.security.auth.client.AuthenticationContext; import org.wildfly.common.function.ExceptionSupplier; +import org.wildfly.security.auth.client.AuthenticationContext; import org.wildfly.security.credential.source.CredentialSource; import org.wildfly.security.manager.WildFlySecurityManager; import org.wildfly.security.manager.action.ClearContextClassLoaderAction; @@ -364,6 +366,20 @@ public CommonDeployment deploy(ServiceContainer serviceContainer) throws DeployE DataSources dataSources = null; if (dataSourceConfig != null) { + String dsClsName = dataSourceConfig.getDataSourceClass(); + if (dsClsName != null) { + try { + Class dsCls = driverClassLoader().loadClass(dsClsName).asSubclass(DataSource.class); + JdbcDriverAdd.checkDSCls(dsCls, DataSource.class); + } catch (OperationFailedException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(e); + } catch (ClassCastException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(ConnectorLogger.ROOT_LOGGER.notAValidDataSourceClass(dsClsName, DataSource.class.getName())); + } catch (ClassNotFoundException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(ConnectorLogger.ROOT_LOGGER.failedToLoadDataSourceClass(dsClsName, e)); + } + } + String driverName = dataSourceConfig.getDriver(); InstalledDriver installedDriver = driverRegistry.getValue().getInstalledDriver(driverName); if (installedDriver != null) { @@ -377,6 +393,20 @@ public CommonDeployment deploy(ServiceContainer serviceContainer) throws DeployE } dataSources = new DatasourcesImpl(Arrays.asList(dataSourceConfig), null, drivers); } else if (xaDataSourceConfig != null) { + String xaDSClsName = xaDataSourceConfig.getXaDataSourceClass(); + if (xaDSClsName != null) { + try { + Class xaDsCls = driverClassLoader().loadClass(xaDSClsName).asSubclass(XADataSource.class); + JdbcDriverAdd.checkDSCls(xaDsCls, XADataSource.class); + } catch (OperationFailedException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(e); + } catch (ClassCastException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(ConnectorLogger.ROOT_LOGGER.notAValidDataSourceClass(xaDSClsName, XADataSource.class.getName())); + } catch (ClassNotFoundException e) { + throw ConnectorLogger.ROOT_LOGGER.cannotDeploy(ConnectorLogger.ROOT_LOGGER.failedToLoadDataSourceClass(xaDSClsName, e)); + } + } + String driverName = xaDataSourceConfig.getDriver(); InstalledDriver installedDriver = driverRegistry.getValue().getInstalledDriver(driverName); if (installedDriver != null) { diff --git a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/JdbcDriverAdd.java b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/JdbcDriverAdd.java index d4f75764867d..9942ce40a489 100644 --- a/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/JdbcDriverAdd.java +++ b/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/JdbcDriverAdd.java @@ -35,9 +35,13 @@ import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; import java.sql.Driver; import java.util.ServiceLoader; +import javax.sql.DataSource; +import javax.sql.XADataSource; + import org.jboss.as.connector.logging.ConnectorLogger; import org.jboss.as.connector.services.driver.DriverService; import org.jboss.as.connector.services.driver.InstalledDriver; @@ -107,6 +111,24 @@ protected void performRuntime(OperationContext context, ModelNode operation, Mod throw new OperationFailedException(ConnectorLogger.ROOT_LOGGER.failedToLoadModuleDriver(moduleName), e); } + if (dataSourceClassName != null) { + Class dsCls; + try { + dsCls = module.getClassLoader().loadClass(dataSourceClassName).asSubclass(DataSource.class); + } catch (ClassNotFoundException | ClassCastException e) { + throw SUBSYSTEM_DATASOURCES_LOGGER.failedToLoadDataSourceClass(dataSourceClassName, e); + } + checkDSCls(dsCls, DataSource.class); + } + if (xaDataSourceClassName != null) { + Class dsCls; + try { + dsCls = module.getClassLoader().loadClass(xaDataSourceClassName).asSubclass(XADataSource.class); + } catch (ClassNotFoundException | ClassCastException e) { + throw SUBSYSTEM_DATASOURCES_LOGGER.failedToLoadDataSourceClass(xaDataSourceClassName, e); + } + checkDSCls(dsCls, XADataSource.class); + } if (driverClassName == null) { final ServiceLoader serviceLoader = module.loadService(Driver.class); boolean driverLoaded = false; @@ -160,5 +182,11 @@ public static void startDriverServices(final ServiceTarget target, final ModuleI builder.install(); } + static void checkDSCls(Class dsCls, Class t) throws OperationFailedException { + if (Modifier.isInterface(dsCls.getModifiers()) || Modifier.isAbstract(dsCls.getModifiers())) { + throw SUBSYSTEM_DATASOURCES_LOGGER.notAValidDataSourceClass(dsCls.getName(), t.getName()); + } + } + } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/DataSourceClassInfoTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/DataSourceClassInfoTestCase.java index f0a4d473c96b..59d2f03bc8fb 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/DataSourceClassInfoTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/DataSourceClassInfoTestCase.java @@ -27,14 +27,12 @@ import static org.jboss.as.controller.client.helpers.ClientConstants.OP_ADDR; import static org.jboss.as.controller.client.helpers.ClientConstants.READ_ATTRIBUTE_OPERATION; -import com.google.common.collect.Iterables; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.junit.Arquillian; import org.jboss.as.controller.client.helpers.Operations; import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase; import org.jboss.dmr.ModelNode; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,7 +42,6 @@ @RunWith(Arquillian.class) @RunAsClient public class DataSourceClassInfoTestCase extends ContainerResourceMgmtTestBase { - private static final String DRIVER_WITH_WRONG_DS_CLASS_NAME = "h2-wrong-ds-class"; private ModelNode getDsClsInfoOperation(String driverName) { ModelNode driverAddress = new ModelNode(); @@ -155,61 +152,4 @@ public void testGetInstalledDriver() throws Exception { Assert.assertEquals("int", dsInfo.get("loginTimeout").asString()); } - @Test - @Ignore("https://issues.jboss.org/browse/WFCORE-3682") - public void testGetDsClsInfoWithWrongDataSourceClass() throws Exception { - ModelNode driverWithWrongDsClsAddr = new ModelNode(); - driverWithWrongDsClsAddr.add("subsystem", "datasources"); - driverWithWrongDsClsAddr.add("jdbc-driver", DRIVER_WITH_WRONG_DS_CLASS_NAME); - - addH2DriverWithWrongDsClass(driverWithWrongDsClsAddr); - - ModelNode op = Operations.createReadResourceOperation(driverWithWrongDsClsAddr); - op.get(INCLUDE_RUNTIME).set(true); - - try { - ModelNode result = getManagementClient().getControllerClient().execute(op); - Assert.assertNotNull(result); - Assert.assertEquals("failed", result.get("outcome").asString()); - Assert.assertTrue(result.hasDefined("failure-description")); - } finally { - removeDriver(driverWithWrongDsClsAddr); - } - } - - @Test - public void testGetDsClsInfoByReadAttributeWithWrongDataSourceClass() throws Exception { - ModelNode driverWithWrongDsClsAddr = new ModelNode(); - driverWithWrongDsClsAddr.add("subsystem", "datasources"); - driverWithWrongDsClsAddr.add("jdbc-driver", DRIVER_WITH_WRONG_DS_CLASS_NAME); - - addH2DriverWithWrongDsClass(driverWithWrongDsClsAddr); - - ModelNode op = Operations.createReadAttributeOperation(driverWithWrongDsClsAddr, "datasource-class-info"); - - try { - ModelNode result = getManagementClient().getControllerClient().execute(op); - Assert.assertNotNull(result); - Assert.assertEquals("failed", result.get("outcome").asString()); - Assert.assertTrue(result.hasDefined("failure-description")); - } finally { - removeDriver(driverWithWrongDsClsAddr); - } - } - - private void addH2DriverWithWrongDsClass(ModelNode driverAddress) throws Exception { - ModelNode op = Operations.createAddOperation(driverAddress); - op.get("driver-name").set(Iterables.getLast(driverAddress.asList()).get("jdbc-driver")); - op.get("driver-module-name").set("com.h2database.h2"); - op.get("driver-xa-datasource-class-name").set("non.existing.class"); - - ModelNode result = getManagementClient().getControllerClient().execute(op); - Assert.assertNotNull(result); - Assert.assertEquals("success", result.get("outcome").asString()); - } - - private void removeDriver(ModelNode driverAddress) throws Exception { - ModelNode op = Operations.createRemoveOperation(driverAddress); - getManagementClient().getControllerClient().execute(op); - } } \ No newline at end of file diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DatasourceWrongDsClassTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DatasourceWrongDsClassTestCase.java new file mode 100644 index 000000000000..6c530d16a75a --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DatasourceWrongDsClassTestCase.java @@ -0,0 +1,141 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2018, Red Hat, Inc., 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.datasource; + +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.SUBSYSTEM; + +import java.sql.Driver; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.container.test.api.RunAsClient; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.as.test.integration.jca.JcaMgmtBase; +import org.jboss.as.test.integration.management.util.MgmtOperationException; +import org.jboss.as.test.integration.management.util.ModelUtil; +import org.jboss.dmr.ModelNode; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Test the situation when abstract DataSource class is specified when creating a data source. + * + * @author lgao + */ +@RunWith(Arquillian.class) +@RunAsClient +public class DatasourceWrongDsClassTestCase extends JcaMgmtBase { + + private static final String DEPLOYMENT = "dummydriver"; + + @Deployment(name = DEPLOYMENT) + public static JavaArchive jdbcArchive() throws Exception { + JavaArchive ja = ShrinkWrap.create(JavaArchive.class, DEPLOYMENT + ".jar"); + ja.addClasses(DummyDataSource.class, DummyXADataSource.class, TestDriver.class); + ja.addAsServiceProviderAndClasses(Driver.class, TestDriver.class); + return ja; + } + + @Test + public void testWrongDSClass() throws Exception { + String driverName = DEPLOYMENT + ".jar"; + ModelNode address = getDataSourceAddress("wrongClsDs"); + ModelNode operation = getDataSourceOperation(address, "java:/wrongClsDs", driverName, DummyDataSource.class.getName()); + try { + executeOperation(operation); + Assert.fail("Not supposed to succeed"); + } catch (MgmtOperationException e) { + ModelNode result = e.getResult(); + Assert.assertEquals("failed", result.get("outcome").asString()); + String failDesc = result.get("failure-description").asString(); + Assert.assertTrue(failDesc.contains("WFLYJCA0117")); + return; + } + Assert.fail("Not supposed to be here"); + } + + @Test + public void testWrongXADSClass() throws Exception { + String driverName = DEPLOYMENT + ".jar"; + ModelNode address = getXADataSourceAddress("wrongXAClsDs"); + ModelNode operation = getXADataSourceOperation(address, "java:/wrongXAClsDs", driverName, DummyXADataSource.class.getName()); + try { + executeOperation(operation); + Assert.fail("Not supposed to succeed"); + } catch (MgmtOperationException e) { + ModelNode result = e.getResult(); + Assert.assertEquals("failed", result.get("outcome").asString()); + return; + } + Assert.fail("Not supposed to be here"); + } + + private ModelNode getXADataSourceAddress(String xaDsName) { + ModelNode address = new ModelNode() + .add(SUBSYSTEM, "datasources") + .add("xa-data-source", xaDsName); + return address; + } + + private ModelNode getDataSourceAddress(String dsName) { + ModelNode address = new ModelNode() + .add(SUBSYSTEM, "datasources") + .add("data-source", dsName); + return address; + } + + private ModelNode getDataSourceOperation(ModelNode address, String jndiName, String driverName, String dsClsName) { + ModelNode operation = new ModelNode(); + operation.get(OP).set(ADD); + operation.get(OP_ADDR).set(address); + operation.get("jndi-name").set(jndiName); + operation.get("driver-name").set(driverName); + operation.get("datasource-class").set(dsClsName); + return operation; + } + + private ModelNode getXADataSourceOperation(ModelNode address, String jndiName, String driverName, String xaDsClsName) { + ModelNode addOp = new ModelNode(); + addOp.get(OP).set(ADD); + addOp.get(OP_ADDR).set(address); + addOp.get("jndi-name").set(jndiName); + addOp.get("driver-name").set(driverName); + addOp.get("xa-datasource-class").set(xaDsClsName); + + ModelNode connProps = new ModelNode(); + connProps.get(OP).set(ADD); + ModelNode connPropAdd = address.add("connection-properties", "url"); + connProps.get(OP_ADDR).set(connPropAdd); + connProps.get("value").set("dummy"); + List operationList = new ArrayList<>(Arrays.asList(addOp, connProps)); + return ModelUtil.createCompositeNode(operationList.toArray(new ModelNode[1])); + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DummyDataSource.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DummyDataSource.java new file mode 100644 index 000000000000..3f601f3bb557 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/DummyDataSource.java @@ -0,0 +1,34 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2018, Red Hat, Inc., 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.datasource; + +import javax.sql.DataSource; + +/** + * Dummy abstract DataSource, used to verify that it cannot be specified during data source setup. + * + * @author Lin Gao + */ +public abstract class DummyXADataSource implements XADataSource { + +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/TestDriver.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/TestDriver.java new file mode 100644 index 000000000000..2b90ccde6585 --- /dev/null +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/datasource/TestDriver.java @@ -0,0 +1,87 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2018, Red Hat, Inc., 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.datasource; + +import java.sql.Connection; +import java.sql.Driver; +import java.sql.DriverManager; +import java.sql.DriverPropertyInfo; +import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; +import java.util.Properties; +import java.util.logging.Logger; + +/** + * Test JDBC driver + */ +public class TestDriver implements Driver { + /** + * {@inheritDoc} + */ + public Connection connect(String url, Properties info) throws SQLException { + return null; + } + + /** + * {@inheritDoc} + */ + public boolean acceptsURL(String url) throws SQLException { + return true; + } + + /** + * {@inheritDoc} + */ + public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { + Driver driver = DriverManager.getDriver(url); + return driver.getPropertyInfo(url, info); + } + + /** + * {@inheritDoc} + */ + public int getMajorVersion() { + return 1; + } + + /** + * {@inheritDoc} + */ + public int getMinorVersion() { + return 0; + } + + /** + * {@inheritDoc} + */ + public boolean jdbcCompliant() { + return false; + } + + /** + * {@inheritDoc} + */ + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException(); + } +} diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/DriverCfgMetricUnitTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/DriverCfgMetricUnitTestCase.java index cb928ce83e92..dee37dc18058 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/DriverCfgMetricUnitTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/DriverCfgMetricUnitTestCase.java @@ -49,8 +49,7 @@ public static void before() { public void testDriverAttributes() throws Exception { setModel("complex-driver.xml"); assertEquals("name", readAttribute(baseAddress, "driver-name").asString()); - assertEquals("DsClass", readAttribute(baseAddress, "driver-datasource-class-name").asString()); - assertEquals("XaDsClass", readAttribute(baseAddress, "driver-xa-datasource-class-name").asString()); + assertEquals("org.h2.jdbcx.JdbcDataSource", readAttribute(baseAddress, "driver-xa-datasource-class-name").asString()); removeDs(); } diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml index e4f4d118ee87..a17f597df6c5 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/metrics/data-sources/complex-driver.xml @@ -3,8 +3,7 @@ org.h2.Driver - DsClass - XaDsClass + org.h2.jdbcx.JdbcDataSource