Code example for SearchControls

Methods: setCountLimitsetReturningAttributessetSearchScopesetTimeLimit

0
 
    @Test
    public void testValidateDirContextAssertions() throws Exception {
        final DefaultDirContextValidator dirContextValidator = new DefaultDirContextValidator();
 
        try { 
            dirContextValidator.validateDirContext(DirContextType.READ_ONLY,
                    null); 
            fail("IllegalArgumentException expected"); 
        } catch (IllegalArgumentException expected) {
            assertTrue(true); 
        } 
 
        try { 
            dirContextValidator.validateDirContext(null, dirContextMock);
            fail("IllegalArgumentException expected"); 
        } catch (IllegalArgumentException expected) {
            assertTrue(true); 
        } 
    }