I am sorry you are frustrated, it sounds like you have the right approach.

Schema (in the geotools library) is the original word for FeatureType. It
is an “internal detail” that postgis does that using tables.

Can you request the type names from the datastore? Just to have a list of
what tables were recognized as having a geometry column (and this being
published as a feature).

Jody
On Fri, Feb 21, 2020 at 6:15 AM Peter Smythe <g...@smythe.co.za> wrote:

> Hi all
>
> ref: https://github.com/geotools/geotools/pull/2810
>
> I am trying to build a unit test for my first contribution to the GeoTools
> code base.  So far, Andrea has given me some advice on how to proceed.
>
> However, I am stuck with setting up the online tests - they continuously
> fail with errors like schema does not exist e.g.
>
> [ERROR]
> testRendererBehaviour(org.geotools.data.postgis.PostGIS3DOnlineTest)  Time
> elapsed: 2.959 s  <<< ERROR!
> java.io.IOException: *Schema 'line3d' does not exist.*
>
> I have configured a postgis.properties file with details of my local
> postgis installation.  I can see the tables *are* being created in the
> test schema (that's the first schema in the search_path).  The first one
> created is (table) *arraytest*.
>
> I tried using maven:
>
> in directory /geotools/modules/plugin/jdbc/jdbc-postgis
> mvn install -P online
> Throws a bunch of errors (see above) in the tests.
>
> I tried using eclipse (debugging normal GeoServer/GeoTools code works
> fine) by right clicking on PostGISArrayOnlineTest.java and Debug, JUnit
> Test.
>
> I am able to step through the unit test code, setUpData() works (delete
> the previous table, create it again with known test data), but inside
> JDBCDataStore(ContentDataStore).*getFeatureSource*(Name, Transaction)
> line: 331
> with typeName = arraytest, there is no entry in the ContentDataStore, and
> thus:
>
> throw new IOException("Schema '" + name + "' does not exist.");
>
> BTW, I believe that the word "Schema" here is incorrect, as we're looking
> for a Table arraytest.
>
> I question, has the test been set up correctly, am I running it correctly?
>
> What am I missing?
>
> I really want to contribute to GeoServer/GeoTools, but I am beyond
> frustration with the initial complexity.
>
> Thanks
>
> Peter
>
> On Thu, 20 Feb 2020 at 17:34, Andrea Aime <notificati...@github.com>
> wrote:
>
>> *@aaime* commented on this pull request.
>> ------------------------------
>>
>> In modules/library/jdbc/src/main/java/org/geotools/jdbc/KeysFetcher.java
>> <https://github.com/geotools/geotools/pull/2810#discussion_r382076263>:
>>
>> > @@ -420,6 +423,27 @@ public Object getNext(Connection cx) {
>>          }
>>      }
>>
>> +    private static class FromUuid extends KeyFetcher {
>>
>> The test should be done in GeoTools. There are plenty of JUnit tests
>> talking to a database in the gt-jdbc-postgresql, you probably need to work
>> either on PostgisPrimaryKeyFinderOnlineTest, or
>> PostgisPrimaryKeyOnlineTest, or PostGISUuidOnlineTest, extending the
>> associated test setup, and probably adding a new test method in the postgis
>> specific subclasses (e.g., PostGISUuidOnlineTest) rather than the base
>> class shared across databases (e.g., JDBCUuidTestSetup).
>>
>> When you try to run it, it will create a
>> $HOME/.geotools/postgis.properties.example file and fail, rename the
>> created file it into postgis.properties and fix the connection properties
>> to point to a database that one can write onto, run it again, make it pass.
>>
>> —
>> You are receiving this because you authored the thread.
>> Reply to this email directly, view it on GitHub
>> <https://github.com/geotools/geotools/pull/2810?email_source=notifications&email_token=ABLPQUZYEEB5JYKLTGEANS3RD2PDJA5CNFSM4KXC3EC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCWJ3DEY#discussion_r382076263>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ABLPQUZFXNJEBJOS6G7Y4ALRD2PDJANCNFSM4KXC3ECQ>
>> .
>>
> _______________________________________________
> GeoTools-Devel mailing list
> GeoTools-Devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
-- 
--
Jody Garnett
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to