kinyelo / vosao

Automatically exported from code.google.com/p/vosao
GNU Lesser General Public License v2.1
1 stars 2 forks source link

Unit tests for plugins #292

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Would be really handy to have unit tests for plugins. Maybe also some kind of 
development guide for testing them.

Original issue reported on code.google.com by roland.q...@gmail.com on 31 Jul 2010 at 3:03

GoogleCodeExporter commented 9 years ago
What kind of tests do you need?

We use maven so just add your unit tests to /src/test/java and they will be 
automatically executed on every build.

Original comment by kinyelo@gmail.com on 31 Jul 2010 at 7:13

GoogleCodeExporter commented 9 years ago
I've been working on some changes to the register plugin and found that if I 
didn't link everything up perfectly, there'd always be something I forgot.

I know this is a long shot, but tests that could check the JSONRPC and html 
files having the exact right names that match back to the java methods. I don't 
have a problem with names in java/eclipse because its all linked, but you can't 
have the IDE link the html and javascript identifiers to the java methods.

Also form submission and validation tests that don't have to be manually run on 
the live server.

Mostly HTML mock object tests I think.

Original comment by roland.q...@gmail.com on 31 Jul 2010 at 7:24

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
JsUnit and JSMock could help test the JSONRPC.

I'm less concerned about unit testing the java code in the plugins. I'm mostly 
concerned about testing that JSONRPC works properly and that if we pass forms 
with certain data, we receive the right response (through the use of mock 
objects).

The process of development would be:

1. Develop the code in eclipse, run java unit tests before deployment to dev 
server.
2. Deploy to dev server, run JsUnit test on mock objects for the plugin. If it 
all works okay, continue to work on the code.

Maybe some kind of JsUnit testing framework could be integrated into the system?

Original comment by roland.q...@gmail.com on 31 Jul 2010 at 11:57

GoogleCodeExporter commented 9 years ago
http://www.infoq.com/articles/javascript-tdd - article on JsUnit and JSMock.

Original comment by roland.q...@gmail.com on 31 Jul 2010 at 11:57

GoogleCodeExporter commented 9 years ago
You know, when installing a plugin.. you could use the whole scenario above to 
test that the plugin is compatible with the vosao installation.

Original comment by roland.q...@gmail.com on 31 Jul 2010 at 12:03

GoogleCodeExporter commented 9 years ago
JSUnit can be used with Maven too - http://jsunit.berlios.de/maven2.html

I think it would be good to test before deployment (to find errors in the 
javascript/html) and after deployment to a dev server (to test for errors on 
the GAE service).

Original comment by roland.q...@gmail.com on 31 Jul 2010 at 12:35