You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2017/07/24 23:35:25 UTC

Re: State of SQL work?

Hello Sisinda

Le 21/07/2017 à 16:20, Sisinda Dinusha a écrit :

> I have completed replacing JDBC with Android classes. But the tests
> are yet to be performed (in sis-referencing). Since we have only
> SQLiteDatabase object for all the database tasks, editing the code
> will be a straightforward solution. But now I think creating JDBC
> wrappers will be a much appropriate solution here. Even though I
> completed replacing the code, I would like to implement wrappers now.
> Do you have any recommendations for this?
>
I'm not sure yet which solution would be most practicable, so it is nice
that you did the replacement in-place so we can compare. For writing
JDBC wrappers, I suggest to take a look at the classes that Marc Le
Bihan wrote for the sis-shapefile module. They are not yet on the trunk,
but you can find them there:

    http://svn.apache.org/repos/asf/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/

There is AbstractConnection, AbstractResultSet, etc. Those classes can
not be used directly since sis-referencing can not depend on
sis-shapefile (doing so would create a circular dependency), so it may
be necessary to copy them in a new package, for example
org.apache.sis.internal.jdbc. For the need of an Android port, maybe we
could simplify the copy by omitting the logging and just throw
java.sql.SQLFeatureNotSupportedException everywhere. Next, we could
execute the tests and on a case-by-case basis implement the methods
invoked by the tests.


> Yesterday I ran sis-metadata tests and they finished with 4 errors and 1 failed.
> Those errors are as following.
> 1. testLocalization in org.apache.sis.internal.jaxb.code.CodeListMarshallingTest
>     Expected node: #text="Création"
>     Actual node: #text="Cr�ation"
> 2. testAppendUnit in org.apache.sis.io.wkt.FormatterTest
>     expected:<ANGLEUNIT[“[degree]”, 0.017453292519943...> but
> was:<ANGLEUNIT[“[°]”, 0.017453292519943...>
> 3. testTreeWithCustomElements in org.apache.sis.metadata.TreeTableFormatTest
>     expected:<...ion form (2 of 3)…… [AUDIO-DIGITAL]> but was:<...ion
> form (2 of 3)…… [Test]>
> 4. testOnSqlite in org.apache.sis.metadata.sql.MetadataSourceTest
>     org.apache.sis.util.collection.BackingStoreException: Database
> error while creating a ‘InternationalString’ object for the “PNG”
> identifier.

Let forget the error 4 for now since it seems related to the JDBC or SQL
work. Error 1 seems to be an encoding issue. Could you try to open
core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/CodeListMarshallingTest.java
and insert the following at line 131?

        marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");

It should not make any difference since UTF-8 is the encoding by
default, but just checking...

    Martin