@Test public void testFromConfig() { MFromConfig originalConfigs = new MFromConfig(ConfigUtils.toConfigs(FromJobConfiguration.class)); MFromConfig newConfigs = new MFromConfig(ConfigUtils.toConfigs(FromJobConfiguration.class)); originalConfigs.getInput("fromJobConfig.schemaName").setValue("test-schema"); originalConfigs.getInput("fromJobConfig.tableName").setValue("test-tableName"); originalConfigs.getInput("fromJobConfig.sql").setValue("test-sql"); originalConfigs.getInput("fromJobConfig.columns").setValue("test-columns"); originalConfigs.getInput("fromJobConfig.partitionColumn").setValue("test-partitionColumn"); originalConfigs.getInput("fromJobConfig.allowNullValueInPartitionColumn").setValue("test-allowNullValueInPartitionColumn"); upgrader.upgradeFromJobConfig(originalConfigs, newConfigs); assertEquals(originalConfigs, newConfigs); assertEquals("test-schema", newConfigs.getInput("fromJobConfig.schemaName").getValue()); assertEquals("test-tableName", newConfigs.getInput("fromJobConfig.tableName").getValue()); assertEquals("test-sql", newConfigs.getInput("fromJobConfig.sql").getValue()); assertEquals("test-columns", newConfigs.getInput("fromJobConfig.columns").getValue()); assertEquals("test-partitionColumn", newConfigs.getInput("fromJobConfig.partitionColumn").getValue()); assertEquals("test-allowNullValueInPartitionColumn", newConfigs.getInput("fromJobConfig.allowNullValueInPartitionColumn").getValue()); }
@Override public void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget) { ConfigurableUpgradeUtil.doUpgrade(original.getConfigs(), upgradeTarget.getConfigs()); }
GenericJdbcConnectorUpgrader extends ConnectorConfigurableUpgrader { @Override public void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget) { ConfigurableUpgradeUtil.doUpgrade(original.getConfigs(), upgradeTarget.getConfigs()); } }
GenericJdbcConnectorUpgrader extends ConnectorConfigurableUpgrader { @Override public void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget) { ConfigurableUpgradeUtil.doUpgrade(original.getConfigs(), upgradeTarget.getConfigs()); }  }
GenericJdbcConnectorUpgrader extends ConnectorConfigurableUpgrader { @Override public void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget) { ConfigurableUpgradeUtil.doUpgrade(original.getConfigs(), upgradeTarget.getConfigs()); }  @Override void upgradeLinkConfig(MLinkConfig original, MLinkConfig upgradeTarget); @Override void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget); @Override void upgradeToJobConfig(MToConfig original, MToConfig upgradeTarget); }
GenericJdbcConnectorUpgrader extends ConnectorConfigurableUpgrader { @Override public void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget) { ConfigurableUpgradeUtil.doUpgrade(original.getConfigs(), upgradeTarget.getConfigs()); }  @Override void upgradeLinkConfig(MLinkConfig original, MLinkConfig upgradeTarget); @Override void upgradeFromJobConfig(MFromConfig original, MFromConfig upgradeTarget); @Override void upgradeToJobConfig(MToConfig original, MToConfig upgradeTarget);  }