directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lécharny <elecha...@gmail.com>
Subject Re: LdapConnectionTemplate
Date Sun, 11 May 2014 17:44:13 GMT
Le 5/10/14 11:18 PM, Lucas Theisen a écrit :
> Hi,

Hi Lucas,

I will have a look at the added code. Atm, I'm a bit stuck migrating
from my old computer to the new one, and I just restored my eclipse env
with all the code I'm working on. Still have various other tools
(lmails, etc) to set.

Anyway, thanks for this addition !

>
> I just committed the code for LdapConnectionTemplate.  It is similar in
> concept to JdbcTemplate from Spring with the goal of reducing the
> boilerplate code.  I added all the CRUD operations with a couple friendly
> overloads.  I also added some methods for dealing with authentication and
> password updates that respects password policy.  Would you let me know if I
> missed something?
>
> Also, in doing this, I made some updates to the testing infrastructure.  To
> start with, I added a new annotation @CreateLdapConnectionPool that allows
> you to configure a connection pool for your unit tests.  Then I created 3
> new TestRule's that can be used in place of the FrameworkRunner:
> CreateDsRule, CreateLdapServerRule, and CreateLdapConnectionPoolRule.
> CreateLdapConnectionPoolRule extends CreateLdapServerRule, which in turn
> extends CreateDsRule.  That means if you use CreateLdapConnectionPoolRule
> you get all of the annotation processing it has, plus that of
> CreateLdapServerRue, which in turn, provides that of CreateDsRule.  You
> will need to create 2 instances of the rule you want to use, one should be
> annotated with @ClassRule, one with @TestRule.  The @TestRule instance
> should be constructed with the @ClassRule instance as an argument to its
> constructor.  This allows you to annotate both at a class level, and a
> method level.  While this might sound like a little more work than using
> the FrameworkRunner, it means you will now be free to incorporate other
> runners (like the Spring test runner) and you no longer have to extend any
> base class. I put together some unit tests in the test-framework project
> that demonstrate how to use them.
>
> Anyway, I would love to hear what you all think about this stuff.
>
> Thanks,
> Lucas
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Mime
View raw message