Search in sources :

Example 1 with CreateSwarm

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

the class SwaggerWebAppDefaultUrlChangerArquillianTest method newContainer.

@CreateSwarm
public static Swarm newContainer() throws Exception {
    Swarm swarm = new Swarm();
    swarm.fraction(new CDIFraction());
    swarm.withProfile("application-path");
    return swarm;
}
Also used : Swarm(org.wildfly.swarm.Swarm) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) CDIFraction(org.wildfly.swarm.cdi.CDIFraction) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm)

Example 2 with CreateSwarm

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

the class AnnotationBasedMain method main.

public static void main(String... args) throws Exception {
    if (System.getProperty("boot.module.loader") == null) {
        System.setProperty("boot.module.loader", "org.wildfly.swarm.bootstrap.modules.BootModuleLoader");
    }
    String clsName = System.getProperty(ANNOTATED_CLASS_NAME);
    Class<?> cls = Class.forName(clsName);
    Method[] methods = cls.getMethods();
    for (Method method : methods) {
        if (!Modifier.isStatic(method.getModifiers())) {
            continue;
        }
        CreateSwarm anno = method.getAnnotation(CreateSwarm.class);
        if (anno == null) {
            continue;
        }
        boolean startEagerly = anno.startEagerly();
        ((Swarm) method.invoke(null)).start().deploy();
    }
}
Also used : CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) Method(java.lang.reflect.Method)

Example 3 with CreateSwarm

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

the class MonitorSecurityTest method getContainer.

@CreateSwarm
public static Swarm getContainer() throws Exception {
    Swarm container = new Swarm();
    container.fraction(new JAXRSFraction());
    container.fraction(new MonitorFraction().securityRealm("TestRealm"));
    container.fraction(new ManagementFraction().securityRealm("TestRealm", (realm) -> {
        realm.inMemoryAuthentication((authn) -> {
            authn.add(new Properties() {

                {
                    put("admin", "password");
                }
            }, true);
        });
        realm.inMemoryAuthorization();
    }));
    return container;
}
Also used : MonitorFraction(org.wildfly.swarm.monitor.MonitorFraction) ShrinkWrap(org.jboss.shrinkwrap.api.ShrinkWrap) Properties(java.util.Properties) Arquillian(org.jboss.arquillian.junit.Arquillian) Swarm(org.wildfly.swarm.Swarm) ManagementFraction(org.wildfly.swarm.management.ManagementFraction) RunWith(org.junit.runner.RunWith) Test(org.junit.Test) Archive(org.jboss.shrinkwrap.api.Archive) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) ElytronFraction(org.wildfly.swarm.elytron.ElytronFraction) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) Ignore(org.junit.Ignore) Deployment(org.jboss.arquillian.container.test.api.Deployment) Assert(org.junit.Assert) Swarm(org.wildfly.swarm.Swarm) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) MonitorFraction(org.wildfly.swarm.monitor.MonitorFraction) ManagementFraction(org.wildfly.swarm.management.ManagementFraction) Properties(java.util.Properties) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm)

Example 4 with CreateSwarm

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

the class TopologyWebAppArquillianTest method newContainer.

@CreateSwarm
public static Swarm newContainer() throws Exception {
    TopologyWebAppFraction topology = new TopologyWebAppFraction();
    topology.proxyService("myService", "/my-proxy");
    return new Swarm().fraction(topology).fraction(new JGroupsTopologyFraction());
}
Also used : Swarm(org.wildfly.swarm.Swarm) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) JGroupsTopologyFraction(org.wildfly.swarm.topology.jgroups.JGroupsTopologyFraction) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm)

Example 5 with CreateSwarm

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

the class MonitorPayloadTest method getContainer.

@CreateSwarm
public static Swarm getContainer() throws Exception {
    Swarm container = new Swarm();
    container.fraction(new JAXRSFraction());
    container.fraction(new MonitorFraction());
    return container;
}
Also used : CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm) Swarm(org.wildfly.swarm.Swarm) MonitorFraction(org.wildfly.swarm.monitor.MonitorFraction) CreateSwarm(org.wildfly.swarm.arquillian.CreateSwarm)

Aggregations

CreateSwarm (org.wildfly.swarm.arquillian.CreateSwarm)7 Swarm (org.wildfly.swarm.Swarm)6 Deployment (org.jboss.arquillian.container.test.api.Deployment)2 Arquillian (org.jboss.arquillian.junit.Arquillian)2 Archive (org.jboss.shrinkwrap.api.Archive)2 ShrinkWrap (org.jboss.shrinkwrap.api.ShrinkWrap)2 Test (org.junit.Test)2 RunWith (org.junit.runner.RunWith)2 MonitorFraction (org.wildfly.swarm.monitor.MonitorFraction)2 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Properties (java.util.Properties)1 UUID (java.util.UUID)1 Collectors (java.util.stream.Collectors)1