This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes JUnit test an Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "JUnit test an Applet" Watch "JUnit test an Applet" New topic

JUnit test an Applet

Dar Var
Ranch Hand

Joined: Oct 12, 2004
Posts: 74

Does anyone know how the JUnit test an Applet.

Basically I want to be able to pass the applet parameters and make sure it's methods function correctly with these parameters.

The Applet is a non GUI Applet.

Any examples would be legend.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41173
You could add a main method so that the applet works as an application as well. Then you can override the "getParameter" method so that it either calls applet.getParameter (if run as an applet), or (e.g.) reads the parameters from a property file (if run as an application).

Ping & DNS - my free Android networking tools app
I agree. Here's the link:
subject: JUnit test an Applet
Similar Threads
Test cases
@Autowired not working in JUnit using spring 2.5
why JUnit?
i need to extrend TestCase in order to use asserts of junit right
JUnit 4 tests in Eclipse