This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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: 32301

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]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, 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!