@Test public void testGetHostsCount() throws Exception { String path = "/PO/POC1/1.40/xreGuide"; when(connector.getBasePath()).thenReturn("/base"); setupGetChildrenResult("/base" + STACKS_PATH + path, Arrays.asList("host1", "host2", "host3")); setupNodeExists("/base" + STACKS_PATH + path, true); StacksDAO testee = new StacksDAO(connector); int result = testee.getHostsCount(new XreStackPath(path)); Assert.assertEquals(3, result); }
@Override public int getHostsCount(XreStackPath path) { try { return stacksCache.getHostsCount(path); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException("failed to get hosts count", e); } }
StacksDAO implements IStacksDAO { @Override public int getHostsCount(XreStackPath path) { try { return stacksCache.getHostsCount(path); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException("failed to get hosts count", e); } } }
StacksDAO implements IStacksDAO { @Override public int getHostsCount(XreStackPath path) { try { return stacksCache.getHostsCount(path); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException("failed to get hosts count", e); } } StacksDAO(IDataSourceConnector connector); }
StacksDAO implements IStacksDAO { @Override public int getHostsCount(XreStackPath path) { try { return stacksCache.getHostsCount(path); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException("failed to get hosts count", e); } } 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 int getHostsCount(XreStackPath path) { try { return stacksCache.getHostsCount(path); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException("failed to get hosts count", e); } } 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);  }