@Test public void testDestroyNode() throws IOException { Files.createDirectories(vagrantPath); strategy.destroyNode(prepareNode()); verify(executor).execute(vagrantPath, "vagrant", "destroy", "-f"); assertFalse(vagrantPath + " should have been deleted", Files.exists(vagrantPath)); }
@Override public void destroyNode(Node node) throws IOException { Path nodePath = getPath(node); if (!Files.exists(nodePath)) { return; } executor.execute(nodePath, "vagrant", "destroy", "-f"); FileUtils.deleteDirectory(nodePath.toFile()); }
VagrantStrategy implements ClusterStrategy { @Override public void destroyNode(Node node) throws IOException { Path nodePath = getPath(node); if (!Files.exists(nodePath)) { return; } executor.execute(nodePath, "vagrant", "destroy", "-f"); FileUtils.deleteDirectory(nodePath.toFile()); } }
VagrantStrategy implements ClusterStrategy { @Override public void destroyNode(Node node) throws IOException { Path nodePath = getPath(node); if (!Files.exists(nodePath)) { return; } executor.execute(nodePath, "vagrant", "destroy", "-f"); FileUtils.deleteDirectory(nodePath.toFile()); } protected  VagrantStrategy(); }
VagrantStrategy implements ClusterStrategy { @Override public void destroyNode(Node node) throws IOException { Path nodePath = getPath(node); if (!Files.exists(nodePath)) { return; } executor.execute(nodePath, "vagrant", "destroy", "-f"); FileUtils.deleteDirectory(nodePath.toFile()); } protected  VagrantStrategy(); @Override boolean isAvailable(); @Override Node createNode(Cluster cluster); @Override NodeStatus getNodeStatus(Node node); @Override void startNode(Node node); @Override void stopNode(Node node); @Override void destroyNode(Node node); SshConfig getSshConfig(Node node); }
VagrantStrategy implements ClusterStrategy { @Override public void destroyNode(Node node) throws IOException { Path nodePath = getPath(node); if (!Files.exists(nodePath)) { return; } executor.execute(nodePath, "vagrant", "destroy", "-f"); FileUtils.deleteDirectory(nodePath.toFile()); } protected  VagrantStrategy(); @Override boolean isAvailable(); @Override Node createNode(Cluster cluster); @Override NodeStatus getNodeStatus(Node node); @Override void startNode(Node node); @Override void stopNode(Node node); @Override void destroyNode(Node node); SshConfig getSshConfig(Node node); static final String NAME; }