@Test public void testGetResourcesWithUnsupportedPropertyPredicate() throws Exception{ ClusterControllerImpl controller = new ClusterControllerImpl(new TestProviderModule()); Set<String> propertyIds = new HashSet<String>(); propertyIds.add(PropertyHelper.getPropertyId("c1", "p1")); propertyIds.add(PropertyHelper.getPropertyId("c1", "p2")); propertyIds.add(PropertyHelper.getPropertyId("c1", "p3")); propertyIds.add(PropertyHelper.getPropertyId("c2", "p4")); Request request = PropertyHelper.getReadRequest(propertyIds); Predicate predicate = new PredicateBuilder().property(UNSUPPORTED_PROPERTY).equals(1).toPredicate(); try { controller.getResourceIterable(Resource.Type.Host, request, predicate); Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties."); } catch (UnsupportedPropertyException e) { } }
protected Iterable<Resource> getResourceIterable(Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException { return getResources(type, request, predicate, null, null).getIterable(); }
ClusterControllerImpl implements ClusterController { protected Iterable<Resource> getResourceIterable(Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException { return getResources(type, request, predicate, null, null).getIterable(); } }
ClusterControllerImpl implements ClusterController { protected Iterable<Resource> getResourceIterable(Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException { return getResources(type, request, predicate, null, null).getIterable(); } ClusterControllerImpl(ProviderModule providerModule); }
ClusterControllerImpl implements ClusterController { protected Iterable<Resource> getResourceIterable(Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException { return getResources(type, request, predicate, null, null).getIterable(); } ClusterControllerImpl(ProviderModule providerModule); @Override Predicate getAmendedPredicate(Type type, Predicate predicate); @Override QueryResponse getResources(Type type, Request request, Predicate predicate); @Override Set<Resource> populateResources(Type type,
                                         Set<Resource> resources,
                                         Request request,
                                         Predicate predicate); @Override Iterable<Resource> getIterable(Type type, QueryResponse queryResponse,
                                        Request request, Predicate predicate,
                                        PageRequest pageRequest,
                                        SortRequest sortRequest); @Override PageResponse getPage(Type type, QueryResponse queryResponse,
                              Request request, Predicate predicate,
                              PageRequest pageRequest, SortRequest sortRequest); @Override Schema getSchema(Type type); @Override RequestStatus createResources(Type type, Request request); @Override RequestStatus updateResources(Type type, Request request, Predicate predicate); @Override RequestStatus deleteResources(Type type, Request request, Predicate predicate); @Override ResourceProvider ensureResourceProvider(Type type); }
ClusterControllerImpl implements ClusterController { protected Iterable<Resource> getResourceIterable(Type type, Request request, Predicate predicate) throws UnsupportedPropertyException, SystemException, NoSuchParentResourceException, NoSuchResourceException { return getResources(type, request, predicate, null, null).getIterable(); } ClusterControllerImpl(ProviderModule providerModule); @Override Predicate getAmendedPredicate(Type type, Predicate predicate); @Override QueryResponse getResources(Type type, Request request, Predicate predicate); @Override Set<Resource> populateResources(Type type,
                                         Set<Resource> resources,
                                         Request request,
                                         Predicate predicate); @Override Iterable<Resource> getIterable(Type type, QueryResponse queryResponse,
                                        Request request, Predicate predicate,
                                        PageRequest pageRequest,
                                        SortRequest sortRequest); @Override PageResponse getPage(Type type, QueryResponse queryResponse,
                              Request request, Predicate predicate,
                              PageRequest pageRequest, SortRequest sortRequest); @Override Schema getSchema(Type type); @Override RequestStatus createResources(Type type, Request request); @Override RequestStatus updateResources(Type type, Request request, Predicate predicate); @Override RequestStatus deleteResources(Type type, Request request, Predicate predicate); @Override ResourceProvider ensureResourceProvider(Type type);  }