Ugh. One of the reasons I HATE writing test code. It usually amounts to about 80% of the time spent coding.

Nice thing about it, it makes my life so much easier if the specs for the application don't change. (if they do, I have to rewrite both the app and test code, blech).

(PS, I noticed that I have a tendency to end my sentences with a semicolon. If anyone else notices this, go out, walk to nearest pub/bar and order yourself a cold one: you've been working too long, and it's Friday).

;)

Kris Schneider wrote:

So who's testing the test code ;-)? Glad it's working...

Quoting "Raible, Matt" <[EMAIL PROTECTED]>:



It turned out to be an issue with my Cactus TestCase.  See solution marked
<<-- below

   protected void setUp() throws Exception {
       super.setUp();
       servlet = new RegistrationServlet();
       servlet.init(config); <<-- Adding this fixed the problem.
   }

Thanks for kicking my brain into gear.

Matt

-----Original Message-----
From: Raible, Matt Sent: Friday, May 30, 2003 12:55 PM
To: 'Struts Users Mailing List'
Subject: RE: NPE with getResourceAsStream



I'm doing this in an execute(request,response) method that both doGet() and doPost() call.

-----Original Message-----
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Friday, May 30, 2003 12:39 PM
To: Struts Users Mailing List
Subject: Re: NPE with getResourceAsStream


Are you doing this in the constructor or an overridden init(ServletConfig) that hasn't invoked super.init(config)?

Quoting "Raible, Matt" <[EMAIL PROTECTED]>:



In a regular servlet, I'm trying to do the following:

InputStream forms =

getServletContext().getResourceAsStream("/WEB-INF/validation.xml");

But it's throwing a NPE, and validation.xml is in my WEB-INF folder.  Any
ideas why this may be happening?

Thanks,

Matt


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



--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech <http://www.dotech.com/>








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



Reply via email to