CassandraTaskFactory implements ExecutorTaskFactory { @Override public ExecutorTask createTask(Protos.TaskInfo taskInfo, ExecutorDriver driver) throws ExecutorTaskException { CassandraTask cassandraTask = CassandraTask.parse(taskInfo); switch(cassandraTask.getType()) { case CASSANDRA_DAEMON: try { cassandra = CassandraDaemonProcess.create(scheduledExecutorService, taskInfo, driver); return cassandra; } catch (IOException e) { throw new ExecutorTaskException(e); } default: return launchClusterTask(cassandraTask); } } CassandraTaskFactory(ExecutorDriver driver); CassandraDaemonProcess getCassandra(); @Override ExecutorTask createTask(Protos.TaskInfo taskInfo, ExecutorDriver driver);  }
@Test public void testCreateDaemonTask() throws ConfigStoreException, PersistenceException, ExecutorTaskException { CassandraDaemonTask daemonTask = cassandraState.createDaemon(testDaemonName); ExecutorTask executorTask = taskFactory.createTask(daemonTask.getTaskInfo(), executorDriver); Assert.assertNotNull(executorTask); ProcessTask processTask = (ProcessTask) executorTask; ProcessBuilder processBuilder = processTask.getProcessBuilder(); Assert.assertNotNull(processBuilder); System.out.println("cmd: " + processBuilder.command()); }