use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DriverProviderBaseTest method testDeployDriver.
@Test
public void testDeployDriver() throws Exception {
// the driver is deployed
deployDriver(driverDef1);
// then the deployment info should be returned.
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(driverDef1.getUuid());
assertNotNull(deploymentInfo);
assertTrue(deploymentInfo.isManaged());
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class WildflyDriverProviderTest method testDeployDriver.
/**
* Tests a driver deployment.
*/
@Test
public void testDeployDriver() throws Exception {
super.testDeployDriver();
// the driver should have been deployed by using the management client.
verify(managementClient, times(1)).deploy(DRIVER1_DEPLOYMENT_ID, driver1Uri);
DriverDeploymentInfo expectedDeploymentInfo = new DriverDeploymentInfo(DRIVER1_DEPLOYMENT_ID, DRIVER1_DEPLOYMENT_ID, true, DRIVER1_UUID, DRIVER1_CLASS);
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(driverDef1.getUuid());
assertEquals(expectedDeploymentInfo, deploymentInfo);
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class WildflyDriverProviderTest method testDriverResync.
/**
* Tests the resync of a driver.
*/
@Test
public void testDriverResync() throws Exception {
when(managementClient.getDeployedDrivers()).thenReturn(wfDrivers);
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(DRIVER1_UUID);
// the deployment exists by construction but is not managed.
assertNotNull(deploymentInfo);
assertFalse(deploymentInfo.isManaged());
driverProvider.resync(driverDef1, deploymentInfo);
deploymentInfo = driverProvider.getDeploymentInfo(DRIVER1_UUID);
// after the resync operation the should have been tagged as managed.
assertNotNull(deploymentInfo);
assertTrue(deploymentInfo.isManaged());
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DataSourceDefQueryServiceImpl method createDriverInfo.
private DriverDefInfo createDriverInfo(final org.uberfire.java.nio.file.Path path) {
String content = ioService.readAllString(path);
DriverDef driverDef = DriverDefSerializer.deserialize(content);
DriverDeploymentInfo deploymentInfo = null;
try {
deploymentInfo = runtimeManager.getDriverDeploymentInfo(driverDef.getUuid());
} catch (Exception e) {
logger.warn("It was not possible to read deployment info when building DriverDefInfo for driver: " + driverDef.getUuid(), e);
}
return new DriverDefInfo(driverDef.getUuid(), driverDef.getName(), Paths.convert(path), deploymentInfo);
}
use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.
the class DataSourceRuntimeManagerImpl method getDriverDeploymentInfo.
@Override
public synchronized DriverDeploymentInfo getDriverDeploymentInfo(String uuid) throws Exception {
try {
DriverDeploymentInfo deploymentInfo = driverProvider.getDeploymentInfo(uuid);
if (deploymentInfo != null && driverDeploymentCache.get(deploymentInfo) != null) {
DriverDeploymentInfo updatedInfo = new DriverDeploymentInfo(deploymentInfo.getDeploymentId(), deploymentInfo.getDriverDeploymentId(), deploymentInfo.isManaged(), deploymentInfo.getUuid(), deploymentInfo.getDriverClass());
updatedInfo.getDependants().addAll(driverDeploymentCache.get(deploymentInfo).getDependants());
deploymentInfo = updatedInfo;
}
return deploymentInfo;
} catch (Exception e) {
logger.error("It was not possible to read the deploymentInfo for driver: " + uuid);
throw e;
}
}
Aggregations