• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Lightweight LDAP provider

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got a data access class that fetches user info from LDAP. I'd like to write unit tests for it, similarly to how you can write unit tests for database DA classes by either (i) inserting test data into the database in setUp or (ii) having a pre-populated test database and then you call your DA and assert that it got the data correctly.
Thus I need a small lightweight LDAP provider that I can set up and populate with test data to test my LdapDA class.
Any ideas on what's available?
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really need a full LDAP provider, or will a simple JNDI store implementation be enough? An in-memory JNDI store is very easy to write - I'm sure I've got one lying around here somewhere.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just another tip: if your data access class contains any logic besides accessing LDAP, you should decouple one from the other (by using an abstraction layer). The non-LDAP logic should be testable without any LDAP provider (that way, it is also *reusable* for non-LDAP clients).
reply
    Bookmark Topic Watch Topic
  • New Topic