test_class.declarator: LOGGER = Logger.getLogger(GeoStoreClientTest.class)
test_class.modifier: private final static
test_class.original_string: private final static Logger LOGGER = Logger.getLogger(GeoStoreClientTest.class);
test_class.type: Logger
test_class.var_name: LOGGER
test_class.declarator: DEFAULTCATEGORYNAME = "TestCategory1"
test_class.modifier: final
test_class.original_string: final String DEFAULTCATEGORYNAME = "TestCategory1";
test_class.type: String
test_class.var_name: DEFAULTCATEGORYNAME
test_class.file: src/modules/rest/client/src/test/java/it/geosolutions/geostore/services/rest/GeoStoreClientTest.java
test_class.identifier: GeoStoreClientTest
test_class.superclass: extends BaseGeoStoreClientTest
test_case.body: @Test
      public void testUpdateResource() {
  
          final String KEY_STRING = "stringAtt";
          final String KEY_DATE = "dateAtt";
  
          final Date origDate = new Date();
          final String origString = "OrigStringValue";
  
          Long rid;
  
          createDefaultCategory();
  
          {
              RESTStoredData storedData = new RESTStoredData();
              storedData.setData("we wish you a merry xmas and a happy new year");
  
              List<ShortAttribute> attrList = new ArrayList<ShortAttribute>();
              attrList.add(new ShortAttribute("string1", "value1", DataType.STRING));
              attrList.add(new ShortAttribute("string2", "value2", DataType.STRING));
              attrList.add(new ShortAttribute("string3", "value3", DataType.STRING));
  
              String timeid = Long.toString(System.currentTimeMillis());
  
              RESTResource origResource = new RESTResource();
              origResource.setCategory(new RESTCategory(DEFAULTCATEGORYNAME));
              origResource.setName("rest_test_resource_" + timeid);
              origResource.setStore(storedData);
              origResource.setAttribute(attrList);
  
              rid = client.insert(origResource);
          }
          System.out.println("RESOURCE has ID " + rid);
  
          // test getResource
          String name1 = "rest_test_resource_" + Long.toString(System.currentTimeMillis());
          {
              RESTResource updResource = new RESTResource();
              updResource.setName(name1);
  
              List<ShortAttribute> attrList = new ArrayList<ShortAttribute>();
              attrList.add(new ShortAttribute("string1", "value1", DataType.STRING)); // same
              attrList.add(new ShortAttribute("string2", "value2.2", DataType.STRING)); // updated
              // attrList.add(new ShortAttribute("string3", "value3", DataType.STRING)); //removed
              attrList.add(new ShortAttribute("string4", "value4", DataType.STRING)); // added
  
              updResource.setAttribute(attrList);
              client.updateResource(rid, updResource);
          }
  
          {
              Resource loaded = client.getResource(rid);
              System.out.println("RESOURCE: " + loaded);
  
              // test reloaded attrs
              List<Attribute> loadedAttrs = loaded.getAttribute();
              assertEquals(3, loadedAttrs.size());
  
              Map<String, String> attMap = new HashMap<String, String>();
              for (Attribute attribute : loadedAttrs) {
                  attMap.put(attribute.getName(), attribute.getTextValue());
              }
  
              assertEquals("value1", attMap.get("string1"));
              assertEquals("value2.2", attMap.get("string2"));
              assertEquals("value4", attMap.get("string4"));
          }
  
          // try bad update
          {
              RESTResource res = new RESTResource();
              res.setCategory(new RESTCategory("TestCategory2"));
              try {
                  client.updateResource(rid, res);
                  fail("Undetected error");
              } catch (UniformInterfaceException e) {
                  String response = "COULD NOT READ RESPONSE";
                  try {
                      response = IOUtils.toString(e.getResponse().getEntityInputStream());
                  } catch (Exception e2) {
                      LOGGER.warn("Error reading response: " + e2.getMessage());
                  }
                  LOGGER.info("Error condition successfully detected: " + response);
              } catch (Exception e) {
                  LOGGER.info("Error condition successfully detected:" + e.getMessage(), e);
  
              }
          }
  
          client.deleteResource(rid);
      }
