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

Allow container dsl to run outside of arquillian #963

Open
aahmed-se opened this issue Feb 1, 2018 · 7 comments
Open

Allow container dsl to run outside of arquillian #963

aahmed-se opened this issue Feb 1, 2018 · 7 comments

Comments

@aahmed-se
Copy link

aahmed-se commented Feb 1, 2018

I am trying to run the container dsl outside the context to arquillian runner , trying to integrate integrate with a custom test framework

Container pingpong = Container.withContainerName("pingpong")
            .fromImage("jonmorehouse/ping-pong")
            .withPortBinding(8080)
            .build();

As if understand the manager can start as so

Manager manager = ManagerBuilder.from().extension(LoadableExtensionLoader.class).create();
        manager.start();

what would be the other things that I need to initialize for the container dsl to work ?

@aahmed-se aahmed-se changed the title Allow container dsl to un outside of arquillian Allow container dsl to run outside of arquillian Feb 1, 2018
@aahmed-se
Copy link
Author

aahmed-se commented Feb 2, 2018

I tried doing adding the following

manager.inject(pingpong);

It seems to have injected some fields correctly but it didn't work as expected

@dipak-pawar
Copy link
Contributor

dipak-pawar commented Feb 2, 2018

@aahmed-se Can you share your project to understand how are you invoking arquillian-cube with another framework? so maybe I can help you

@aahmed-se
Copy link
Author

it's an in house test framework similar to testng, I need to add custom setup and teardown methods for the containers so need more fine grain control of the process.

@lordofthejars
Copy link
Member

@aahmed-se I would do it differently. I am not an expert of TestNg but maybe you can get the idea from https://github.com/arquillian/arquillian-cube/tree/master/docker/junit-rule/src/main/java/org/arquillian/cube/docker/junit/rule

@dipak-pawar
Copy link
Contributor

dipak-pawar commented Feb 2, 2018

If you want to use Arquillian Runner then there is no need to fire event, any configuration in arquillian.xml with required dependency in pom.xml should work. Look here for example

If you don't want to use arquillian runner you have to fire some events by your own to work cube as per expectation

  • Initialize docker client
  • Fire required event - Have a look into this method in arquillian cube to get an idea.

@lordofthejars
Copy link
Member

In this concrete example and if you are only planning to integrate with this part, then I suggest using the Rule approach in TestNg. If you plan to use more features of Arquillian then what @dipak-pawar suggests is the best way to proceed.

@aahmed-se
Copy link
Author

seems this has been discussed before, is this approach wrong ?

#242

dipak-pawar added a commit to dipak-pawar/arquillian-cube that referenced this issue Feb 16, 2018
dipak-pawar added a commit to dipak-pawar/arquillian-cube that referenced this issue Feb 16, 2018
dipak-pawar added a commit to dipak-pawar/arquillian-cube that referenced this issue Feb 16, 2018
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

3 participants