@Test
public void testSearch_NamingException() throws Exception {

	expectGetReadOnlyContext();
	SearchControls controls = searchControlsRecursive();
	controls.setReturningObjFlag(false);
	javax.naming.LimitExceededException ne = new javax.naming.LimitExceededException();
       when(dirContextMock.search(
               eq(nameMock),
               eq("(ou=somevalue)"),
               argThat(new SearchControlsMatcher(controls)))).thenThrow(ne);
	try {
		tested.search(nameMock, "(ou=somevalue)", handlerMock);
		fail("LimitExceededException expected");
	}
	catch (LimitExceededException expected) {
		// expected
	}
       verify(dirContextMock).close();
}