jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: TCK issue: Closing Session in tearDown()
Date Tue, 26 Apr 2005 16:02:30 GMT
Hi Maxim,

Maxim wrote:
> Hello jackrabbit-dev.
> 
> The most of TCK test cases closes opened sessions via Session.logout().
> However there are a few test cases which do not.
> 
> Would you consider to add such code to tearDown() methods:
> 
> In files:
> src/test/org/apache/jackrabbit/test/api/AbstractPropertyTest.java
> src/test/org/apache/jackrabbit/test/api/SessionReadMethodsTest.java
> src/test/org/apache/jackrabbit/test/api/ExportSysViewTest.java
> src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java

you are right, the sessions aquired in the setUp methods of those tests 
are never closed. I have extended the tests accordingly in svn revision: 
  164806

thanks a lot for pointing that out.

> Notes:
> 
> 1. I'm not really sure that condition "if (session != null)" is really
> necessary. Probably unconditional session.logout() will work just fine.

well, I believe the reason was, that if the test case fails early the 
tearDown() won't throw a NullPointerException. Though I'm not sure if 
JUnit calls tearDown() if setUp() was not successful.

> 2. There may be other places in TCK to check for closing sessions as well.

I'll check the other test cases.

thanks again for your help.

regards
  marcel

Mime
View raw message