Search in sources :

Example 6 with WildflyDataSourceDef

use of org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef in project kie-wb-common by kiegroup.

the class WildflyDataSourceProviderTest method testDeployDataSource.

@Override
public void testDeployDataSource() throws Exception {
    super.testDeployDataSource();
    // additional check
    // expected WF data source definition that should be created in the WF server.
    WildflyDataSourceDef wfDataSource = new WildflyDataSourceDef();
    wfDataSource.setName(DeploymentIdGenerator.generateDeploymentId(dataSourceDef));
    wfDataSource.setConnectionURL(dataSourceDef.getConnectionURL());
    wfDataSource.setUser(dataSourceDef.getUser());
    wfDataSource.setPassword(dataSourceDef.getPassword());
    wfDataSource.setDriverName(DRIVER1_DEPLOYMENT_ID);
    wfDataSource.setJndi(JndiNameGenerator.generateJNDIName(dataSourceDef));
    // the expected WF data source definition should have been created in the WF server.
    ArgumentCaptor<WildflyDataSourceDef> argumentCaptor = ArgumentCaptor.forClass(WildflyDataSourceDef.class);
    verify(managementClient, times(1)).createDataSource(argumentCaptor.capture());
    if (!areTheSame(wfDataSource, argumentCaptor.getValue())) {
        fail("Data source definition wasn't properly created in the WF server: " + wfDataSource);
    }
}
Also used : WildflyDataSourceDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef)

Aggregations

WildflyDataSourceDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef)6 ArrayList (java.util.ArrayList)3 DataSourceDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo)2 DataSourceDef (org.kie.workbench.common.screens.datasource.management.model.DataSourceDef)1 DriverDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo)1