Arquillian Cube and Programmatic Configuration


#1

Hey guys

So I’m thinking of using Arquillian Cube to spin up docker containers, for running integration tests. Specifically I want to spin up Keycloak. I was wondering, how can I leverage programmatic configuration (instead of field injection) to look up configuration values for the docker host/port exposed for that container?

We make use of DeltaSpike Config in our configuration, so creating a ConfigSource that contains these values makes the integration pretty seamless.


#2

Hello I think that what you are looking for is http://arquillian.org/arquillian-cube/#_arquillian_cube_and_container_object_dsl Notice that this approach also works with @Rule http://arquillian.org/arquillian-cube/#_junit_rule so you can use any other runner.

Notice that since Rule is set as static field you can use it to configure DeltaSpike without any problem.

Alex.


#3

That’s definitely a cool feature, however I need to execute this outside the test. I’m using Arquillian Suite Extension to deploy once and need to determine the remote server at deployment time.


#4

But then maybe you should relay on build tool? Since now the rule just start and stops after each test class or test method.

What you want is total control over docker images, when they are started and stopped right? Can you pseudo code what is your approach you’ll like to do so we can figure out if it is possible or what changes we can do in cube?