You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Doug Cutting <cu...@lucene.com> on 2003/10/22 18:19:52 UTC

unit test issues

Several of the unit tests cause lots of stuff to be printed to the 
console.  Shouldn't this be instead captured in the test output files? 
I've seen this before with JUnit and never understood what caused it. 
Does anyone know how to fix this?  I find it annoying.

Also, several of the unit tests leave files around, even after 'ant 
clean'.  These files are named 'testIndex', 'testDoc' and 
'velocity.log'.  I think it would be better if these were placed 
somewhere in the build directory, so that 'ant clean' removes them, but 
I don't have time to fix this right now.  Volunteers?

Doug


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Hani Suleiman <ha...@formicary.net>.
I can look over this and submit patches if nobody has by tonight.

Doug Cutting wrote:

> Several of the unit tests cause lots of stuff to be printed to the 
> console.  Shouldn't this be instead captured in the test output files? 
> I've seen this before with JUnit and never understood what caused it. 
> Does anyone know how to fix this?  I find it annoying.
> 
> Also, several of the unit tests leave files around, even after 'ant 
> clean'.  These files are named 'testIndex', 'testDoc' and 
> 'velocity.log'.  I think it would be better if these were placed 
> somewhere in the build directory, so that 'ant clean' removes them, but 
> I don't have time to fix this right now.  Volunteers?
> 
> Doug
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, October 22, 2003, at 12:19  PM, Doug Cutting wrote:
> Several of the unit tests cause lots of stuff to be printed to the 
> console.  Shouldn't this be instead captured in the test output files? 
> I've seen this before with JUnit and never understood what caused it. 
> Does anyone know how to fix this?  I find it annoying.

I've commented out the System.out.println's that were occurring in the 
test cases.  I hope this was the console output you were referring to.  
We could trim up the <junit> output a little more probably too, but its 
pretty much as bare minimum as possible now.


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, October 22, 2003, at 12:19  PM, Doug Cutting wrote:
> Also, several of the unit tests leave files around, even after 'ant 
> clean'.  These files are named 'testIndex', 'testDoc' and 
> 'velocity.log'.  I think it would be better if these were placed 
> somewhere in the build directory, so that 'ant clean' removes them, 
> but I don't have time to fix this right now.  Volunteers?

I added a removal of velocity.log from the clean, and modified the test 
cases that created files to use a system property for its location.  If 
folks are running tests from an IDE or standalone outside of Ant, speak 
up and we can adjust it to have a reasonable default in non-Ant 
environments.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, October 22, 2003, at 09:59  PM, Hani Suleiman wrote:
> From the docs, looks like you pass in a velocityPropertiesFile 
> attribute that specifies the logging options.

Yeah, it also defaults to reading velocity.properties in the root 
directory.  I tried adding a ./velocity.properties with this line:

	runtime.log=build/velocity.log

And it screwed up 'ant docs' - apparently all the Velocity properties 
are either specified in that file or within code, with no decent 
defaults for ones not in that file.  Yeah, some hacking in the Anakia 
code would fix this, but I'm not inclined to do this.  Having the clean 
target remove velocity.log seems the most pragmatic solution for now - 
unless someone else wants to fiddle with it.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Hani Suleiman <ha...@formicary.net>.
 From the docs, looks like you pass in a velocityPropertiesFile  
attribute that specifies the logging options.

On Wednesday, October 22, 2003, at 02:17 PM, Erik Hatcher wrote:

>
> On Wednesday, October 22, 2003, at 02:07  PM, Hani Suleiman wrote:
>> Velocity's logging can be configured to behave in a saner and more  
>> socially acceptable manner:
>>
>> http://jakarta.apache.org/velocity/developer- 
>> guide.html#Configuring%20the%20Log%20System
>
> Right, I know.  In fact, I'm doing a new Velocity presentation for the  
> first time this weekend :)
> 	http://www.nofluffjuststuff.com/2003-10-atlanta/presentations.jsp
>
> But how do you adjust the logging from Anakia in the Lucene build.xml  
> file here?
>
>     <anakia
>       basedir="xdocs"
>       destdir="docs/"
>       extension=".html" style="./site.vsl"
>       projectFile="stylesheets/project.xml"
>       excludes="**/stylesheets/** empty.xml"
>       includes="**/*.xml"
>       lastModifiedCheck="true"
>       templatePath="${jakarta.site2.home}/xdocs/stylesheets"
>       >
>     </anakia>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Erik,

