You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "NightOwl888 (via GitHub)" <gi...@apache.org> on 2024/11/10 15:57:42 UTC
[I] Task: Rename BeforeClass() to OneTimeSetUp() and AfterClass() to OneTimeTearDown() to match NUnit Conventions [lucenenet]
NightOwl888 opened a new issue, #1016:
URL: https://github.com/apache/lucenenet/issues/1016
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Task description
The "before" and "after" methods are inconsistently named in `LuceneTestCase`. Here is a comparison:
| JUnit | NUnit | Lucene.NET |
|------|------|------|
| `@Before` | `[SetUp]` | `SetUp()` |
| `@After` | `[TearDown]` | `TearDown()` |
| `@BeforeClass` | `[OneTimeSetUp]` | `BeforeClass()` |
| `@AfterClass` | `[OneTimeTearDown]` | `AfterClass()` |
It is more sensible to follow NUnit conventions than JUnit. To match NUnit, we should be using `OneTimeSetUp()` and `OneTimeTearDown()` as method names rather than `BeforeClass()` and `AfterClass()`.
> **NOTE: ** These cannot be made static as they were in Lucene because NUnit calls the base class first rather than the outermost subclass. So, we are relying on .NET method overrides instead because the order is critical to clean up properly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Task: Rename BeforeClass() to OneTimeSetUp() and AfterClass() to OneTimeTearDown() to match NUnit Conventions [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin closed issue #1016: Task: Rename BeforeClass() to OneTimeSetUp() and AfterClass() to OneTimeTearDown() to match NUnit Conventions
URL: https://github.com/apache/lucenenet/issues/1016
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org