test_case.class_method_signature: GeoStoreClientTest.testUpdateResource()
test_case.full_signature: @Test public void testUpdateResource()
test_case.identifier: testUpdateResource
test_case.invocations: createDefaultCategory setData add add add toString currentTimeMillis setCategory setName setStore setAttribute insert println toString currentTimeMillis setName add add add setAttribute updateResource getResource println getAttribute assertEquals size put getName getTextValue assertEquals get assertEquals get assertEquals get setCategory updateResource fail toString getEntityInputStream getResponse warn getMessage info info getMessage deleteResource
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateResource()
focal_class.declarator: username = null
focal_class.modifier: private
focal_class.original_string: private String username = null;
focal_class.type: String
focal_class.var_name: username
focal_class.declarator: password = null
focal_class.modifier: private
focal_class.original_string: private String password = null;
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: geostoreRestUrl = null
focal_class.modifier: private
focal_class.original_string: private String geostoreRestUrl = null;
focal_class.type: String
focal_class.var_name: geostoreRestUrl
focal_class.file: src/modules/rest/client/src/main/java/it/geosolutions/geostore/services/rest/GeoStoreClient.java
focal_class.identifier: GeoStoreClient
focal_class.class_method_signature: GeoStoreClient.GeoStoreClient()
focal_class.full_signature: public  GeoStoreClient()
focal_class.identifier: GeoStoreClient
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  GeoStoreClient()
focal_class.class_method_signature: GeoStoreClient.searchResources(SearchFilter searchFilter)
focal_class.full_signature: @Deprecated public ShortResourceList searchResources(SearchFilter searchFilter)
focal_class.identifier: searchResources
focal_class.modifiers: @Deprecated public
focal_class.parameters: (SearchFilter searchFilter)
focal_class.return: ShortResourceList
focal_class.signature: ShortResourceList searchResources(SearchFilter searchFilter)
focal_class.class_method_signature: GeoStoreClient.searchResources(SearchFilter searchFilter,
              Integer page, Integer entries,
              Boolean includeAttributes, Boolean includeData)
focal_class.full_signature: public ResourceList searchResources(SearchFilter searchFilter,
              Integer page, Integer entries,
              Boolean includeAttributes, Boolean includeData)
focal_class.identifier: searchResources
focal_class.modifiers: public
focal_class.parameters: (SearchFilter searchFilter,
              Integer page, Integer entries,
              Boolean includeAttributes, Boolean includeData)
focal_class.return: ResourceList
focal_class.signature: ResourceList searchResources(SearchFilter searchFilter,
              Integer page, Integer entries,
              Boolean includeAttributes, Boolean includeData)
