@Override public DriverDeploymentInfo getDriverDeploymentInfo(String uuid) { try { return runtimeManager.getDriverDeploymentInfo(uuid); } catch (Exception e) { throw new GenericPortableException(e.getMessage(), e); } }
@Override public DataSourceDeploymentInfo getDataSourceDeploymentInfo(String uuid) { try { return runtimeManager.getDataSourceDeploymentInfo(uuid); } catch (Exception e) { throw new GenericPortableException(e.getMessage(), e); } }
/** * Helper to return a @Portable RuntimeException. * @param e * @return */ public static RuntimeException handleException(final Exception e) { logger.error("Exception thrown: " + e.getMessage(), e); if (EnvUtil.isPortableType(e.getClass())) { if (e instanceof RuntimeException) { return (RuntimeException) e; } else { return new GenericPortableException(e.getMessage(), e); } } return new GenericPortableException(e.getMessage(), e); } }
/** * Helper to return a @Portable RuntimeException. * @param e * @return */ public static RuntimeException handleException(final Exception e) { logger.error("Exception thrown: " + e.getMessage(), e); if (EnvUtil.isPortableType(e.getClass())) { if (e instanceof RuntimeException) { return (RuntimeException) e; } else { return new GenericPortableException(e.getMessage(), e); } } return new GenericPortableException(e.getMessage(), e); } }
/** * Helper to return a @Portable RuntimeException. * @param e * @return */ public static RuntimeException handleException(final Exception e) { logger.error("Exception thrown: " + e.getMessage(), e); if (EnvUtil.isPortableType(e.getClass())) { if (e instanceof RuntimeException) { return (RuntimeException) e; } else { return new GenericPortableException(e.getMessage(), e); } } return new GenericPortableException(e.getMessage(), e); } }
@Override public DatabaseMetadata getMetadata(String dataSourceUuid, boolean includeCatalogs, boolean includeSchemas) { checkNotNull("dataSourceUuid", dataSourceUuid); try { DataSource dataSource = dataSourceRuntimeManager.lookupDataSource(dataSourceUuid); return DatabaseMetadataUtil.getMetadata(dataSource.getConnection(), includeCatalogs, includeSchemas); } catch (Exception e) { logger.error("It was not possible to get database metadata for data source: " + dataSourceUuid, e); throw new GenericPortableException("It was not possible to get database metadata for data source: " + dataSourceUuid + ": " + e.getMessage(), e); } }
@Override public List<TableMetadata> findTables(String dataSourceUuid, String schema, String tableNamePattern, DatabaseMetadata.TableType... types) { checkNotNull("dataSourceUuid", dataSourceUuid); checkNotNull("types", types); try { DataSource dataSource = dataSourceRuntimeManager.lookupDataSource(dataSourceUuid); return DatabaseMetadataUtil.findTables(dataSource.getConnection(), schema, tableNamePattern, types); } catch (Exception e) { logger.error("It was not possible to get database metadata for data source: " + dataSourceUuid, e); throw new GenericPortableException("It was not possible to get database metadata for data source: " + dataSourceUuid + ": " + e.getMessage(), e); } } }
@Test public void errorPopupDisplayedWhenFormAlreadyExists() { when(fmServiceMock.createForm(any(Path.class), anyString())) .thenThrow(new GenericPortableException("File already exists.")); testedHandler.create(packageMock, "existingForm", nrpresenterMock); verify(errorPopupMock).showMessage(CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother()); }
public TestScenarioResult run(final String identifier, final Scenario scenario, final KieModule module) { try { final HashMap<String, KieSession> ksessions = new HashMap<String, KieSession>(); final String ksessionName = getKSessionName(scenario.getKSessions()); ksessions.put(ksessionName, loadKSession(module, ksessionName)); final AuditLogger auditLogger = new AuditLogger(ksessions); final ScenarioRunner4JUnit scenarioRunner = new ScenarioRunner4JUnit( scenario, ksessions, getMaxRuleFirings()); run(identifier, scenarioRunner, defaultTestResultMessageEvent); return new TestScenarioResult(scenario, auditLogger.getLog()); } catch (InitializationError initializationError) { throw new GenericPortableException(initializationError.getMessage()); } }
public TestScenarioResult run(final String identifier, final Scenario scenario, final KieModule module) { try { final HashMap<String, KieSession> ksessions = new HashMap<String, KieSession>(); final String ksessionName = getKSessionName(scenario.getKSessions()); ksessions.put(ksessionName, loadKSession(module, ksessionName)); final AuditLogger auditLogger = new AuditLogger(ksessions); final ScenarioRunner4JUnit scenarioRunner = new ScenarioRunner4JUnit( scenario, ksessions, getMaxRuleFirings()); run(identifier, scenarioRunner, defaultTestResultMessageEvent); return new TestScenarioResult(scenario, auditLogger.getLog()); } catch (InitializationError initializationError) { throw new GenericPortableException(initializationError.getMessage()); } }
throw new GenericPortableException(e.getMessage());