@Test public void testDeleteStackPathNodeHasChildren() throws Exception { when(connector.getBasePath()).thenReturn(""); when(connector.isPathExists(anyString())).thenReturn(true); setupGetChildrenResult(STACKS_PATH + "/PO/POC1/1.40/xreGuide", Collections.<String>emptyList()); setupGetChildrenResult(STACKS_PATH + "/PO/POC1/1.40", Collections.<String>emptyList()); setupGetChildrenResult(STACKS_PATH + "/PO/POC1", Collections.<String>emptyList()); setupGetChildrenResult(STACKS_PATH + "/PO", Arrays.asList("POC2", "POC3")); StacksDAO testee = new StacksDAO(connector); testee.deleteStackPath(new XreStackPath("/PO/POC1/1.40/xreGuide")); verify(connector, times(1)).delete(STACKS_PATH + "/PO/POC1/1.40/xreGuide"); verify(connector, times(1)).delete(STACKS_PATH + "/PO/POC1/1.40"); verify(connector, times(1)).delete(STACKS_PATH + "/PO/POC1"); verify(connector, never()).delete(STACKS_PATH + "/PO"); }
@Override public void deleteStackPath(XreStackPath xreStackPath){ stacksDeleter.deleteStackPath(xreStackPath); }
StacksDAO implements IStacksDAO { @Override public void deleteStackPath(XreStackPath xreStackPath){ stacksDeleter.deleteStackPath(xreStackPath); } }
StacksDAO implements IStacksDAO { @Override public void deleteStackPath(XreStackPath xreStackPath){ stacksDeleter.deleteStackPath(xreStackPath); } StacksDAO(IDataSourceConnector connector); }
StacksDAO implements IStacksDAO { @Override public void deleteStackPath(XreStackPath xreStackPath){ stacksDeleter.deleteStackPath(xreStackPath); } StacksDAO(IDataSourceConnector connector); @Override Set<XreStackPath> getAllStackPaths(); @Override Set<XreStackPath> getAllStackPaths(final Set<String> applicationsToExclude); @Override Collection<HostIPs> getHosts(XreStackPath path); @Override Collection<HostIPs> getHostsByStackOnlyPath(XreStackPath path); @Override List<String> getFlavorsByStackOnlyPath(XreStackPath path); @Override HostIPs getHostByIndex(XreStackPath path, int index); @Override void deleteStackPath(XreStackPath xreStackPath); @Override int getHostsCount(XreStackPath path); @Override Set<String> getAllAppNamesRegisteredInStacks(); @Override void addCacheListener(ICacheListener listener); }
StacksDAO implements IStacksDAO { @Override public void deleteStackPath(XreStackPath xreStackPath){ stacksDeleter.deleteStackPath(xreStackPath); } StacksDAO(IDataSourceConnector connector); @Override Set<XreStackPath> getAllStackPaths(); @Override Set<XreStackPath> getAllStackPaths(final Set<String> applicationsToExclude); @Override Collection<HostIPs> getHosts(XreStackPath path); @Override Collection<HostIPs> getHostsByStackOnlyPath(XreStackPath path); @Override List<String> getFlavorsByStackOnlyPath(XreStackPath path); @Override HostIPs getHostByIndex(XreStackPath path, int index); @Override void deleteStackPath(XreStackPath xreStackPath); @Override int getHostsCount(XreStackPath path); @Override Set<String> getAllAppNamesRegisteredInStacks(); @Override void addCacheListener(ICacheListener listener);  }