@Test public void testGetResources_MissingHostName() throws Exception { thrown.expect(SystemException.class); thrown.expectMessage("HAWQ Master Host property is not specified for the view instance."); Map<String, String> props = prepareViewContextProperties(); props.remove("hawq.master.host"); expect(viewContext.getProperties()).andReturn(props).anyTimes(); replayAll(); provider.getResources(null); }
@Override public Set<QueryResource> getResources(ReadRequest request) throws SystemException, NoSuchResourceException, UnsupportedPropertyException { Set<QueryResource> resources; try { LOG.debug("Get queries: View Context Properties = {}", viewContext.getProperties()); resources = getQueries(); LOG.debug("Retrieved {} queries from HAWQ Master", resources.size()); } catch (SQLException e) { LOG.error(e.getMessage(), e); throw new SystemException("Can't get current queries.", e); } return resources; }
QueryResourceProvider implements ResourceProvider<QueryResource> { @Override public Set<QueryResource> getResources(ReadRequest request) throws SystemException, NoSuchResourceException, UnsupportedPropertyException { Set<QueryResource> resources; try { LOG.debug("Get queries: View Context Properties = {}", viewContext.getProperties()); resources = getQueries(); LOG.debug("Retrieved {} queries from HAWQ Master", resources.size()); } catch (SQLException e) { LOG.error(e.getMessage(), e); throw new SystemException("Can't get current queries.", e); } return resources; } }
QueryResourceProvider implements ResourceProvider<QueryResource> { @Override public Set<QueryResource> getResources(ReadRequest request) throws SystemException, NoSuchResourceException, UnsupportedPropertyException { Set<QueryResource> resources; try { LOG.debug("Get queries: View Context Properties = {}", viewContext.getProperties()); resources = getQueries(); LOG.debug("Retrieved {} queries from HAWQ Master", resources.size()); } catch (SQLException e) { LOG.error(e.getMessage(), e); throw new SystemException("Can't get current queries.", e); } return resources; }  }
QueryResourceProvider implements ResourceProvider<QueryResource> { @Override public Set<QueryResource> getResources(ReadRequest request) throws SystemException, NoSuchResourceException, UnsupportedPropertyException { Set<QueryResource> resources; try { LOG.debug("Get queries: View Context Properties = {}", viewContext.getProperties()); resources = getQueries(); LOG.debug("Retrieved {} queries from HAWQ Master", resources.size()); } catch (SQLException e) { LOG.error(e.getMessage(), e); throw new SystemException("Can't get current queries.", e); } return resources; }  @Override QueryResource getResource(String resourceId, Set<String> propertyIds); @Override Set<QueryResource> getResources(ReadRequest request); @Override void createResource(String resourceId, Map<String, Object> stringObjectMap); @Override boolean updateResource(String resourceId, Map<String, Object> stringObjectMap); @Override boolean deleteResource(String resourceId); }
QueryResourceProvider implements ResourceProvider<QueryResource> { @Override public Set<QueryResource> getResources(ReadRequest request) throws SystemException, NoSuchResourceException, UnsupportedPropertyException { Set<QueryResource> resources; try { LOG.debug("Get queries: View Context Properties = {}", viewContext.getProperties()); resources = getQueries(); LOG.debug("Retrieved {} queries from HAWQ Master", resources.size()); } catch (SQLException e) { LOG.error(e.getMessage(), e); throw new SystemException("Can't get current queries.", e); } return resources; }  @Override QueryResource getResource(String resourceId, Set<String> propertyIds); @Override Set<QueryResource> getResources(ReadRequest request); @Override void createResource(String resourceId, Map<String, Object> stringObjectMap); @Override boolean updateResource(String resourceId, Map<String, Object> stringObjectMap); @Override boolean deleteResource(String resourceId);  }