Skip to content
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
merged 39 commits into from Dec 18, 2014
Merged

Conversation

pmauduit
Copy link
Member

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:

  • User
    • Create
    • Update
    • Delete
  • Group
    • Create
    • Update
    • Delete
  • User / Group
    • Affectation
    • De-affectation
  • Lost Password

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.

  • New account

Note: same remark, both "welcome mail" and "mail to warn the useradmin" were sent.

pmauduit and others added 30 commits December 10, 2014 19:29
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.
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, 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.
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.
@jesseeichar
Copy link
Member

Looks good. yay for more tests.

@fvanderbiest
Copy link
Member

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.

fvanderbiest added a commit that referenced this pull request Dec 18, 2014
@fvanderbiest fvanderbiest merged commit ad9791b into georchestra:master Dec 18, 2014
@fvanderbiest fvanderbiest added this to the 14.12 milestone Dec 18, 2014
@pmauduit pmauduit deleted the ldapadmin_testsuite branch August 28, 2019 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants