@Override public void teardown() { VagrantState nextState; if (initialState != null) { logger.info("Bringing vagrant back to {} state.", initialState.toString()); nextState = initialState; } else { logger.warn("No initial state was captured. Destroying the VM."); nextState = NOT_CREATED; } vagrantDriver.doVagrant(vagrantVm, getTransitionCommand(nextState)); }
@Override public void setup() { initialState = vagrantDriver.state(vagrantVm); logger.info("Vagrant host is in state {}.", initialState.toString()); vagrantDriver.doVagrant(vagrantVm, getTransitionCommand(VagrantState.RUNNING)); }