/// <summary> Loads the configuration from the migration config properties file.
		/// 
		/// </summary>
		/// <param name="launcher">the launcher to configure
		/// </param>
		/// <param name="systemName">the name of the system
		/// </param>
		/// <throws>  MigrationException if an unexpected error occurs </throws>
		private void  configureFromMigrationProperties(AdoMigrationLauncher launcher, System.String systemName)
		{
            MigrationConfigurationManager configMgr = new MigrationConfigurationManager();
            DBConfiguration dbConfig = configMgr.getDBConfiguration();
            MigrationConfiguration migrationConfig = configMgr.getMigrationConfiguration();

            launcher.PatchPath = migrationConfig.PatchPath;
            launcher.PostPatchPath = migrationConfig.PostPatchPath;

            DataSourceMigrationContext context = DataSourceMigrationContext;
            System.String databaseType = dbConfig.DatabaseType;
            context.DatabaseType = new DatabaseType(databaseType);
            
            // Finish setting up the context
            context.SystemName = systemName;

            //context.DataSource = dataSource;

            // done reading in config, set launcher's context
            launcher.AddContext(context);
        }
		/// <summary> Configure the launcher from the provided properties, system name
		/// 
		/// </summary>
		/// <param name="launcher">The launcher to configure
		/// </param>
		/// <param name="systemName">The name of the system we're configuring
		/// </param>
		/// <param name="props">The Properties object with our configuration information
		/// </param>
		/// <throws>  IllegalArgumentException if a required parameter is missing </throws>
		/// <throws>  MigrationException if there is problem setting the context into the launcher </throws>
		
		private void  configureFromMigrationProperties(AdoMigrationLauncher launcher, System.String systemName, System.Collections.Specialized.NameValueCollection props)
		{
            //TODO: change to use MigrationConfigurationManager
            launcher.PatchPath = null;//getRequiredParam(props, systemName + ".patch.path");
			launcher.PostPatchPath = props.Get(systemName + ".postpatch.path");
			
			// Set up the data source
			/*NonPooledDataSource dataSource = new NonPooledDataSource();
			dataSource.DriverClass = getRequiredParam(props, systemName + ".ado.driver");
			dataSource.DatabaseUrl = getRequiredParam(props, systemName + ".ado.url");
			dataSource.Username = getRequiredParam(props, systemName + ".ado.username");
			dataSource.Password = getRequiredParam(props, systemName + ".ado.password");*/
			
			// Set up the ADO migration context; accepts one of two property names
			DataSourceMigrationContext context = DataSourceMigrationContext;
            //TODO: change to use MigrationConfigurationManager
            System.String databaseType = null;// getRequiredParam(props, systemName + ".ado.database.type", systemName + ".ado.dialect");
			context.DatabaseType = new DatabaseType(databaseType);
			
			// Finish setting up the context
			context.SystemName = systemName;
			
			//context.DataSource = dataSource;
			
			// done reading in config, set launcher's context
			launcher.AddContext(context);
		}
Beispiel #3
0
 /// <summary> Create a support component with the given configured launcher
 /// 
 /// </summary>
 /// <param name="launcher">the launcher to use for the migrations
 /// </param>
 public AutoPatchSupport(AdoMigrationLauncher launcher)
 {
     this.launcher = launcher;
 }
        public void TestTokenizePostPatchPath()
        {
            AdoMigrationLauncher launcher = new AdoMigrationLauncher();
            launcher.PostPatchPath = paths;
            MigrationProcess process = launcher.MigrationProcess;

            Assert.Less(0, process.PostPatchMigrationTasks.Count);
        }
        public void TestNextPatchLevel()
        {
            AdoMigrationLauncher launcher = new AdoMigrationLauncher();
            launcher.PatchPath = paths;

            Assert.Less(5, launcher.NextPatchLevel);
        }
 public void TestDoMigrationsNoContexts()
 {
     AdoMigrationLauncher launcher = new AdoMigrationLauncher();
     launcher.DoMigrations();
 }