org.jboss.as.arquillian.service.ArquillianConfigBuilder Maven / Gradle / Ivy
The newest version!
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.jboss.as.arquillian.service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jboss.as.arquillian.protocol.jmx.TestDescription;
import org.jboss.as.server.deployment.AttachmentKey;
import org.jboss.as.server.deployment.Attachments;
import org.jboss.as.server.deployment.DeploymentUnit;
import org.jboss.as.server.deployment.annotation.CompositeIndex;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.logging.Logger;
/**
* Uses the annotation index to check whether there is a class annotated
* with JUnit @RunWith, or extending from the TestNG Arquillian runner.
* In which case an {@link ArquillianConfig} service is created.
*
* @author [email protected]
* @author Richard Opalka
*/
class ArquillianConfigBuilder {
private static final Logger log = Logger.getLogger("org.jboss.as.arquillian");
/*
* Note: Do not put direct class references on JUnit or TestNG here; this
* must be compatible with both without resulting in NCDFE
*
* AS7-1303
*/
private static final String CLASS_NAME_JUNIT_RUNNER = "org.junit.runner.RunWith";
private static final String CLASS_NAME_JUNIT5_RUNNER = "org.junit.jupiter.api.extension.ExtendWith";
private static final String CLASS_NAME_TESTNG_RUNNER = "org.jboss.arquillian.testng.Arquillian";
private static final DotName OPERATE_ON_DEPLOYMENT = DotName
.createSimple("org.jboss.arquillian.container.test.api.OperateOnDeployment");
private static final AttachmentKey