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 Vemund Ostgaard <Ve...@Sun.COM> on 2007/10/26 16:39:49 UTC

Converting tests to junit

Having a wish to contribute to the test conversion effort I've been 
looking at the wiki to figure out where to start.

I found this wiki page, 
http://wiki.apache.org/db-derby/KillDerbyTestHarness, that has a list of 
all the subsuites from the old harness testsuite and a status for the 
number of tests converted. The last update on this page seems to have 
been in May, so I'm not confident it is totally up to date with the 
current status. Anyhow, from that page I gathered there was a focus on 
the derbylang suite, which seemed a good place to start, so I looked at 
http://wiki.apache.org/db-derby/LangJunitTestConversion for the details.

Wanting to start with something not too big to get to know the junit 
framework first, I found the tests logStream.java and errorStream.java, 
that are related to the same area and aparently noone is working on.

So, I hope I can just create a jira for the conversion of these two 
tests, and add the jira to the "notes" column on 
http://wiki.apache.org/db-derby/LangJunitTestConversion, and that will 
be sufficient to avoid anyone else starting to work on the same tests? I 
also hope that it is sufficient to look at that page to make sure noone 
else is allready working on it, or should I search jira as well? Anyhow, 
I'm asking here to be sure.

I was a bit surprised to find these two tests that test functionality of 
the derby error stream in the derbylang suite, which I expected to be 
only sql-related tests. Maybe they didn't fit well in any other suites 
either. Is it a goal for the conversion to keep basically the same set 
of subsuites as in the old harness testsuite?

Vemund





lang/infostreams.sql

Posted by Vemund Ostgaard <Ve...@Sun.COM>.
While searching the old testsuite for more tests related to "derby.log" 
that I could port to junit, I came across lang/infostreams.sql. This 
test seems to do basically nothing, except that the database gets booted 
by the test framework with a number of special properties set in 
lang/infostreams_derby.properties that seem related to the derby error 
stream. The problem is that most or all of these properties don't seem 
to be supported, at least I have trouble finding any code in Derby that 
handles them. I found a list of properties in the tuning guide, but 
couldn't find these properties there either, can I trust that list to be 
complete? Does anyone know anything about this test, or the properties 
it is designed to test?

If these properties are in fact supported I would like to expand the new 
junit test, ErrorStream.java, to test them. If not, then I think 
lang/infostreams.sql should just be removed from the old testsuite.

Vemund


Re: Converting tests to junit

Posted by Vemund Ostgaard <Ve...@Sun.COM>.
Knut Anders Hatlen wrote:
> Vemund Ostgaard <Ve...@Sun.COM> writes:
>
>   
>> I was a bit surprised to find these two tests that test functionality
>> of the derby error stream in the derbylang suite, which I expected to
>> be only sql-related tests. Maybe they didn't fit well in any other
>> suites either. Is it a goal for the conversion to keep basically the
>> same set of subsuites as in the old harness testsuite?
>>     
>
> Hi Vemund,
>
> If there are tests that you think are misplaced, they should be moved
> into the appropriate suite when they are converted to JUnit, IMO. If
> none of the existing ones seems to fit, I think you should just go ahead
> and create a new suite. The suites are fairly lightweight in JUnit, so
> if it makes the structure clearer, I think it's worth the extra effort.
>   
I was thinking of the directory/package structure under 
java/testing/org/apache/derbyTesting/functionTests/tests/
As far as I could understand the subdirectories there are the basis both 
for the old harness suites and for the subsuites under suites.All?

The tests I am looking at are for the "derby.log" file and 
derby.stream.error.* properties. Looking at the Derby modules this 
functionality seemed closest to the engine module. Maybe a new "engine" 
suite could be the right place?

Vemund

Re: Converting tests to junit

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Vemund Ostgaard <Ve...@Sun.COM> writes:

> I was a bit surprised to find these two tests that test functionality
> of the derby error stream in the derbylang suite, which I expected to
> be only sql-related tests. Maybe they didn't fit well in any other
> suites either. Is it a goal for the conversion to keep basically the
> same set of subsuites as in the old harness testsuite?

Hi Vemund,

If there are tests that you think are misplaced, they should be moved
into the appropriate suite when they are converted to JUnit, IMO. If
none of the existing ones seems to fit, I think you should just go ahead
and create a new suite. The suites are fairly lightweight in JUnit, so
if it makes the structure clearer, I think it's worth the extra effort.

-- 
Knut Anders