Closed DaanVanYperen closed 10 years ago
Also i'm severely paranoid it's not actually running the tests as javascript. ._o
Edit: it needs a bit more tweaking. XD Edit 2: Works fine now.. ;) Faster too.
Heh, interesting - I wonder if the tests from artemis-odb can be re-used as-is (with or without some automatated rewriting). Will look into.
I'm pretty sure you can. I know at leasat Surefire can run GWTTestCase
as java, it's at top of the maven-gwt plugin page about testing. (I was actually running them under java for a bit by accident). Besides that libGDX has some multi platform test cases I believe, playn too.
Just going to use it to test things that always break, like annotations. Had my fill of GWT for now ;)
Edit: I had to use exclusion/inclusion rules so maven-gwt grabs the gwt tests, and surefire runs its own tests. the GWTTestCase
uses the naming convention public void test_
to find tests, accidentally left some @Test
annotations in there and it didn't break the GWT tests, so that might be all you need. ;)
Ugh, looked into unit testing GWT... turns out they're still on JUnit 3. Not that so many things changed between 3 and 4, but it's 120 test cases to edit (actually less, since artemis-weaver doesn't count). Maybe some quick and dirty regexed sed-ing could be hooked into the gwt module, generating all modified test classes automatically each time it's run.
What's still on JUnit3? Or do you mean they're still using the old package names?
Edit: wait you mean the GWT way to test is JUnit3 style?
Yup, I guess it'll be a matter of issuing "organize imports" on the top level test folders in eclipse and then manually removing all annotations while ensuring that the methods are properly named.
static import ALL THE THINGS! Wraap.
Tomorrow is election day, so this probably won't be done before beginning of next week.
If you are running low on time just having a single test will help a lot. It's typically the build process that fails.
Nb. If we tie into the future LibGDX reflection lib, is there any reason to use their GWT testing scaffolding as well? Might be worth it just to push this to 0.8 and wait for the GWT refactoring.
I'll have to look into how they test their stuff - they have a knack for clever hacks.
Found something that might tickle your fancy!
Got a GWT unit testing module in the dev branch of odb-contrib working, with an example artemis test case. https://github.com/DaanVanYperen/artemis-odb-contrib/tree/develop/contrib-test-gwt
Tests are easy to write. Shouldn't need to boot the environment more than once. It'll probably beat having to monkey test GWT with Spaceship Warrior Redux. ;)
I'm up to speed so let me know if you want a draft module pushed for artemis.