Search in sources :

Example 16 with DriverDef

use of org.kie.workbench.common.screens.datasource.management.model.DriverDef in project kie-wb-common by kiegroup.

the class DriverDefEditorServiceTest method setup.

@Before
public void setup() {
    super.setup();
    editorService = new DriverDefEditorServiceImpl(runtimeManager, serviceHelper, ioService, moduleService, optionsFactory, pathNamingService, artifactResolver, newDriverEvent, updateDriverEvent, deleteDriverEvent);
    driverDef = new DriverDef();
    driverDef.setUuid("uuid");
    driverDef.setName("driverName");
    driverDef.setDriverClass(TestDriver.class.getName());
    driverDef.setGroupId("groupId");
    driverDef.setArtifactId("artifactId");
    driverDef.setVersion("version");
    driverDefEditorContent = new DriverDefEditorContent();
    driverDefEditorContent.setDef(driverDef);
    driverDefEditorContent.setModule(module);
    originalDriverDef = new DriverDef();
    originalDriverDef.setUuid("uuid");
    originalDriverDef.setName("driverNameOriginal");
    originalDriverDef.setDriverClass(TestDriver.class.getName());
    originalDriverDef.setGroupId("groupIdOriginal");
    originalDriverDef.setArtifactId("artifactIdOriginal");
    originalDriverDef.setVersion("versionOriginal");
    try {
        URL resource = getClass().getClassLoader().getResource("DataSourceFiles");
        uri = resource.toURI();
        when(artifactResolver.resolve(driverDef.getGroupId(), driverDef.getArtifactId(), driverDef.getVersion())).thenReturn(uri);
    } catch (Exception e) {
        fail(e.getMessage());
    }
}
Also used : DriverDefEditorContent(org.kie.workbench.common.screens.datasource.management.model.DriverDefEditorContent) DriverDef(org.kie.workbench.common.screens.datasource.management.model.DriverDef) URL(java.net.URL) Before(org.junit.Before)

Example 17 with DriverDef

use of org.kie.workbench.common.screens.datasource.management.model.DriverDef in project kie-wb-common by kiegroup.

the class AbstractDefChangeHandlerTest method setup.

@Before
public void setup() {
    setupChangeHandler();
    when(serviceHelper.getDefRegistry()).thenReturn(defRegistry);
    when(moduleService.resolveModule(path)).thenReturn(module);
    when(sessionInfo.getId()).thenReturn(SESSION_ID);
    when(sessionInfo.getIdentity()).thenReturn(identity);
    when(identity.getIdentifier()).thenReturn(IDENTIFIER);
    dataSourceDef = new DataSourceDef();
    dataSourceDef.setUuid("uuid");
    dataSourceDef.setName("dataSourceName");
    dataSourceDef.setConnectionURL("connectionURL");
    dataSourceDef.setUser("user");
    dataSourceDef.setPassword("password");
    driverDef = new DriverDef();
    driverDef.setUuid("uuid");
    driverDef.setName("driverName");
    driverDef.setDriverClass(TestDriver.class.getName());
    driverDef.setGroupId("groupId");
    driverDef.setArtifactId("artifactId");
    driverDef.setVersion("version");
    when(registeredDataSourceDef.getUuid()).thenReturn("registeredDataSourceUuid");
    when(registeredDataSourceDeploymentInfo.getUuid()).thenReturn("registeredDataSourceUuid");
    when(originalDataSourceDef.getUuid()).thenReturn("originalDataSourceUuid");
    when(originalDatasourceDeploymentInfo.getUuid()).thenReturn("originalDataSourceUuid");
    when(registeredDriverDef.getUuid()).thenReturn("registeredDriverDefUuid");
    when(registeredDriverDeploymentInfo.getUuid()).thenReturn("registeredDriverDefUuid");
    when(originalDriverDef.getUuid()).thenReturn("originalDriverDefUuid");
    when(originalDriverDeploymentInfo.getUuid()).thenReturn("originalDriverDefUuid");
}
Also used : DataSourceDef(org.kie.workbench.common.screens.datasource.management.model.DataSourceDef) DriverDef(org.kie.workbench.common.screens.datasource.management.model.DriverDef) TestDriver(org.kie.workbench.common.screens.datasource.management.backend.service.TestDriver) Before(org.junit.Before)

Example 18 with DriverDef

use of org.kie.workbench.common.screens.datasource.management.model.DriverDef in project kie-wb-common by kiegroup.

the class DriverDefValidatorTest method setup.

@Before
public void setup() {
    driverDef = new DriverDef();
    driverDef.setUuid(VALUE);
    driverDef.setName(VALUE);
    driverDef.setDriverClass(VALUE);
    driverDef.setGroupId(VALUE);
    driverDef.setArtifactId(VALUE);
    driverDef.setVersion(VALUE);
}
Also used : DriverDef(org.kie.workbench.common.screens.datasource.management.model.DriverDef) Before(org.junit.Before)

Aggregations

DriverDef (org.kie.workbench.common.screens.datasource.management.model.DriverDef)18 Before (org.junit.Before)6 URI (java.net.URI)4 Properties (java.util.Properties)3 DriverDefEditorContent (org.kie.workbench.common.screens.datasource.management.model.DriverDefEditorContent)3 URLConnectionFactory (org.kie.workbench.common.screens.datasource.management.util.URLConnectionFactory)3 ArrayList (java.util.ArrayList)2 ClientValidationServiceMock (org.kie.workbench.common.screens.datasource.management.client.util.ClientValidationServiceMock)2 DataSourceDef (org.kie.workbench.common.screens.datasource.management.model.DataSourceDef)2 DataSourceDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo)2 DriverDefInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDefInfo)2 DriverDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo)2 URL (java.net.URL)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 HashSet (java.util.HashSet)1 ConnectionFactory (org.apache.commons.dbcp2.ConnectionFactory)1 PoolableConnection (org.apache.commons.dbcp2.PoolableConnection)1 PoolableConnectionFactory (org.apache.commons.dbcp2.PoolableConnectionFactory)1 PoolingDataSource (org.apache.commons.dbcp2.PoolingDataSource)1