Arquillian provides a component model for integration tests, which includes dependency injection and container life cycle management. Instead of managing a runtime in your test, Arquillian brings your test to the runtime.
I have created a prototype json based ArquillianDescriptor implementation using the shrinkwrap DescriptorImporter SPI, but there is a limitation on where it can be used because of this org.jboss.arquillian.container.impl.ContainerImpl method:
@Override
public ContainerConfiguration createDeployableConfiguration() throws Exception {
ContainerConfiguration config = SecurityActions.newInstance(
deployableContainer.getConfigurationClass(), new Class<?>[0], new Object[0]);
MapObject.populate(config, containerConfiguration.getContainerProperties()); // This line needs to be externalized
config.validate();
return config;
}
The containerConfiguration instance variable is a org.jboss.arquillian.config.descriptor.api.ContainerDef that results from the parse of the arquillian.xml descriptor by default. If one has overriden the parser to use a different format, the call to get the ContainerDef#getContainerProperties() becomes limiting on the types one can pass from the parsed ArquillianDescriptor to the org.jboss.arquillian.container.spi.client.container.ContainerConfiguration implementation a container provides.
Expected Behaviour
One should be able to provide a mapper from the ContainerDef and the ContainerConfiguration to allow for richer types in configurations.
There needs to be an interface that is provided by the org.jboss.arquillian.container.spi.client.container.DeployableContainer
public interface DeployableContainer<T extends ContainerConfiguration> {
// ControllableContainer
Class<T> getConfigurationClass();
default ConfigurationMapper<T> getConfigurationMapper() {
// Return the old behavior ...
}
Issue Overview
I have created a prototype json based ArquillianDescriptor implementation using the shrinkwrap DescriptorImporter SPI, but there is a limitation on where it can be used because of this
org.jboss.arquillian.container.impl.ContainerImpl
method:The
containerConfiguration
instance variable is aorg.jboss.arquillian.config.descriptor.api.ContainerDef
that results from the parse of the arquillian.xml descriptor by default. If one has overriden the parser to use a different format, the call to get theContainerDef#getContainerProperties()
becomes limiting on the types one can pass from the parsed ArquillianDescriptor to theorg.jboss.arquillian.container.spi.client.container.ContainerConfiguration
implementation a container provides.Expected Behaviour
One should be able to provide a mapper from the
ContainerDef
and theContainerConfiguration
to allow for richer types in configurations.There needs to be an interface that is provided by the
org.jboss.arquillian.container.spi.client.container.DeployableContainer
where ConfigurationMapper is a new interface:
Current Behaviour
Only scalar types and strings are supported