### Question:
MigrateAggregateMetrics implements Step { private void shutdown() { if (dbConnectionFactory != null) { try { log.info("Shutting down migration thread pools..."); rateMonitor.shutdown(); progressLogger.finished(); if (keyScanner != null) { keyScanner.shutdown(); } threadPool.shutdown(); threadPool.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { } } }  @Override void setSession(Session session); @Override void bind(Properties properties); @Override void execute(); static final int DEFAULT_WARM_UP; }### Answer:
@Test public void runMigration() throws Exception { int numSchedules = Integer.parseInt(System.getProperty("numSchedules", "10")); Properties properties = new Properties(); properties.put(SchemaManager.RELATIONAL_DB_CONNECTION_FACTORY_PROP, new DBConnectionFactory() { @Override public Connection newConnection() throws SQLException { return null; } }); properties.put(SchemaManager.DATA_DIR, "target"); SchemaManager schemaManager = new SchemaManager("rhqadmin", "1eeb2f255e832171df8592078de921bc", new String[] {"127.0.0.1"}, 9042); schemaManager.setUpdateFolderFactory(new TestUpdateFolderFactory(VersionManager.Task.Update.getFolder()) .removeFiles("0005.xml", "0006.xml", "0007.xml")); schemaManager.drop(); schemaManager.shutdown(); schemaManager.install(properties); schemaManager.shutdown(); Cluster cluster = new Cluster.Builder() .addContactPoint("127.0.0.1") .withCredentials("rhqadmin", "rhqadmin") .withPoolingOptions(new PoolingOptions() .setCoreConnectionsPerHost(HostDistance.LOCAL, 30) .setMaxConnectionsPerHost(HostDistance.LOCAL, 50)) .build(); session = cluster.connect("rhq"); initPreparedStatements(); DateTime endTime = DateTime.now(); insert1HourData(numSchedules, endTime); insert6HourData(numSchedules, endTime); insert24HourData(numSchedules, endTime); schemaManager = new SchemaManager("rhqadmin", "1eeb2f255e832171df8592078de921bc", new String[] {"127.0.0.1"}, 9042); schemaManager.install(properties); schemaManager.shutdown(); assert1HourDataMigrated(numSchedules); assert6HourDataMigrated(numSchedules); assert24HourDataMigrated(numSchedules); assertTablesDropped("one_hour_metrics", "six_hour_metrics", "twenty_four_hour_metrics"); }