> But how do you adjust the logging from Anakia in the Lucene build.xml
>  
> file here?
> 
>      <anakia
>        basedir="xdocs"
>        destdir="docs/"
>        extension=".html" style="./site.vsl"
>        projectFile="stylesheets/project.xml"
>        excludes="**/stylesheets/** empty.xml"
>        includes="**/*.xml"
>        lastModifiedCheck="true"
>        templatePath="${jakarta.site2.home}/xdocs/stylesheets"
>        >
>      </anakia>

The first thing that came to my mind: my velocity.log to build (in
Ant-lingo) after that call above.

Otis


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, October 22, 2003, at 02:07  PM, Hani Suleiman wrote:
> Velocity's logging can be configured to behave in a saner and more  
> socially acceptable manner:
>
> http://jakarta.apache.org/velocity/developer- 
> guide.html#Configuring%20the%20Log%20System

Right, I know.  In fact, I'm doing a new Velocity presentation for the  
first time this weekend :)
	http://www.nofluffjuststuff.com/2003-10-atlanta/presentations.jsp

But how do you adjust the logging from Anakia in the Lucene build.xml  
file here?

     <anakia
       basedir="xdocs"
       destdir="docs/"
       extension=".html" style="./site.vsl"
       projectFile="stylesheets/project.xml"
       excludes="**/stylesheets/** empty.xml"
       includes="**/*.xml"
       lastModifiedCheck="true"
       templatePath="${jakarta.site2.home}/xdocs/stylesheets"
       >
     </anakia>




---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Hani Suleiman <ha...@formicary.net>.
Velocity's logging can be configured to behave in a saner and more 
socially acceptable manner:

http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20the%20Log%20System

Erik Hatcher wrote:
> On Wednesday, October 22, 2003, at 12:19  PM, Doug Cutting wrote:
> 
>> Several of the unit tests cause lots of stuff to be printed to the 
>> console.  Shouldn't this be instead captured in the test output files? 
>> I've seen this before with JUnit and never understood what caused it. 
>> Does anyone know how to fix this?  I find it annoying.
> 
> 
> I'll have a look at this stuff too.  It is annoying to have unit tests 
> that do System.out.println's, and these should be commented out or 
> turned into asserts.
> 
>> Also, several of the unit tests leave files around, even after 'ant 
>> clean'.  These files are named 'testIndex', 'testDoc' and 
>> 'velocity.log'.  I think it would be better if these were placed 
>> somewhere in the build directory, so that 'ant clean' removes them, 
>> but I don't have time to fix this right now.  Volunteers?
> 
> 
> the testIndex and testDoc should be converted to putting things in a 
> temporary directory defined from the Ant build file in a system property 
> and put in the "build" directory so clean will take care of it.  I'll 
> look to see about fixing that.
> 
> velocity.log comes from the anakia documentation generation stuff.  very 
> very annoying, i agree!  i'm not sure what, if anything, can be done 
> about that other than add that to the clean as a special case.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: unit test issues

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, October 22, 2003, at 12:19  PM, Doug Cutting wrote:
> Several of the unit tests cause lots of stuff to be printed to the 
> console.  Shouldn't this be instead captured in the test output files? 
> I've seen this before with JUnit and never understood what caused it. 
> Does anyone know how to fix this?  I find it annoying.

I'll have a look at this stuff too.  It is annoying to have unit tests 
that do System.out.println's, and these should be commented out or 
turned into asserts.

> Also, several of the unit tests leave files around, even after 'ant 
> clean'.  These files are named 'testIndex', 'testDoc' and 
> 'velocity.log'.  I think it would be better if these were placed 
> somewhere in the build directory, so that 'ant clean' removes them, 
> but I don't have time to fix this right now.  Volunteers?

the testIndex and testDoc should be converted to putting things in a 
temporary directory defined from the Ant build file in a system 
property and put in the "build" directory so clean will take care of 
it.  I'll look to see about fixing that.

velocity.log comes from the anakia documentation generation stuff.  
very very annoying, i agree!  i'm not sure what, if anything, can be 
done about that other than add that to the clean as a special case.


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org