### Question:
TableMergeSyncSupport implements Serializable { public void doSync(@Nonnull final String sourceSchema, @Nonnull final String sourceTable, @Nonnull final String targetSchema, @Nonnull final String targetTable, @Nonnull final PartitionSpec partitionSpec, @Nonnull final String feedPartitionValue) throws SQLException { Validate.notEmpty(sourceSchema); Validate.notEmpty(sourceTable); Validate.notEmpty(targetSchema); Validate.notEmpty(targetTable); Validate.notNull(partitionSpec); Validate.notNull(feedPartitionValue); String refTableLocation = extractTableLocation(targetSchema, targetTable); String syncTableLocation = deriveSyncTableLocation(targetTable, refTableLocation); String syncTable = createSyncTable(targetSchema, targetTable, syncTableLocation); final String[] selectFields = getSelectFields(sourceSchema, sourceTable, targetSchema, syncTable, partitionSpec); final String syncSQL = partitionSpec.isNonPartitioned() ? generateSyncNonPartitionQuery(selectFields, sourceSchema, sourceTable, targetSchema, syncTable, feedPartitionValue) : generateSyncDynamicPartitionQuery(selectFields, partitionSpec, sourceSchema, sourceTable, targetSchema, syncTable, feedPartitionValue); doExecuteSQL(syncSQL); dropTable(targetSchema, targetTable); String markExternal = "ALTER TABLE " + targetSchema + "." + syncTable + " SET TBLPROPERTIES('EXTERNAL'='TRUE')"; doExecuteSQL(markExternal); renameTable(targetSchema, syncTable, targetTable); String unmarkExternal = "ALTER TABLE " + targetSchema + "." + targetTable + " SET TBLPROPERTIES('EXTERNAL'='FALSE')"; doExecuteSQL(unmarkExternal); } TableMergeSyncSupport(Connection conn); void enableDynamicPartitions(); void setHiveConf(String[] configurations); void resetHiveConf(); String getHivePropertyValue(String parameter); void doSync(@Nonnull final String sourceSchema, @Nonnull final String sourceTable, @Nonnull final String targetSchema, @Nonnull final String targetTable,
                       @Nonnull final PartitionSpec partitionSpec, @Nonnull final String feedPartitionValue); void doRollingSync(@Nonnull final String sourceSchema, @Nonnull final String sourceTable, @Nonnull final String targetSchema, @Nonnull final String targetTable,
                              @Nonnull final PartitionSpec partitionSpec, @Nonnull final String feedPartitionValue); List<PartitionBatch> doMerge(@Nonnull final String sourceSchema, @Nonnull final String sourceTable, @Nonnull final String targetSchema, @Nonnull final String targetTable,
                                        @Nonnull final PartitionSpec partitionSpec, @Nonnull final String feedPartitionValue, final boolean shouldDedupe); void doPKMerge(@Nonnull final String sourceSchema, @Nonnull final String sourceTable, @Nonnull final String targetSchema, @Nonnull final String targetTable,
                          @Nonnull final PartitionSpec partitionSpec, @Nonnull final String feedPartitionValue, @Nonnull final ColumnSpec[] columnSpecs); void dropTable(@Nonnull final String schema, @Nonnull final String table); void renameTable(@Nonnull final String schema, @Nonnull final String oldName, @Nonnull final String newName);  }### Answer:
@Test public void testSyncLocationHDFS() throws Exception { String describePre = extractTableDirectory(sourceSchema, sourceTable); mergeSyncSupport.doSync(sourceSchema, sourceTable, targetSchema, targetTableNP, specNP, processingPartition); String describePost = extractTableDirectory(targetSchema, targetTableNP); if((describePre == null) || (describePost == null)) assert(false); assert(describePre.equals(describePost)); mergeSyncSupport.doSync(sourceSchema, sourceTable, targetSchema, targetTable, spec, processingPartition); describePost = extractTableDirectory(targetSchema, targetTable); if((describePre == null) || (describePost == null)) assert(false); assert(describePre.equals(describePost)); }