Search in sources :

Example 6 with DriverDeploymentInfo

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();
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) DataSourceDef(org.kie.workbench.common.screens.datasource.management.model.DataSourceDef) DriverDef(org.kie.workbench.common.screens.datasource.management.model.DriverDef) DataSourceDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo) Before(org.junit.Before)

Example 7 with DriverDeploymentInfo

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());
    }
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) ExpectedException(org.junit.rules.ExpectedException) Test(org.junit.Test)

Example 8 with DriverDeploymentInfo

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);
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) Test(org.junit.Test)

Example 9 with DriverDeploymentInfo

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);
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) Test(org.junit.Test)

Example 10 with DriverDeploymentInfo

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);
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) Test(org.junit.Test)

Aggregations

DriverDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo)21 Test (org.junit.Test)8 DataSourceDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo)4 DriverProviderBaseTest (org.kie.workbench.common.screens.datasource.management.backend.core.DriverProviderBaseTest)3 URI (java.net.URI)2 ExpectedException (org.junit.rules.ExpectedException)2 DataSourceDef (org.kie.workbench.common.screens.datasource.management.model.DataSourceDef)2 DriverDef (org.kie.workbench.common.screens.datasource.management.model.DriverDef)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 WildflyDataSourceDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef)1 WildflyDriverDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef)1 DriverDefInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDefInfo)1