Skip to content

Conversation

@conniey
Copy link
Contributor

@conniey conniey commented Jul 15, 2016

This PR would allow an easier transition to using xUnit. xUnit by default, runs its tests in parallel and asynchronously. The current use of mutable static fields limits in test cases the ability to utilise this.

  • Changing existing static variables to static readonly so we are explicit that these variables are set once and do not change.
  • Change OLD_FORMAT_IMPERSONATION_IS_ACTIVE to non-static field since other tests share and use this variable
  • Change ClassEnvRule to non-static since every test class generates its own rule during test
  • Change dependent static methods in LuceneTestCase to non-static because their state depended on the state of these non-static variables

this.LastDoc = lastDoc;
this.LastReader = lastReader;
this.Context = context;
NewSearcher = newSearcher;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewSearcherFunc would be a more appropriate name I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@synhershko
Copy link
Contributor

Thanks @conniey , looks good! I left a few comments - the main idea is to minimize the amount of non-Java compatible changes we make and to document well the ones we have to make.

@conniey
Copy link
Contributor Author

conniey commented Aug 4, 2016

Closing this PR because I created an improved one.

@conniey conniey closed this Aug 4, 2016
@conniey conniey deleted the staticLuceneTestCase branch August 8, 2016 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants