Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide testtools package for Scala #23

Closed
Narigo opened this issue Jul 24, 2013 · 5 comments
Closed

Provide testtools package for Scala #23

Narigo opened this issue Jul 24, 2013 · 5 comments
Milestone

Comments

@Narigo
Copy link
Member

Narigo commented Jul 24, 2013

pleeeeeeeeeaaaaaaaaaaaaaaasssssssssseeeeeeeeeeee! :)

In the tests you need end up using the Java API for vertx.eventBus().send() for example.

I rewrote TestVerticle in Scala, but that doesn't help, because of the @RunWith(JavaClassRunner.class) which yields an error if the class is not extending the o.v.testtools.TestVerticle.

So please, if possible, somehow help me use all the lang-scala features in the tests, too ;)

@edgarchan
Copy link
Contributor

i've been there :) .. what about putting in scope the implicit conversions while there's a better solution.

https://github.com/vert-x/mod-lang-scala/blob/master/src/test/scala/org/vertx/scala/tests/EventBusTest.scala#L112

@Narigo
Copy link
Member Author

Narigo commented Jul 25, 2013

Requiring a handler for replies as a Message[JsonObject] => Unit might not be the best idea either.

See: https://github.com/campudus/vertx-mysql-postgresql/blob/master/src/main/scala/com/campudus/vertx/busmod/ScalaBusMod.scala#L11-L13

Using the implicits for EventBus would be okay for now, I guess. But another thing is, that I can't use a ScalaVerticle -> container.* and vertx.* always yields the Java stuff.

@edgarchan
Copy link
Contributor

Requiring a handler for replies as a Message[JsonObject] => Unit
what's wrong with that? mind elaborate little more?

@Narigo
Copy link
Member Author

Narigo commented Jul 25, 2013

If you want to pass an object, it needs to extend (Message[JsonObject] =>
Unit). There should be a real type for that, without the need to extend a
function trait as a developer. See the ScalaBusMod class I wrote, which
essentially just wraps it so I don't have to work with it in the real event
bus service class. (ConnectionHandler)
Am 25.07.2013 03:14 schrieb "Edgar Chan" notifications@github.com:

Requiring a handler for replies as a Message[JsonObject] => Unit
what's wrong with that? mind elaborate little more?


Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-21527662
.

@Narigo
Copy link
Member Author

Narigo commented Oct 18, 2013

Can be closed as soon as #63 is applied.

@Narigo Narigo closed this as completed Oct 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants