aspose file tools*
The moose likes Servlets and the fly likes Testing the code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Testing the code" Watch "Testing the code" New topic
Author

Testing the code

madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
Hi all

i would like to know is there any enviornment or site.. for testing our servlet code and jdbc coding without installing any servers and databases..

If you know please send me the URL and instructions how to test the code.

thanks and regards

Madhav
madhav.cns@gmail.com

SCJCP1.4
SCWCD (preparing)


saivenumadhav
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Testing a database without a database, or testing a Servlet without a server seems like it would be impossible....or would it?

I think what you want is JMock at www.jmock.org

jMock is a library for testing Java code using mock objects1.

Mock objects help you design and test the interactions between the objects in your programs.

The jMock package:

* makes it quick and easy to define mock objects, so you don't break the rhythm of programming.
* lets you define flexible constraints over object interactions, reducing the brittleness of your tests.
* is easy to extend.


You can create mock objects that behave like a database connection, and test against them. As a result, you can test your code, but not really have a database connection. JMock is great.

I'm not sure how you mock out a Servlet though.

Give it a try!

-Cameron McKenzie
madhav changala
Ranch Hand

Joined: Dec 20, 2005
Posts: 57
Thansk Cameron W. McKenzie

What i mean testing the code .. is not the junit or someotherthing else ...

Actually what i need is i want to run my servlet code and jdbc code with out installing server amd databases in my local machine ...

Any webiste which will run our code display result...

thanks and regards
Madhav
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Testing the code