Hi all,

I have two servlets that I am testing, UserDAO and LoginServlet. UserDAO
is (obviously) a Data Access Object that gets some info from a database,
puts it in a bean, and stores it in session scope. I have three tests in
my TestUserDAO class, all of which pass: testGoodLogin, testBadLogin,
and testNonExistentLogin.

Here's where it gets weird. Since the UserDAO class does most of the
work, my LoginServlet does a RequestDispatcher.forward to UserDAO. The
tests I have in my TestLoginServlet class are exactly the same as those
for TestUserDAO, but the final test -- testNonExistentLogin -- fails
with a NullPointerException every single time.

This wouldn't be so odd where it not that (a) All the tests work in
TestUserDAO, (b) the first two tests pass in TestLoginServlet, which
tells me I'm probably not having a configuration issue, and (c) the
servlets behave as they should when I do manual testing from the
browser.

Any ideas?

-= James



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to