File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes Issue in running standalone Junit Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Issue in running standalone Junit Class" Watch "Issue in running standalone Junit Class" New topic

Issue in running standalone Junit Class

Vikram Gosain

Joined: Jun 02, 2009
Posts: 25
In my standalone Junit class the code that I have written is

And I am getting the exception..

Could anyone please help me fixing this?

Tomek Kaczanowski
Ranch Hand

Joined: Oct 26, 2005
Posts: 40


the bug does not seem to be related to JUnit. When googling for the error you got, I find a lot of resources all pointing out to the fact that the LDAP server does not approve anonymous connections. This is most probably the source of your problems. I can't help you with LDAP, but google has answers.

To make it a little bit easier, I would suggest to create a simple "main" method and put the LDAP connection code there, and work on it as long as I do not get the connectivity right. After this I would move the working code to setUp method.

Tomek Kaczanowski
Book author: Practical Unit Testing with TestNG and Mockito
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33111

Anand Bhatt,
Your post was moved to a new topic.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Issue in running standalone Junit Class
It's not a secret anymore!