cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

External Class useful testing tip

sdrzewiczewski
10-Marble

External Class useful testing tip

So awhile back I had posted if there was any way to not bounce the server each time I made a change to a class and wanted to test the changes.

The answer I got back was no, you need to restart the MethodServer.

So what I've been doing to get around this is:

  1. Create a JSP file to do my testing with.
  2. Copy my methods into the JSP.
  3. Make the modifications to the methods
  4. Open the JSP with the web browser.
  5. If necessary make additional changes to the methods in the JSP page
  6. Refresh the web browser etc...
  7. Once I'm satisfied with the changes i've made, copy the modified methods from the JSP back into my external classes, and recompile

Of course all the editing i'm doing is on my local machine and I then transfer it to my development server. I omitted those steps above.

3 REPLIES 3

you just have to make sure you have reload = true and development = true in
the tomcat settings or you will have to bounce tomcat each time you update

I use Groovy Console to test any api quickly. No compilation required.

Regards,
Prathap




Or you can use the feature in Java debuggers that allows you to hot-swap
in a new version of a class.

Unfortunately this feature has limitations, e.g. you can't hotswap in a
new version of the class if you add new methods or fields, so it's
utility is more limited than that of the JSP trick (which works by using
a separate classloader for the JSP's class) but this can be quite nice
in any JVM if you're just tinkering with the internals of existing methods.

Announcements


Top Tags