@Test public void testGetHosts() throws Exception { String path = "/PO/POC1/1.40/xreGuide"; when(connector.getBasePath()).thenReturn(""); setupGetChildrenResult(STACKS_PATH + path, Arrays.asList("host1", "host2")); setupGetDataResult(STACKS_PATH + path + "/host1", "host1Data"); setupHostDeserializeResult("host1Data", new HostIPs("host1ipv4", "host1ipv6")); setupGetDataResult(STACKS_PATH + path + "/host2", "host2Data"); setupHostDeserializeResult("host2Data", new HostIPs("host2ipv4", "host2ipv6")); setupNodeExists(STACKS_PATH + path, true); StacksDAO testee = new StacksDAO(connector); HostIPs[] result = testee.getHosts(new XreStackPath(path)).toArray(new HostIPs[]{}); Assert.assertEquals("host1ipv4", result[0].getIpV4Address()); Assert.assertEquals("host1ipv6", result[0].getIpV6Address()); Assert.assertEquals("host2ipv4", result[1].getIpV4Address()); Assert.assertEquals("host2ipv6", result[1].getIpV6Address()); }
@Override public Collection<HostIPs> getHosts(XreStackPath path) { return stacksCache.getHostsRunningAppVersionOnStack(path); }
StacksDAO implements IStacksDAO { @Override public Collection<HostIPs> getHosts(XreStackPath path) { return stacksCache.getHostsRunningAppVersionOnStack(path); } }
StacksDAO implements IStacksDAO { @Override public Collection<HostIPs> getHosts(XreStackPath path) { return stacksCache.getHostsRunningAppVersionOnStack(path); } StacksDAO(IDataSourceConnector connector); }
StacksDAO implements IStacksDAO { @Override public Collection<HostIPs> getHosts(XreStackPath path) { return stacksCache.getHostsRunningAppVersionOnStack(path); } 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 Collection<HostIPs> getHosts(XreStackPath path) { return stacksCache.getHostsRunningAppVersionOnStack(path); } 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);  }