You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Fernanda Pizzorno <Fe...@Sun.COM> on 2006/09/26 16:13:45 UTC
Converting LOB related tests to Junit
I have started converting LOB related tests to Junit. The aim with this
is to document the coverage of the LOB related tests. I am interested in
finding out: (1) what is being tested, (2) what is the LOB size used to
test with (I have divided that into 3 categories Small, Medium and
Large), and (3) which of the drivers (Embedded and/or Client) is being
tested.
I have created a wiki page to keep track of which of the tests have
already been converted and had its coverage documented. This wiki page
can be found at: http://wiki.apache.org/db-derby/ConvertLobTestsToJunit.
I have used jdbcapi/lobStreams.java as an example of how I thought of
documenting the test coverage. Suggestions, and help converting the
tests and documenting are very welcome :).
- Fernanda
PS: I tried to link DERBY-1888 to DERBY-1889 but I got the following error:
Errors
An error occurred: com.atlassian.jira.exception.DataAccessException:
org.ofbiz.core.entity.GenericEntityException: while inserting:
[GenericEntity:IssueLink][destination,12351773][linktype,12310010][source,12351772][sequence,null][id,12313532]
(SQL Exception while executing the following:INSERT INTO issuelink (ID,
LINKTYPE, SOURCE, DESTINATION, SEQUENCE) VALUES (?, ?, ?, ?, ?)
(Duplicate entry '12313532' for key 1))
Has anyone seen this error before?
Re: Converting LOB related tests to Junit
Posted by Fernanda Pizzorno <Fe...@Sun.COM>.
Do you think I should change the categories I am using (S/M/L) and maybe
add some more (XS, XL and XXL), or just write down the size of the lob
used to test with instead?
- Fernanda
Mike Matrigali wrote:
> From the store side it is interesting to test lob's that are either
> smaller than a page or larger than a page - these will go through
> 2 separate code paths. So it would be nice if the
> new tests included these boundaries. Safest would probably be to
> include a 1000 byte/char lob and a 100k blob.
>
> After that there seem to be 2 interesting boundaries:
> o a lob bigger than available memory to the jvm, to test whether lob
> is getting instantiated in memory or not. Hopefully at some point
> we will ge to the point where this never happens but I don't think
> we are there yet - especially for network server case.
>
> o the max size lob (i forget if it is 2 gig or 2 gig-1). This test
> may want to be separate as it may require resources that some
> developers won't have.
>
> Fernanda Pizzorno wrote:
>> I have started converting LOB related tests to Junit. The aim with
>> this is to document the coverage of the LOB related tests. I am
>> interested in finding out: (1) what is being tested, (2) what is the
>> LOB size used to test with (I have divided that into 3 categories
>> Small, Medium and Large), and (3) which of the drivers (Embedded
>> and/or Client) is being tested.
>>
>> I have created a wiki page to keep track of which of the tests have
>> already been converted and had its coverage documented. This wiki
>> page can be found at:
>> http://wiki.apache.org/db-derby/ConvertLobTestsToJunit. I have used
>> jdbcapi/lobStreams.java as an example of how I thought of documenting
>> the test coverage. Suggestions, and help converting the tests and
>> documenting are very welcome :).
>>
>>
>> - Fernanda
>>
Re: Converting LOB related tests to Junit
Posted by Mike Matrigali <mi...@sbcglobal.net>.
From the store side it is interesting to test lob's that are either
smaller than a page or larger than a page - these will go through
2 separate code paths. So it would be nice if the
new tests included these boundaries. Safest would probably be to
include a 1000 byte/char lob and a 100k blob.
After that there seem to be 2 interesting boundaries:
o a lob bigger than available memory to the jvm, to test whether lob
is getting instantiated in memory or not. Hopefully at some point
we will ge to the point where this never happens but I don't think
we are there yet - especially for network server case.
o the max size lob (i forget if it is 2 gig or 2 gig-1). This test
may want to be separate as it may require resources that some
developers won't have.
Fernanda Pizzorno wrote:
> I have started converting LOB related tests to Junit. The aim with this
> is to document the coverage of the LOB related tests. I am interested in
> finding out: (1) what is being tested, (2) what is the LOB size used to
> test with (I have divided that into 3 categories Small, Medium and
> Large), and (3) which of the drivers (Embedded and/or Client) is being
> tested.
>
> I have created a wiki page to keep track of which of the tests have
> already been converted and had its coverage documented. This wiki page
> can be found at: http://wiki.apache.org/db-derby/ConvertLobTestsToJunit.
> I have used jdbcapi/lobStreams.java as an example of how I thought of
> documenting the test coverage. Suggestions, and help converting the
> tests and documenting are very welcome :).
>
>
> - Fernanda
>
>
>
> PS: I tried to link DERBY-1888 to DERBY-1889 but I got the following error:
>
> Errors
> An error occurred: com.atlassian.jira.exception.DataAccessException:
> org.ofbiz.core.entity.GenericEntityException: while inserting:
> [GenericEntity:IssueLink][destination,12351773][linktype,12310010][source,12351772][sequence,null][id,12313532]
> (SQL Exception while executing the following:INSERT INTO issuelink (ID,
> LINKTYPE, SOURCE, DESTINATION, SEQUENCE) VALUES (?, ?, ?, ?, ?)
> (Duplicate entry '12313532' for key 1))
>
> Has anyone seen this error before?
>
>
>
>
>
Re: Converting LOB related tests to Junit
Posted by Fernanda Pizzorno <Fe...@Sun.COM>.
Sunitha Kambhampati wrote:
> Fernanda Pizzorno wrote:
>
>> I have started converting LOB related tests to Junit. The aim with
>> this is to document the coverage of the LOB related tests. I am
>> interested in finding out: (1) what is being tested, (2) what is the
>> LOB size used to test with (I have divided that into 3 categories
>> Small, Medium and Large), and (3) which of the drivers (Embedded
>> and/or Client) is being tested.
>>
>> I have created a wiki page to keep track of which of the tests have
>> already been converted and had its coverage documented. This wiki
>> page can be found at:
>> http://wiki.apache.org/db-derby/ConvertLobTestsToJunit. I have used
>> jdbcapi/lobStreams.java as an example of how I thought of documenting
>> the test coverage.
>
> Thanks much Fernanda for starting this effort.
>
> I looked at the lobStreams testCoverage pdf file and it looks good.
> How about we also have a similar page to just document which tests
> cover which api for blobs/clobs -- maybe a similar table can be used
> to just note the test class that tests the api. That way, it might be
> easy to tell which apis/area needs more testing and and that would
> encourage us to add new tests :)
>
> Thanks,
> Sunitha.
Hi Sunitha,
I thought that once we have reports like the one in
http://wiki.apache.org/db-derby/LobStreamsTestCoverage for each of the
tests, it would be easy to make a table like the one you suggested. But
maybe updating both tables at the same time will take less time. Thank
you for the suggestion :).
Fernanda
Re: Converting LOB related tests to Junit
Posted by Sunitha Kambhampati <ks...@gmail.com>.
Fernanda Pizzorno wrote:
> I have started converting LOB related tests to Junit. The aim with
> this is to document the coverage of the LOB related tests. I am
> interested in finding out: (1) what is being tested, (2) what is the
> LOB size used to test with (I have divided that into 3 categories
> Small, Medium and Large), and (3) which of the drivers (Embedded
> and/or Client) is being tested.
>
> I have created a wiki page to keep track of which of the tests have
> already been converted and had its coverage documented. This wiki page
> can be found at:
> http://wiki.apache.org/db-derby/ConvertLobTestsToJunit. I have used
> jdbcapi/lobStreams.java as an example of how I thought of documenting
> the test coverage.
Thanks much Fernanda for starting this effort.
I looked at the lobStreams testCoverage pdf file and it looks good.
How about we also have a similar page to just document which tests cover
which api for blobs/clobs -- maybe a similar table can be used to just
note the test class that tests the api. That way, it might be easy to
tell which apis/area needs more testing and and that would encourage us
to add new tests :)
Thanks,
Sunitha.
Re: Converting LOB related tests to Junit
Posted by Fernanda Pizzorno <Fe...@Sun.COM>.
Bryan Pendleton wrote:
> Mike Matrigali wrote:
>> I seem to remember some network server bugs fixed this
>> releaase which were "off by one" kinds of errors that relyed exactly
>> on a particular byte length in the transfer.
>
> Your memory is accurate; there were indeed such bugs (DERBY-1533 is
> a good example) and I think that a set of tests such as you propose
> would be valuable indeed.
>
> Fernanda, will your tests run both in embedded mode and against the
> client driver? I tried to look at the wiki but it's being grumpy right
> now.
>
> thanks,
>
> bryan
>
>
Bryan, I am not planning to make any changes to the tests now, except
from converting them to Junit test. After converted a tests will
continue to run against the same driver(s) as it did before it was
converted.
Fernanda
Re: Converting LOB related tests to Junit
Posted by Bryan Pendleton <bp...@amberpoint.com>.
Mike Matrigali wrote:
> I seem to remember some network server bugs fixed this
> releaase which were "off by one" kinds of errors that relyed exactly
> on a particular byte length in the transfer.
Your memory is accurate; there were indeed such bugs (DERBY-1533 is
a good example) and I think that a set of tests such as you propose
would be valuable indeed.
Fernanda, will your tests run both in embedded mode and against the
client driver? I tried to look at the wiki but it's being grumpy right now.
thanks,
bryan
Re: Converting LOB related tests to Junit
Posted by Mike Matrigali <mi...@sbcglobal.net>.
Another technique that sometimes is best is just don't worry about
edge cases and try "all" the cases. I remember in the past we had
some edge cases in utf8 conversion code and had a few bugs, and I
believe it was Dan who just went ahead and added a test that tried
every character in the 16 bit range.
So for LOBS it might make sense to try for both insert and select
lob sizes increasing byte by byte for every length from 0 to some
number. Not sure exactly what number, but at least bigger than
a page, maybe bigger than a couple of network server query buffers?
It might be overkill, but seems like an easy test to write - will
guarantee coverage, and if
it runs too long just throw it into the "resource" intense suite instead
of the nightly. I seem to remember some network server bugs fixed this
releaase which were "off by one" kinds of errors that relyed exactly
on a particular byte length in the transfer.
Fernanda Pizzorno wrote:
> I have started converting LOB related tests to Junit. The aim with this
> is to document the coverage of the LOB related tests. I am interested in
> finding out: (1) what is being tested, (2) what is the LOB size used to
> test with (I have divided that into 3 categories Small, Medium and
> Large), and (3) which of the drivers (Embedded and/or Client) is being
> tested.
>
> I have created a wiki page to keep track of which of the tests have
> already been converted and had its coverage documented. This wiki page
> can be found at: http://wiki.apache.org/db-derby/ConvertLobTestsToJunit.
> I have used jdbcapi/lobStreams.java as an example of how I thought of
> documenting the test coverage. Suggestions, and help converting the
> tests and documenting are very welcome :).
>
>
> - Fernanda
>
>
>
> PS: I tried to link DERBY-1888 to DERBY-1889 but I got the following error:
>
> Errors
> An error occurred: com.atlassian.jira.exception.DataAccessException:
> org.ofbiz.core.entity.GenericEntityException: while inserting:
> [GenericEntity:IssueLink][destination,12351773][linktype,12310010][source,12351772][sequence,null][id,12313532]
> (SQL Exception while executing the following:INSERT INTO issuelink (ID,
> LINKTYPE, SOURCE, DESTINATION, SEQUENCE) VALUES (?, ?, ?, ?, ?)
> (Duplicate entry '12313532' for key 1))
>
> Has anyone seen this error before?
>
>
>
>
>