[Geoserver-devel] [jira] (GEOS-6690) ResourceStore API Mock

Jody Garnett created an issue

GeoServer / BugGEOS-6690

ResourceStore API Mock

Issue Type:

BugBug

Assignee:

Andrea Aime

Created:

25/Sep/14 6:47 PM

Priority:

MajorMajor

Reporter:

Jody Garnett

Now that I am using ResoruceStore API in anger (rather than just porting existing code) I am collecting a list of glitches, javadocs and method visibility changes that are annoying me.

My hope is to gather a bunch of small changes together here, try them out on master and back port to 2.6.x.

GeoServerDataDirectory. get(WorkspaceInfo,String…):

    /**
     * Retrieve a resource in the the workspace configuration directory. An empty path will retrieve
     * the directory itself.
     * @param ws The workspace
     * @return A {@link Resource}
     */
    public @Nonnull Resource get(WorkspaceInfo ws, String... path) {
        Resource r;
        if(ws==null) {
            return resourceLoader.get("");
        } else {
            r = getWorkspaces(  ws.getName(), Paths.path(path));
        }
        assert r!=null;
        return r;
    }

This method is inconsistent, null ws should return “workspaces” folder.

Un reasonably hard to mock a style:

  • public ResourcePool.getStyle( StyleInfo ): can be mocked to return processed style …
  • public ResourcePool.readStyle( StyleInfo style ): just returns the bytes

But the two methods do not know each other, ResourcePool.getStyle uses GeoServerDataDirect.parsedStyle(info) does its own lookup.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v6.1.6#6162-sha1:7af547c)

Atlassian logo