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
Ldapadmin testsuite #843
Merged
fvanderbiest
merged 39 commits into
georchestra:master
from
pmauduit:ldapadmin_testsuite
Dec 18, 2014
Merged
Ldapadmin testsuite #843
fvanderbiest
merged 39 commits into
georchestra:master
from
pmauduit:ldapadmin_testsuite
Dec 18, 2014
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Still TODO: refactor (DRY).
Still TODO: refactor (DRY).
- introducing a testsuite for EditUserDetails controller (WIP) - some modifications on Email testsuite (I'm not sure on how to begin with, with this one, let's see later).
PR has been merged a bit early, when there was still a test with fail ("not yet implemented"). This fixes the general case for testEdit() method, on the EditUserDetailsFormController test suite.
Begin to implement SQL-related testsuite
- introducing a testsuite for EditUserDetails controller (WIP) - some modifications on Email testsuite (I'm not sure on how to begin with, with this one, let's see later).
PR has been merged a bit early, when there was still a test with fail ("not yet implemented"). This fixes the general case for testEdit() method, on the EditUserDetailsFormController test suite.
Doing substitutions into a property file which is sourced by spring directly into the XML file (as it is actually done on the security-proxy / downloadform ...). Begining to rewrite UserTokenDao so that it uses a connection pool, instead of opening a PG connection each time it is needed (bug prone). Ensuring that the connection is closed after use. TODO: this has been done before the will to add some utests, completing the testsuite. So, next work is to test it.
Not implemented yet.
Adding some tests around UserTokenDao
Also fixing a bug in my refactoring (use of database pool instead of reopening a connection each time). Global coverage is now 31% onto ldapadmin.
Adding a test for HomeController
Taking back work from master, improving test so that it is able to mock or query a regular remote LDAP server, depending on the properties set at JVM startup.
Fixing a bug in RequestUtil (possible ArrayOutOfBound exception)
Completing the previously introduced one to the other CRUD operations related to groups / user membership. This leverages the global test coverage on ldapadmin to 57%.
Still in a WIP state.
Still in a WIP state, committing prematurely so that I'm able to test a regression onto 14.01 security-proxy
The mapper between LDAP <-> Java does not take into account user membership. This ensures that members are correctly mapped before saving the object to the LDAP tree.
Continuing on UsersController, adding a test on UserRule.
There were 2 classes remaining in the old lib.mailservice package, so it did not really make sense to keep them separated from the ldapadmin.mailservice package.
This is to avoid the need of copy/replace the webmvc-config.xml file, using the autogenerated WEB-INF/ldapadmin.properties instead. this repairs runtime launch via jetty:run.
fixing tab/spaces mix
finishing UsersController testsuite, leveraging the package to 92% coverage (73% overall).
The Validation class needs rework, because for now, it is hard to tell in which state the required fields member variable is in. Tests results (when removing the @ignore annotation) is unpredictable.
[WARNING] The repository url 'http://scala-tools.org/repo-releases' is invalid - Repository 'scala-tools.org' will be blacklisted.
Missing driver class name when spawning a bean for Apache DBCP.
Looks good. yay for more tests. |
Note: the PR removes the broken Travis JS checks made by @severo I think it's fine as long as we create an other issue to restore those tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to leverage a bit the test coverage specifically on the LDAPAdmin application. After applying these commits, the global test coverage increases from 19% to 73%. In addition, some minor modifications have been made, related to using Apache DBCP and the configuration/build process.
Even if the goal is to make sure further developments won't imply regressions, some manual tests have been made:
Note: exim was misconfigured on my computer, but the mail has been frozen in the exim4 queue, after checking, it was correctly sent by the webapp.
Note: same remark, both "welcome mail" and "mail to warn the useradmin" were sent.