lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer" <simon.willna...@googlemail.com>
Subject Re: Test failure question
Date Fri, 16 Jun 2006 16:38:32 GMT
On 6/16/06, George Aroush <george@aroush.net> wrote:
> Hi folks,
>
> I realize this question is not directly related to Lucene, but I believe
> it's worth asking.
>
> With Lucene.Net (for those who don't know, is a port of Jakarta Lucene from
> Java to C#) I use NUnit to test the same test code (ported to C#) that JUnit
> test.  When I run the NUnit test there are 3 separate test cases where the
> test is failing if the test is run as a group but will pass if each of those
> tests run individually.
>
> For example, the tests in TestPhraseQuery, which has
> testBarelyCloseEnough(), testExact(), testMulipleTerms(), etc.  When I run
> the entire test cases by selecting TestPhraseQuery node, the test starts
> from the top to bottom and testMulipleTerms() will fail.  But if I run
> testMulipleTerms() by itself it will pass.  The fail point is on the first
> assert line in testMulipleTerms() -- which is (in the NUnit world):
>
>         Assert.AreEqual(1, hits.Length(), "two total moves");
>
> My question to you is this: does anyone know if JUnit will call setUP() and
> tearDown() before and after each test method call or is setUp()/tearDown()
> are only called once at test startup and shutdown?  The fail is, I am
> getting back a 0, where the expected value should be 1.
>
setUp and tearDown will be called before and after each test runs!
http://www.junit.org/junit/javadoc/3.8.1/junit/framework/TestCase.html#setUp()
and I bet it is the same in NUnit

simon
This is rather a junit questing
> Knowing this will help me diagnoses the problem.
>
> Regards,
>
> -- George
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

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


Mime
View raw message