lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Sale (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-127) broken test case: Lucene.Net.Analysis.TestStandardAnalyzer.TestDeprecatedAcronyms()
Date Fri, 01 Aug 2008 18:34:34 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619091#action_12619091
] 

Doug Sale commented on LUCENENET-127:
-------------------------------------

I couldn't disagree more.  The only change made is to compensate for the
variation between NUnit and JUnit invocations.

JUnit creates a new instance of the unit test *class* for every unit test
*method* invocation.  Thus, a variable that is initialized when a class is
instantiated is *initiailized prior to every unit test method invocation*.

NUnit only instantiates the unit test class *once*.  Thus, an initialized
instance variable may have a different state for a particular unit test
method invocation, depending on what unit test methods were run prior.

In TestStandardAnalyzer, I simply re-initialized the variable for the given
test method, *to ensure it has the same state as its counterpart in the
JUnit test case*.

Test-first functionality and agile programming practices state that the unit
test is the *explicit* defining contract of the class' behavior.  It is
possible, as you indicate, that the "intended" behavior of StandardAnalyzer
should be different.  However, that is an implicit assumption not dictated
by the Java code.






> broken test case: Lucene.Net.Analysis.TestStandardAnalyzer.TestDeprecatedAcronyms()
> -----------------------------------------------------------------------------------
>
>                 Key: LUCENENET-127
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-127
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Doug Sale
>            Priority: Minor
>         Attachments: TestStandardAnalyzer.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> Test case TestDeprecatedAcronyms() fails when run with all unit tests in test class TestStandardAnalyzer.cs
but succeeds when run alone.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message