-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lighthouse#2273: Stop Fixtures attempting to set static (Map) fields #1281
Lighthouse#2273: Stop Fixtures attempting to set static (Map) fields #1281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tazmaniax Could you add some test?
@asolntsev not something I've done before but how hard can it be :) I'll be back... |
@asolntsev @xael-fry I've run into a class loading issue with my unit test, any idea?
|
@tazmaniax Sure. Your class is located in package Write full class name in play.test.models.ClassWithStaticMap(instanceA):
name: hello |
@asolntsev thanks. I was hoping the Play classloader, with the way I'd configured it would have added the test folder as a classpath endpoint so the relative path of "models" would have been picked up but alas no. As it turns out when I did what you suggested Play prefixed the fully qualified class name with "models." so I got another class loading exception...
Anyway I got it working after jumping through some mocking hoops with application classes and plugins. Let me know if there was a better way and also if my unit test is valid, thx! Otherwise hopefully this can be accepted. |
@tazmaniax Yes, it's a bad thing that Play adds prefix |
@asolntsev ah that's a much better idea. My first impulse was to keep all of the test assets as close together as possible so it was easier to reason about and there was no prior example of the models package being used but I totally agree it's a better solution than my class loading magic. However on the flip side I did get a better understanding of the Play class loading :) |
@asolntsev is this good to go? |
@tazmaniax @xael-fry PR is good. Recommended to merge. |
@xael-fry could you merge this? Once this is merged I'm going to build the head of master. thx |
@asolntsev @xael-fry can this be merged? |
@tazmaniax I squashed 9 commits and merged to master branch. Thank you for the contribution! |
@asolntsev thx! |
…om old_master to master Commit b91659a ("[playframework#878] Add OrderBy support in simplified queries") was never ported to master. The changes from Pull Request playframework#504 touched some parts of it, therefore half of the OrderBy change sneaked in to the "new" master. Fixing by removing the irrelevant OrderBy change. In method findByToJPQL in file framework/src/play/db/jpa/JPQL.java: - old_master merge commit has only StringBuilder related change - master "merge" commit has this OrderBy change too old_master merge commit: b6797a1 ported master commit: 97c54d2 Fix: 97c54d2 ("Merge pull request playframework#504 from marcelmay/lighthouse-1502-patch")
Fixes
Lighthouse #2273
Purpose
Stops Fixtures attempting to set static (Map) fields
Background Context
Fixtures probably shouldn't be setting static fields