Class DockerCubeCustomizableURLResourceProvider

java.lang.Object
org.arquillian.cube.docker.graphene.location.DockerCubeCustomizableURLResourceProvider
All Implemented Interfaces:
org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider

public class DockerCubeCustomizableURLResourceProvider extends Object implements org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider
The DockerCubeCustomizableURLResourceProvider is used in the context of Graphene, if you use the standalone framework integration option (see https://docs.jboss.org/author/display/ARQGRA2/Framework+Integration+Options) with Docker Cube and thus the Arquillian URLResourceProvider is not on on the classpath, a way to inject the URL is required.

In this case the URL will be composed with next format:

scheme graphene configuration parameter [http, https, ...] or http if not set.

plus

url graphene configuration parameter. This can use the dockerHost special word which will be replaced at runtime by docker host ip. Also if url property starts with relative path, dockerHost resolution will be appended automatically at the start of the url.

If url is http://192.168.99.100/context the result will be http://192.168.99.100/context

If url is http://dockerHost/context then the result will be http://<ipOfDockerHost>/context

If url is http://<containerName>/context so NOT dockerHost and not an IP then the result will be http://<internalIpOfGivenContainer>/context

The next thing to resolve is the port of the URL.

If url has not port, then 80 port is used.

If url has a port (http://dockerHost:8080), Cube will use 8080 as exposed port.

For example url set to http://mycontainer/context, then the result will be http://<ipOfContainer>:8080/context

See Also:
  • ResourceProvider
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider

    org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider.ClassInjection, org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider.MethodInjection
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canProvide(Class<?> type)
     
    lookup(org.jboss.arquillian.test.api.ArquillianResource resource, Annotation... qualifiers)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DockerCubeCustomizableURLResourceProvider

      public DockerCubeCustomizableURLResourceProvider()
  • Method Details

    • canProvide

      public boolean canProvide(Class<?> type)
      Specified by:
      canProvide in interface org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider
    • lookup

      public Object lookup(org.jboss.arquillian.test.api.ArquillianResource resource, Annotation... qualifiers)
      Specified by:
      lookup in interface org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider