Hi Peter, "schema" is a highly overloaded term, don't focus too much on one of the possible database related uses. Schema in XML and JSON is the structure of objects/records, in databases we also talk about the schema of a table, meaning the list of columns and types (e..g, in sqlite command line utility ".schema myTable" returns the table description).
In GeoTools schema has the same meaning as above, it is synonymous to "feature type", across the entire library, not just in JDBCDataStore. And then there is the unfortunate overlap with "schema" as a database object containers. The error message is in ContentDataStore, which is a base class for all types of data accesses, and does not talking about that specific RDBMS meaning. If the table is not found it may mean that there is indeed an issue with "schema" as the container, the tests are meant to be run in a dedicated database and onto the "public" database schema. Everyone so far has been running it that way, and there is no property to configure it *in the sample*. If you cannot dedicate a new database instance to run the tests (e..g, I use a gttest database), try setting "schema=test" and see if tests run. I suspect several might, but some may still fail. Cheers Andrea On Fri, Feb 21, 2020 at 2:17 PM 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 > -- Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- *Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.*
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel