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

Add fixtures #4

Closed
aesteve opened this issue Mar 24, 2015 · 2 comments
Closed

Add fixtures #4

aesteve opened this issue Mar 24, 2015 · 2 comments
Assignees

Comments

@aesteve
Copy link
Owner

aesteve commented Mar 24, 2015

How do user provide fixtures ?

They should just implement an interface with two single methods that deal with domain objects.

  • setup(Vertx vertx)
  • tearDown(Vertx vertx)

User is responsible for creating and saving their domain objects, (since we can't do it for them, because of cascade relationships etc.)

In conf.json, the user should specify wich fixtures are run.

"fixtures" : [
    "com.mycompany.fixtures.fixtures.MyUsers",
    "com.mycompany.fixtures.fixtures.MyAccessRoles"
]

Then in VertxMVC.bootstrap() scan for fixtures through vertx.config() and execute them.

@aesteve aesteve self-assigned this Mar 24, 2015
@aesteve aesteve added this to the 0.1 milestone Mar 24, 2015
@aesteve
Copy link
Owner Author

aesteve commented Mar 27, 2015

The fixture interface could have just 2 methods :

  • startUp
  • tearDown

We have to provide a Vertx instance, so that user can access the vertx, and the eventBus eventually.

Also, keep in mind that some async stuff could be done by the end-user in fixtures, so we should return a Future.

public Future<Void> startUp(Vertx vertx)
public Future<Void> tearDown(Vertx vertx)

Fixtures should be loaded after vertx-mvc has been bootstrapped (obviously) but before doing anything else.

@aesteve
Copy link
Owner Author

aesteve commented Mar 28, 2015

Done

@aesteve aesteve closed this as completed Mar 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant