@Test public void testCreateResourcesWithUnsupportedProperty() throws Exception{ TestProviderModule providerModule = new TestProviderModule(); ClusterController controller = new ClusterControllerImpl(providerModule); Set<Map<String, Object>> properties = new HashSet<Map<String, Object>>(); Map<String, Object> propertyMap = new HashMap<String, Object>(); propertyMap.put(PropertyHelper.getPropertyId("c1", "p1"), 99); propertyMap.put(UNSUPPORTED_PROPERTY, 2); properties.add(propertyMap); Request request = PropertyHelper.getCreateRequest(properties, null); try { controller.createResources(Resource.Type.Host, request); Assert.fail("Expected an UnsupportedPropertyException for the unsupported properties."); } catch (UnsupportedPropertyException e) { } }
@Override public RequestStatus createResources(Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException { ResourceProvider provider = ensureResourceProvider(type); if (provider != null) { checkProperties(type, request, null); return provider.createResources(request); } return null; }
ClusterControllerImpl implements ClusterController { @Override public RequestStatus createResources(Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException { ResourceProvider provider = ensureResourceProvider(type); if (provider != null) { checkProperties(type, request, null); return provider.createResources(request); } return null; } }
ClusterControllerImpl implements ClusterController { @Override public RequestStatus createResources(Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException { ResourceProvider provider = ensureResourceProvider(type); if (provider != null) { checkProperties(type, request, null); return provider.createResources(request); } return null; } ClusterControllerImpl(ProviderModule providerModule); }
ClusterControllerImpl implements ClusterController { @Override public RequestStatus createResources(Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException { ResourceProvider provider = ensureResourceProvider(type); if (provider != null) { checkProperties(type, request, null); return provider.createResources(request); } return null; } 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 { @Override public RequestStatus createResources(Type type, Request request) throws UnsupportedPropertyException, SystemException, ResourceAlreadyExistsException, NoSuchParentResourceException { ResourceProvider provider = ensureResourceProvider(type); if (provider != null) { checkProperties(type, request, null); return provider.createResources(request); } return null; } 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);  }