@Test public void testGetObjectVersion() throws Exception { int version = 5; String path = "/path"; setupPathHelperReturn(path); setupReturnVersion(version); int result = testee.getObjectVersion(ANY_SERVICE); Assert.assertEquals(version, result); }
@Override public int getObjectVersion(String serviceName) { try { return getCache(serviceName).getCurrentDataVersion(); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException(e); } }
SimpleServiceDAO extends BaseDAO<T> implements ISimpleServiceDAO<T>, ICacheableDAO { @Override public int getObjectVersion(String serviceName) { try { return getCache(serviceName).getCurrentDataVersion(); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException(e); } } }
SimpleServiceDAO extends BaseDAO<T> implements ISimpleServiceDAO<T>, ICacheableDAO { @Override public int getObjectVersion(String serviceName) { try { return getCache(serviceName).getCurrentDataVersion(); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException(e); } } SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector connector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache,
                            boolean useCacheWhenNotConnectedToDataSource);  SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector zookeeperConnector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache); }
SimpleServiceDAO extends BaseDAO<T> implements ISimpleServiceDAO<T>, ICacheableDAO { @Override public int getObjectVersion(String serviceName) { try { return getCache(serviceName).getCurrentDataVersion(); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException(e); } } SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector connector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache,
                            boolean useCacheWhenNotConnectedToDataSource);  SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector zookeeperConnector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache); @Override T get(String serviceName); @Override void save(T data, String serviceName); @Override void delete(String serviceName); @Override int getObjectVersion(String serviceName); @Override synchronized void rebuildCache(); @Override void addCacheListener(String serviceName, ICacheListener listener); @Override void close(); }
SimpleServiceDAO extends BaseDAO<T> implements ISimpleServiceDAO<T>, ICacheableDAO { @Override public int getObjectVersion(String serviceName) { try { return getCache(serviceName).getCurrentDataVersion(); } catch (DataSourceConnectorException e) { throw new RedirectorDataSourceException(e); } } SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector connector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache,
                            boolean useCacheWhenNotConnectedToDataSource);  SimpleServiceDAO(Class<T> clazz,
                            Serializer marshalling,
                            IDataSourceConnector zookeeperConnector,
                            IPathHelper pathHelper,
                            boolean isCompressed,
                            boolean useCache); @Override T get(String serviceName); @Override void save(T data, String serviceName); @Override void delete(String serviceName); @Override int getObjectVersion(String serviceName); @Override synchronized void rebuildCache(); @Override void addCacheListener(String serviceName, ICacheListener listener); @Override void close();  }