protected boolean useScriptFileLastModificationDates() { return PropertyUtils.getBoolean(PROPKEY_USESCRIPTFILELASTMODIFICATIONDATES, configuration); }
/** * Initializes the parser with the given configuration settings. * * @param configuration The config, not null * @param scriptReader the script stream, not null */ public void init(Properties configuration, Reader scriptReader) { boolean backSlashEscapingEnabled = PropertyUtils.getBoolean(PROPKEY_BACKSLASH_ESCAPING_ENABLED, configuration); this.initialParsingState = createInitialParsingState(backSlashEscapingEnabled); this.currentParsingState = initialParsingState; this.scriptReader = new BufferedReader(scriptReader); }
/** * Initializes this module using the given configuration. * * @param configuration The configuration, not null */ @Override public void init(Properties configuration) { defaultAnnotationPropertyValues = getAnnotationPropertyDefaults(InjectModule.class, configuration, InjectInto.class, InjectIntoStatic.class, InjectIntoByType.class, InjectIntoStaticByType.class); createTestedObjectsIfNullEnabled = PropertyUtils.getBoolean(PROPKEY_CREATE_TESTEDOBJECTS_IF_NULL_ENABLED, configuration); }
public DataSourceWrapper(DatabaseConfiguration databaseConfiguration, Properties unitilsConfig, UnitilsTransactionManager transactionmanager) { // Get the factory for the data source and create it configuration = unitilsConfig; dataSourceFactory = ConfigUtils.getConfiguredInstanceOf(DataSourceFactory.class, configuration); dataSourceFactory.init(databaseConfiguration); updateDatabaseSchemaEnabled = PropertyUtils.getBoolean(DatabaseModule.PROPERTY_UPDATEDATABASESCHEMA_ENABLED, configuration); wrapDataSourceInTransactionalProxy = PropertyUtils.getBoolean(DatabaseModule.PROPERTY_WRAP_DATASOURCE_IN_TRANSACTIONAL_PROXY, configuration); databaseName = databaseConfiguration.getDatabaseName(); this.databaseConfiguration = databaseConfiguration; this.transactionManager = transactionmanager; }
/** * @param wrapper the wrapper to set */ public void setWrapper(DataSourceWrapper wrapper) { if (!wrappers.keySet().contains(wrapper.getDatabaseName())) { wrappers.put(wrapper.getDatabaseName(), wrapper); registerTransactionManagementConfiguration(wrapper); if (PropertyUtils.getBoolean(PROPERTY_RESET_SEQUENCES, false, configuration)) { wrapper.restartSequences(); } } }
/** * Initializes the resolver with the given configuration. * * @param configuration The configuration, not null */ public void init(Properties configuration) { boolean prefixWithPackageName = getBoolean(PROPKEY_PREFIX_WITH_PACKAGE_NAME, configuration); String pathPrefix = getString(PROPKEY_DATA_SET_PATH_PREFIX, null, configuration); this.fileResolver = new FileResolver(prefixWithPackageName, pathPrefix); }
/** * Initializes this module using the given <code>Configuration</code> * * @param configuration The config, not null */ @SuppressWarnings("unchecked") public void init(Properties configuration) { this.configuration = configuration; DatabaseConfigurationsFactory configFactory = new DatabaseConfigurationsFactory(new Configuration(configuration)); databaseConfigurations = configFactory.create(); defaultAnnotationPropertyValues = getAnnotationPropertyDefaults(DatabaseModule.class, configuration, Transactional.class); updateDatabaseSchemaEnabled = PropertyUtils.getBoolean(PROPERTY_UPDATEDATABASESCHEMA_ENABLED, configuration); wrapDataSourceInTransactionalProxy = PropertyUtils.getBoolean(PROPERTY_WRAP_DATASOURCE_IN_TRANSACTIONAL_PROXY, configuration); PlatformTransactionManager.class.getName(); }
scriptSource = ConfigUtils.getConfiguredInstanceOf(ScriptSource.class, configuration); boolean cleanDbEnabled = PropertyUtils.getBoolean(PROPKEY_DB_CLEANER_ENABLED, configuration); if (cleanDbEnabled) { dbCleaner = getConfiguredDatabaseTaskInstance(DBCleaner.class, configuration, sqlHandler, dialect, schemaNames); fromScratchEnabled = PropertyUtils.getBoolean(PROPKEY_FROM_SCRATCH_ENABLED, configuration); keepRetryingAfterError = PropertyUtils.getBoolean(PROPKEY_KEEP_RETRYING_AFTER_ERROR_ENABLED, configuration); if (fromScratchEnabled) { dbClearer = getConfiguredDatabaseTaskInstance(DBClearer.class, configuration, sqlHandler, dialect, schemaNames); disableConstraintsEnabled = PropertyUtils.getBoolean(PROPKEY_DISABLE_CONSTRAINTS_ENABLED, configuration); constraintsDisabler = getConfiguredDatabaseTaskInstance(ConstraintsDisabler.class, configuration, sqlHandler, dialect, schemaNames); boolean updateSequences = PropertyUtils.getBoolean(PROPKEY_UPDATE_SEQUENCES_ENABLED, configuration); if (updateSequences) { sequenceUpdater = getConfiguredDatabaseTaskInstance(SequenceUpdater.class, configuration, sqlHandler, dialect, schemaNames); boolean generateDtd = PropertyUtils.getBoolean(PROPKEY_GENERATE_DATA_SET_STRUCTURE_ENABLED, configuration); if (generateDtd) { dataSetStructureGenerator = getConfiguredDatabaseTaskInstance(DataSetStructureGenerator.class, configuration, sqlHandler, dialect, schemaNames);
@Override public void init(Properties properties) { String url = PropertyUtils.getString(packageName + ".url", properties); String devkey = PropertyUtils.getString(packageName + ".devkey", properties); String username = PropertyUtils.getString(packageName + ".username", properties); String projectName = PropertyUtils.getString(packageName + ".project", properties); String testPlanId = PropertyUtils.getString(packageName + ".testPlan", properties); String buildName = PropertyUtils.getString(packageName + ".buildName", properties); Boolean overwrite = PropertyUtils.getBoolean(packageName + ".overwrite", true, properties); String xmlRpcLocation = PropertyUtils.getString(packageName + ".xmlRpcLocation", null, properties); Boolean createTestIfNeeded = PropertyUtils.getBoolean(packageName + ".createTestIfNeeded", false, properties); Boolean createPlanIfNeeded = PropertyUtils.getBoolean(packageName + ".createTestPlanIfNeeded", false, properties); Boolean assignTestToPlan = PropertyUtils.getBoolean(packageName + ".assingTestIfNeeded", false, properties); if (LOGGER.isInfoEnabled()) { LOGGER.info("Connection to testlink will be made with url " + url + " ; devkey " + devkey + " ; projectName " + projectName + " ; testPlan " + testPlanId); } TestLinkConnectorFactory factory = new TestLinkConnectorFactory(url, devkey, projectName,username, xmlRpcLocation); connector = factory.create(testPlanId, overwrite, buildName, createPlanIfNeeded, createTestIfNeeded, assignTestToPlan); }
public FileResolvingStrategy createFileResolvingStrategy(Properties configuration) { boolean prefixWithPackageName = getBoolean(PREFIX_WITH_PACKAGE_NAME_PROPERTY, configuration); String pathPrefix = getString(PATH_PREFIX_PROPERTY, null, configuration); FileResolver fileResolver = new FileResolver(prefixWithPackageName, pathPrefix); return new DefaultFileResolvingStrategy(fileResolver); } }
public TestListener getTestListener() { boolean cleanUpAfterTest = getBoolean(CLEANUP_AFTER_TEST, configuration); FileContentAnnotationHandler fileContentAnnotationHandler = new FileContentAnnotationHandler(fileContentReader); TempFileAnnotationHandler tempFileAnnotationHandler = new TempFileAnnotationHandler(tempService, cleanUpAfterTest); TempDirAnnotationHandler tempDirAnnotationHandler = new TempDirAnnotationHandler(tempService, cleanUpAfterTest); return new IOTestListener(fileContentAnnotationHandler, tempFileAnnotationHandler, tempDirAnnotationHandler); }
if (PropertyUtils.getBoolean(WebDriverModule.LOGGINGPROP_CONSOLE_ENABLED, false, configuration)) { LOGGER.info("BEGIN CONSOLE TEST: " + testMethod.getName());
/** * Initializes the name of the version table and its columns using the given configuration. * * @param configuration the configuration, not null */ @Override protected void doInit(Properties configuration) { this.executedScriptsTableName = defaultDbSupport.toCorrectCaseIdentifier( PropertyUtils.getString(PROPERTY_EXECUTED_SCRIPTS_TABLE_NAME, configuration)); this.fileNameColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_FILE_NAME_COLUMN_NAME, configuration)); this.fileNameColumnSize = PropertyUtils.getInt(PROPERTY_FILE_NAME_COLUMN_SIZE, configuration); this.versionColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_SCRIPT_VERSION_COLUMN_NAME, configuration)); this.versionColumnSize = PropertyUtils.getInt(PROPERTY_SCRIPT_VERSION_COLUMN_SIZE, configuration); this.fileLastModifiedAtColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_FILE_LAST_MODIFIED_AT_COLUMN_NAME, configuration)); this.checksumColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_CHECKSUM_COLUMN_NAME, configuration)); this.checksumColumnSize = PropertyUtils.getInt(PROPERTY_CHECKSUM_COLUMN_SIZE, configuration); this.executedAtColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_EXECUTED_AT_COLUMN_NAME, configuration)); this.executedAtColumnSize = PropertyUtils.getInt(PROPERTY_EXECUTED_AT_COLUMN_SIZE, configuration); this.succeededColumnName = defaultDbSupport.toCorrectCaseIdentifier(PropertyUtils.getString(PROPERTY_SUCCEEDED_COLUMN_NAME, configuration)); this.autoCreateExecutedScriptsTable = PropertyUtils.getBoolean(PROPERTY_AUTO_CREATE_EXECUTED_SCRIPTS_TABLE, configuration); this.timestampFormat = new SimpleDateFormat(PropertyUtils.getString(PROPERTY_TIMESTAMP_FORMAT, configuration)); }