You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@asterixdb.apache.org by Riyafa Abdul Hameed <ri...@apache.org> on 2017/06/13 16:56:17 UTC

Writing tests for supporting geometry datatype

Hi all,

I plan to implement the Geometry datatype in TDD manner. Here first I would
like to write a test case to check the following query:

drop dataverse GeoJSON if exists;
> create dataverse GeoJSON;
>
> use GeoJSON;
>
> create type GeometryType as
> open {
> id : bigint
> geometry : geometry
> }
>
> create dataset Geometries(GeometryType) primary key id;
>

Initially this test should fail and the code I write should cause it to
pass. I am confused about the way to write these tests. What I tried to do
was to write ddl, query and update tests for these in the runtimets/
*queries_sqlpp*[1]. Then I tried to run mvn test, but as I gathered from
the pom.xml[2] file, these tests are excluded from running.
Please kindly inform me how such tests need to written and if they can be
run using mvn test.

[1]
https://github.com/apache/asterixdb/tree/master/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp
[2]
https://github.com/apache/asterixdb/blob/master/asterixdb/asterix-app/pom.xml

Thank you.
Yours sincerely,
Riyafa

Re: Writing tests for supporting geometry datatype

Posted by Riyafa Abdul Hameed <ri...@apache.org>.
Hi,

Thank you. That seems to work.

Regards,
Riyafa

On 13 June 2017 at 22:38, Chen Luo <cl...@uci.edu> wrote:

> Hi,
>
> After writing the test (a folder of sqlpp queries), you need then to add
> this test into testsuite_sqlpp.xml file. You can manually run
> SQLPPExecutionTest to run the entire test suite (using maven should also
> work).
>
> Since testsuite_sqlpp.xml contains thousand of tests, personally I wound
> create another testsuite file (e.g., testsuite_sqlpp_geo.xml) and change
> the test suite path from SQLPPExecutionTest. This allows me to only run the
> newly added tests. After everything works fine, you can simply revert the
> changes and submit.
>
> Best regards,
> Chen Luo
>
>
>
> On Tue, Jun 13, 2017 at 9:56 AM, Riyafa Abdul Hameed <ri...@apache.org>
> wrote:
>
>> Hi all,
>>
>> I plan to implement the Geometry datatype in TDD manner. Here first I
>> would
>> like to write a test case to check the following query:
>>
>> drop dataverse GeoJSON if exists;
>> > create dataverse GeoJSON;
>> >
>> > use GeoJSON;
>> >
>> > create type GeometryType as
>> > open {
>> > id : bigint
>> > geometry : geometry
>> > }
>> >
>> > create dataset Geometries(GeometryType) primary key id;
>> >
>>
>> Initially this test should fail and the code I write should cause it to
>> pass. I am confused about the way to write these tests. What I tried to do
>> was to write ddl, query and update tests for these in the runtimets/
>> *queries_sqlpp*[1]. Then I tried to run mvn test, but as I gathered from
>> the pom.xml[2] file, these tests are excluded from running.
>> Please kindly inform me how such tests need to written and if they can be
>> run using mvn test.
>>
>> [1]
>> https://github.com/apache/asterixdb/tree/master/asterixdb/
>> asterix-app/src/test/resources/runtimets/queries_sqlpp
>> [2]
>> https://github.com/apache/asterixdb/blob/master/asterixdb/
>> asterix-app/pom.xml
>>
>> Thank you.
>> Yours sincerely,
>> Riyafa
>>
>
>

Re: Writing tests for supporting geometry datatype

Posted by Chen Luo <cl...@uci.edu>.
Hi,

After writing the test (a folder of sqlpp queries), you need then to add
this test into testsuite_sqlpp.xml file. You can manually run
SQLPPExecutionTest to run the entire test suite (using maven should also
work).

Since testsuite_sqlpp.xml contains thousand of tests, personally I wound
create another testsuite file (e.g., testsuite_sqlpp_geo.xml) and change
the test suite path from SQLPPExecutionTest. This allows me to only run the
newly added tests. After everything works fine, you can simply revert the
changes and submit.

Best regards,
Chen Luo



On Tue, Jun 13, 2017 at 9:56 AM, Riyafa Abdul Hameed <ri...@apache.org>
wrote:

> Hi all,
>
> I plan to implement the Geometry datatype in TDD manner. Here first I would
> like to write a test case to check the following query:
>
> drop dataverse GeoJSON if exists;
> > create dataverse GeoJSON;
> >
> > use GeoJSON;
> >
> > create type GeometryType as
> > open {
> > id : bigint
> > geometry : geometry
> > }
> >
> > create dataset Geometries(GeometryType) primary key id;
> >
>
> Initially this test should fail and the code I write should cause it to
> pass. I am confused about the way to write these tests. What I tried to do
> was to write ddl, query and update tests for these in the runtimets/
> *queries_sqlpp*[1]. Then I tried to run mvn test, but as I gathered from
> the pom.xml[2] file, these tests are excluded from running.
> Please kindly inform me how such tests need to written and if they can be
> run using mvn test.
>
> [1]
> https://github.com/apache/asterixdb/tree/master/asterixdb/asterix-app/src/
> test/resources/runtimets/queries_sqlpp
> [2]
> https://github.com/apache/asterixdb/blob/master/
> asterixdb/asterix-app/pom.xml
>
> Thank you.
> Yours sincerely,
> Riyafa
>