On 30/07/12 12:45, Joern Bernhardt wrote:
> So I copied the mongo mod, changed some files (no mongo dependency in
> build.gradle, changed mod.json). I still have some trouble with
> including some Scala sources, but this seems to be gradle or classpath
> related. It compiles but the tests won't run because of a
> NoClassDefFoundError.
>
> My real problem with the testing framework is/was the following: Which
> files are getting run by gradle? And which files are run because of
> the test-app. I guess it works like this, please correct me if I'm
> wrong here...
> Gradle runs these files as JUnit tests:
> - org.vertx.mods.tests.JavaPersistorTest
> - org.vertx.mods.tests.JavaScriptPersistorTest
Yes those are the actual JUnit tests which get run. They are basically
proxies which start up the "real" test (which is just a Verticle) in the
vert.x container, run the tests, and report the results back.
>
> The testing framework calls vertx.mods.tests.verticles.java.TestClient
> from JavaPersistorTest and test_client.js from JavaScriptPersistorTest.
Yes these are the actual verticles which run in the container/
> All @Test functions in JavaPersistorTest / JavaScriptPersistorTest
> call one of the methods in the TestClient.java / test_client.js files.
> If I would add another method in TestClient.java or test_client.js I
> would need to add a test to the above mentioned JUnit files as well.
Yes you would.
A couple of people have done some work (see recent discussions on the
google group) to simplify this, but for now you need to remember to add
a matching method name in both the proxy and the verticle.
>
> I raised the question initially because the whole testing is not
> really self-explanatory for me. ;)
> Without understanding the basics of gradle and the testing framework,
> this looked like magic to me...
I hear you. Like I've said before the test framework needs to be
simplified - just haven't got around to it yet.
Regarding Gradle- I agree, I find much of it "magic" too :(
>
> Thanks,
> Joern
>
>
> On Sunday, July 29, 2012 4:51:15 PM UTC+2, Tim Fox wrote:
>
> The test framework stuff can certainly be improved, but you've
> always been able to use it outside the rest of the framework, that
> hasn't changed.
>
> On Sunday, July 29, 2012 3:19:45 PM UTC+1, blalor wrote:
>
> On Jul 29, 2012, at 9:27 AM, Tim Fox wrote:
>
>> Probably not. The new modules are based on the new Gradle
>> build - the old built in modules were using the ant build.
>>
>> But, fundamentally you can use whatever build you want. As
>> long as the output is a valid mod.zip it doesn't matter. I
>> recommend using the standard Gradle module builds (e.g.
>> mod-mongo-persistor) only as a convenience - just copy the
>> repo, substitute your source and tests, and you should be
>> going in minutes.
>
> It wasn't build-related (I built the AMQP mod with Maven); it
> was about the fact that the support classes for the tests used
> some package-protected class stuff, I think. I don't recall
> the exact problem, but it was clear that the integration
> testing support stuff wasn't designed for real extensibility
> or use outside of the "system" package hierarchy.
>
> --
> You received this message because you are subscribed to the Google
> Groups "vert.x" group.
> To view this discussion on the web, visit
>
https://groups.google.com/d/msg/vertx/-/69EKOX99QjwJ.
--
Tim Fox
Vert.x - effortless polyglot asynchronous application development
http://vertx.io
twitter:@timfox