forked from geoserver/geoserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEOS-10824] gs-flatgeobuf extension can clash with "directory of sha…
…pefiles" datastores (geoserver#7782) * [GEOS-10824] gs-flatgeobuf extension can clash with "directory of shapefiles" datastores * [GEOS-10824] gs-flatgeobuf extension can clash with "directory of shapefiles" datastores. Do not share the test store with all test modules
- Loading branch information
Showing
8 changed files
with
186 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/src/test/java/org/geoserver/catalog/TestDirectoryStoreFactorySpi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* (c) 2024 Open Source Geospatial Foundation - all rights reserved | ||
* This code is licensed under the GPL 2.0 license, available at the root | ||
* application directory. | ||
*/ | ||
package org.geoserver.catalog; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.util.Map; | ||
import org.geotools.api.data.DataStore; | ||
import org.geotools.api.data.DataStoreFactorySpi; | ||
import org.geotools.data.memory.MemoryDataStore; | ||
|
||
/** | ||
* A fake store that returns nothing, used to similate the FGB store interaction with directory data | ||
* store | ||
*/ | ||
public class TestDirectoryStoreFactorySpi implements DataStoreFactorySpi { | ||
|
||
public static final Param URL_PARAM = | ||
new Param("url", URL.class, "A file or directory", true, null); | ||
|
||
@Override | ||
public DataStore createDataStore(Map<String, ?> params) throws IOException { | ||
return new TestDirectoryStore(); | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Test store accepting a simple URL"; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "A test factory with no parameters and one fixed data type"; | ||
} | ||
|
||
@Override | ||
public Param[] getParametersInfo() { | ||
return new Param[] {URL_PARAM}; | ||
} | ||
|
||
@Override | ||
public boolean isAvailable() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public DataStore createNewDataStore(Map<String, ?> params) throws IOException { | ||
return createDataStore(params); | ||
} | ||
|
||
/** | ||
* Empty subclass, just to have a clearer name on test failures, e.g., "failed to cast to | ||
* TestDirectoryStore" is better than "failed to case to MemoryDataStore", e.g., it would lead | ||
* immediately to this file. In case you're seeing this, it's likely that you created a | ||
* DataStoreInfo without setting the "type" attribute to the desired data store factory | ||
* displayName. | ||
*/ | ||
public static class TestDirectoryStore extends MemoryDataStore {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters