Search in sources :

Example 1 with StartupTimeout

use of org.wildfly.swarm.arquillian.StartupTimeout in project wildfly-swarm by wildfly-swarm.

the class WildFlySwarmContainer method deploy.

@Override
public synchronized ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException {
    StartupTimeout startupTimeout = this.testClass.getAnnotation(StartupTimeout.class);
    if (startupTimeout != null) {
        setTimeout(startupTimeout.value());
    }
    this.delegateContainer = new UberjarSimpleContainer(this.containerContext.get(), this.deploymentContext.get(), this.testClass);
    try {
        this.delegateContainer.setJavaVmArguments(this.getJavaVmArguments()).requestedMavenArtifacts(this.requestedMavenArtifacts).start(archive);
        // start wants to connect to the remote container, which isn't up until now, so
        // we override start above and call it here instead
        super.start();
        ProtocolMetaData metaData = new ProtocolMetaData();
        metaData.addContext(createDeploymentContext(archive.getId()));
        return metaData;
    } catch (Throwable e) {
        if (e instanceof LifecycleException) {
            e = e.getCause();
        }
        throw new DeploymentException(e.getMessage(), e);
    }
}
Also used : LifecycleException(org.jboss.arquillian.container.spi.client.container.LifecycleException) DeploymentException(org.jboss.arquillian.container.spi.client.container.DeploymentException) ProtocolMetaData(org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData) StartupTimeout(org.wildfly.swarm.arquillian.StartupTimeout)

Aggregations

DeploymentException (org.jboss.arquillian.container.spi.client.container.DeploymentException)1 LifecycleException (org.jboss.arquillian.container.spi.client.container.LifecycleException)1 ProtocolMetaData (org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData)1 StartupTimeout (org.wildfly.swarm.arquillian.StartupTimeout)1