focal_class.class_method_signature: GeoStoreClient.addQParam(WebResource wb, String key, Object value)
focal_class.full_signature: protected WebResource addQParam(WebResource wb, String key, Object value)
focal_class.identifier: addQParam
focal_class.modifiers: protected
focal_class.parameters: (WebResource wb, String key, Object value)
focal_class.return: WebResource
focal_class.signature: WebResource addQParam(WebResource wb, String key, Object value)
focal_class.class_method_signature: GeoStoreClient.insert(RESTResource resource)
focal_class.full_signature: public Long insert(RESTResource resource)
focal_class.identifier: insert
focal_class.modifiers: public
focal_class.parameters: (RESTResource resource)
focal_class.return: Long
focal_class.signature: Long insert(RESTResource resource)
focal_class.class_method_signature: GeoStoreClient.getResource(Long id, boolean full)
focal_class.full_signature: public Resource getResource(Long id, boolean full)
focal_class.identifier: getResource
focal_class.modifiers: public
focal_class.parameters: (Long id, boolean full)
focal_class.return: Resource
focal_class.signature: Resource getResource(Long id, boolean full)
focal_class.class_method_signature: GeoStoreClient.getResource(Long id)
focal_class.full_signature: public Resource getResource(Long id)
focal_class.identifier: getResource
focal_class.modifiers: public
focal_class.parameters: (Long id)
focal_class.return: Resource
focal_class.signature: Resource getResource(Long id)
focal_class.class_method_signature: GeoStoreClient.deleteResource(Long id)
focal_class.full_signature: public void deleteResource(Long id)
focal_class.identifier: deleteResource
focal_class.modifiers: public
focal_class.parameters: (Long id)
focal_class.return: void
focal_class.signature: void deleteResource(Long id)
focal_class.class_method_signature: GeoStoreClient.updateResource(Long id, RESTResource resource)
focal_class.full_signature: public void updateResource(Long id, RESTResource resource)
focal_class.identifier: updateResource
focal_class.modifiers: public
focal_class.parameters: (Long id, RESTResource resource)
focal_class.return: void
focal_class.signature: void updateResource(Long id, RESTResource resource)
focal_class.class_method_signature: GeoStoreClient.getAllShortResource(Integer page, Integer entries)
focal_class.full_signature: public ShortResourceList getAllShortResource(Integer page, Integer entries)
focal_class.identifier: getAllShortResource
focal_class.modifiers: public
focal_class.parameters: (Integer page, Integer entries)
focal_class.return: ShortResourceList
focal_class.signature: ShortResourceList getAllShortResource(Integer page, Integer entries)
focal_class.class_method_signature: GeoStoreClient.getSecurityRules(Long resourceId)
focal_class.full_signature: public SecurityRuleList getSecurityRules(Long resourceId)
focal_class.identifier: getSecurityRules
focal_class.modifiers: public
focal_class.parameters: (Long resourceId)
focal_class.return: SecurityRuleList
focal_class.signature: SecurityRuleList getSecurityRules(Long resourceId)
focal_class.class_method_signature: GeoStoreClient.updateSecurityRules(Long resourceId, SecurityRuleList rules)
focal_class.full_signature: public void updateSecurityRules(Long resourceId, SecurityRuleList rules)
focal_class.identifier: updateSecurityRules
focal_class.modifiers: public
focal_class.parameters: (Long resourceId, SecurityRuleList rules)
focal_class.return: void
focal_class.signature: void updateSecurityRules(Long resourceId, SecurityRuleList rules)
focal_class.class_method_signature: GeoStoreClient.getData(Long id)
focal_class.full_signature: public String getData(Long id)
focal_class.identifier: getData
focal_class.modifiers: public
focal_class.parameters: (Long id)
focal_class.return: String
focal_class.signature: String getData(Long id)
focal_class.class_method_signature: GeoStoreClient.getData(Long id, MediaType acceptMediaType)
focal_class.full_signature: public String getData(Long id, MediaType acceptMediaType)
focal_class.identifier: getData
focal_class.modifiers: public
focal_class.parameters: (Long id, MediaType acceptMediaType)
focal_class.return: String
focal_class.signature: String getData(Long id, MediaType acceptMediaType)
focal_class.class_method_signature: GeoStoreClient.getRawData(Long id, RawFormat decodeFrom)
focal_class.full_signature: public byte[] getRawData(Long id, RawFormat decodeFrom)
focal_class.identifier: getRawData
focal_class.modifiers: public
focal_class.parameters: (Long id, RawFormat decodeFrom)
focal_class.return: byte[]
focal_class.signature: byte[] getRawData(Long id, RawFormat decodeFrom)
focal_class.class_method_signature: GeoStoreClient.getRawData(Class<T> clazz, Long id, RawFormat decodeFrom)
focal_class.full_signature: public T getRawData(Class<T> clazz, Long id, RawFormat decodeFrom)
focal_class.identifier: getRawData
focal_class.modifiers: public
focal_class.parameters: (Class<T> clazz, Long id, RawFormat decodeFrom)
focal_class.return: T
focal_class.signature: T getRawData(Class<T> clazz, Long id, RawFormat decodeFrom)
focal_class.class_method_signature: GeoStoreClient.setData(Long id, String data)
focal_class.full_signature: public void setData(Long id, String data)
focal_class.identifier: setData
focal_class.modifiers: public
focal_class.parameters: (Long id, String data)
focal_class.return: void
focal_class.signature: void setData(Long id, String data)
focal_class.class_method_signature: GeoStoreClient.updateData(Long id, String data)
focal_class.full_signature: public void updateData(Long id, String data)
focal_class.identifier: updateData
focal_class.modifiers: public
focal_class.parameters: (Long id, String data)
focal_class.return: void
focal_class.signature: void updateData(Long id, String data)
focal_class.class_method_signature: GeoStoreClient.insert(RESTCategory category)
focal_class.full_signature: public Long insert(RESTCategory category)
focal_class.identifier: insert
focal_class.modifiers: public
focal_class.parameters: (RESTCategory category)
focal_class.return: Long
focal_class.signature: Long insert(RESTCategory category)
focal_class.class_method_signature: GeoStoreClient.getCategory(Long id)
focal_class.full_signature: public Category getCategory(Long id)
focal_class.identifier: getCategory
focal_class.modifiers: public
focal_class.parameters: (Long id)
focal_class.return: Category
focal_class.signature: Category getCategory(Long id)
focal_class.class_method_signature: GeoStoreClient.getCategoryCount(String nameLike)
focal_class.full_signature: public Long getCategoryCount(String nameLike)
focal_class.identifier: getCategoryCount
focal_class.modifiers: public
focal_class.parameters: (String nameLike)
focal_class.return: Long
focal_class.signature: Long getCategoryCount(String nameLike)
focal_class.class_method_signature: GeoStoreClient.getCategories(Integer page, Integer entries)
focal_class.full_signature: public CategoryList getCategories(Integer page, Integer entries)
focal_class.identifier: getCategories
focal_class.modifiers: public
focal_class.parameters: (Integer page, Integer entries)
focal_class.return: CategoryList
focal_class.signature: CategoryList getCategories(Integer page, Integer entries)
focal_class.class_method_signature: GeoStoreClient.getCategories()
focal_class.full_signature: public CategoryList getCategories()
focal_class.identifier: getCategories
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CategoryList
focal_class.signature: CategoryList getCategories()
focal_class.class_method_signature: GeoStoreClient.deleteCategory(Long id)
focal_class.full_signature: public void deleteCategory(Long id)
focal_class.identifier: deleteCategory
focal_class.modifiers: public
focal_class.parameters: (Long id)
focal_class.return: void
focal_class.signature: void deleteCategory(Long id)
focal_class.class_method_signature: GeoStoreClient.searchUserGroup(Integer start,Integer limit, String nameLike, boolean all)
focal_class.full_signature: public ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike, boolean all)
focal_class.identifier: searchUserGroup
focal_class.modifiers: public
focal_class.parameters: (Integer start,Integer limit, String nameLike, boolean all)
focal_class.return: ExtGroupList
focal_class.signature: ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike, boolean all)
focal_class.class_method_signature: GeoStoreClient.searchUserGroup(Integer start,Integer limit, String nameLike)
focal_class.full_signature: public ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike)
focal_class.identifier: searchUserGroup
focal_class.modifiers: public
focal_class.parameters: (Integer start,Integer limit, String nameLike)
focal_class.return: ExtGroupList
focal_class.signature: ExtGroupList searchUserGroup(Integer start,Integer limit, String nameLike)
focal_class.class_method_signature: GeoStoreClient.getShortResource(long id)
focal_class.full_signature: public ShortResource getShortResource(long id)
focal_class.identifier: getShortResource
focal_class.modifiers: public
focal_class.parameters: (long id)
focal_class.return: ShortResource
focal_class.signature: ShortResource getShortResource(long id)
focal_class.class_method_signature: GeoStoreClient.getBaseWebResource()
focal_class.full_signature: protected WebResource getBaseWebResource()
focal_class.identifier: getBaseWebResource
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: WebResource
focal_class.signature: WebResource getBaseWebResource()
focal_class.class_method_signature: GeoStoreClient.getBaseWebResource(Object... path)
focal_class.full_signature: protected WebResource getBaseWebResource(Object... path)
focal_class.identifier: getBaseWebResource
focal_class.modifiers: protected
focal_class.parameters: (Object... path)
focal_class.return: WebResource
focal_class.signature: WebResource getBaseWebResource(Object... path)
focal_class.class_method_signature: GeoStoreClient.getPassword()
focal_class.full_signature: public String getPassword()
focal_class.identifier: getPassword
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPassword()
focal_class.class_method_signature: GeoStoreClient.setPassword(String password)
focal_class.full_signature: public void setPassword(String password)
focal_class.identifier: setPassword
focal_class.modifiers: public
focal_class.parameters: (String password)
focal_class.return: void
focal_class.signature: void setPassword(String password)
focal_class.class_method_signature: GeoStoreClient.getUsername()
focal_class.full_signature: public String getUsername()
focal_class.identifier: getUsername
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUsername()
focal_class.class_method_signature: GeoStoreClient.setUsername(String username)
focal_class.full_signature: public void setUsername(String username)
focal_class.identifier: setUsername
focal_class.modifiers: public
focal_class.parameters: (String username)
focal_class.return: void
focal_class.signature: void setUsername(String username)
focal_class.class_method_signature: GeoStoreClient.getGeostoreRestUrl()
focal_class.full_signature: public String getGeostoreRestUrl()
focal_class.identifier: getGeostoreRestUrl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getGeostoreRestUrl()
focal_class.class_method_signature: GeoStoreClient.setGeostoreRestUrl(String geostoreRestUrl)
focal_class.full_signature: public void setGeostoreRestUrl(String geostoreRestUrl)
focal_class.identifier: setGeostoreRestUrl
focal_class.modifiers: public
focal_class.parameters: (String geostoreRestUrl)
focal_class.return: void
focal_class.signature: void setGeostoreRestUrl(String geostoreRestUrl)
focal_method.body: public void updateResource(Long id, RESTResource resource)
      {
          getBaseWebResource("resources", "resource", id)
                  .header("Content-Type", MediaType.TEXT_XML)
                  .put(resource);
      }
focal_method.class_method_signature: GeoStoreClient.updateResource(Long id, RESTResource resource)
focal_method.full_signature: public void updateResource(Long id, RESTResource resource)
focal_method.identifier: updateResource
focal_method.invocations: put header getBaseWebResource
focal_method.modifiers: public
focal_method.parameters: (Long id, RESTResource resource)
focal_method.return: void
focal_method.signature: void updateResource(Long id, RESTResource resource)