-
Notifications
You must be signed in to change notification settings - Fork 5
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
Read suffix or prefix from file #13
Comments
Perfect. Thanks @S-Koell . I suggest to use something like this for the property file:
This should work for all operating systems. Naming the property file according the validator class should make the relation and its purpose clear. |
Okay I'll implement it like that :). |
You could handle that in TrivadisGuidelines3PlusTest.xtend. I'd add a setup method (annotated with Then I'd add an additional test case, creating a property file with a few properties different to the defaults and test, if they are applied. That's it. |
And don't forget the cleanup. You may annotate the setup method with |
I would still leave an example properties in this repo under (a newly created) /resources folder instead of the plugin folder. |
No, I'm against it. The reason is that I suspect that I need two property files when I use the CLI and the SQL Developer extension on one computer. I think that would be wrong. |
But the custom properties are gonna be in the user home folder? The ones from this repo are just for guidance and will not be used from the /resources folder. A question regarding the tests: We have 3 possible solutions:
|
You meant an example properties file. Still, I do not think it is necessary. It's clear based on the code and the test case. Regarding the tests I see another solution. The class specific setup ensures that no property file is available. Either via rename or delete. This ensures that all existing test cases work as today. For test cases requiring a property file, do the setup as first thing in the test case (create the file with the relevant properties) and do the cleanup (delete this property file) at the end of the test case. This should do the trick. |
Okay. Regarding testing:
But I dont know how to access the TrivadisGuidelines3Plus instance yet because we have no variable. |
Look at setupValidator. This is initiated before every test. At this point you can delete/rename the existing property file. You could extend this method. I would add an additional one. Order does not matter in this case. This should really work. If it doesn't, then I suggest that you commit the test class in the PR and I can point out the changes based on the code to make it work. |
setupValidator has @BeforeClass. |
The problem is not the deletion/movement. The problem is the creation! |
Of course. You are right. I did not see the problem. Sorry. Ok, in this case I suggest the following: a) extend the existing test class TrivadisGuidelines3PlusTest
b) create a new test class TrivadisGuidelines3PlusPropertyFileTest
|
In order to have deviating pre-/suffixes than the default ones in the guidelines, it would be great to have them optionally defined externally.
At the moment they are hardcoded into the validator.
Requirements:
( see pull request: #12 )
The text was updated successfully, but these errors were encountered: