use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DataSourceRuntimeManagerTest method setup.
@Before
public void setup() {
when(providerFactory.getDataSourceProvider()).thenReturn(dataSourceProvider);
when(providerFactory.getDriverProvider()).thenReturn(driverProvider);
runtimeManager = new DataSourceRuntimeManagerMock(providerFactory);
dataSourceDef = new DataSourceDef();
dataSourceDef.setUuid(DS1_UUID);
dataSourceDef.setName(DS1_NAME);
dataSourceDef.setDriverUuid(DRIVER1_UUID);
dataSourceDef.setConnectionURL(DS1_CONNECTION_URL);
dataSourceDef.setUser(DS1_USER);
dataSourceDef.setPassword(DS1_PASSWORD);
driverDef = new DriverDef();
driverDef.setUuid(DRIVER1_UUID);
driverDef.setName(DRIVER1_NAME);
driverDef.setDriverClass(DRIVER1_CLASS);
driverDef.setArtifactId(ARTIFACT_ID);
driverDef.setGroupId(GROUP_ID);
driverDef.setVersion(VERSION);
driverDeploymentInfo = new DriverDeploymentInfo();
dataSourceDeploymentInfo = new DataSourceDeploymentInfo();
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DataSourceRuntimeManagerTest method testGetDriverDeploymentInfo.
/**
* Tests the deployment info retrieval for a driver.
*/
@Test
public void testGetDriverDeploymentInfo() {
try {
// simulate we have an already deployed driver
deployDriver(driverDef);
DriverDeploymentInfo deploymentInfo = runtimeManager.getDriverDeploymentInfo(driverDef.getUuid());
assertNotNull(deploymentInfo);
} catch (Exception e) {
fail(e.getMessage());
}
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DriverProviderBaseTest method testGetDeploymentInfoForNotDeployedDriver.
/**
* Tests the querying of the deployment information for a driver that wasn't deployed.
*/
@Test
public void testGetDeploymentInfoForNotDeployedDriver() throws Exception {
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(DRIVER1_UUID);
// a null value should have been returned since the driver wasn't deployed.
assertNull(deploymentInfo);
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DriverProviderBaseTest method testUnDeployDriver.
@Test
public void testUnDeployDriver() throws Exception {
// deploy the driver
deployDriver(driverDef1);
// the deployment info should be returned.
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(driverDef1.getUuid());
// un-deploy the driver.
unDeployDriver(deploymentInfo);
// query the deployment info again
deploymentInfo = driverProvider.getDeploymentInfo(driverDef1.getUuid());
// no deployment info should have been returned.
assertNull(deploymentInfo);
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DriverProviderBaseTest method testGetDeploymentInfoForDeployedDriver.
/**
* Tests the querying of the deployment information for a driver that was previously deployed.
*/
@Test
public void testGetDeploymentInfoForDeployedDriver() throws Exception {
deployDriver(driverDef1);
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(DRIVER1_UUID);
// a non null value should have been returned since de driver was deployed.
assertNotNull(deploymentInfo);
}
Aggregations