Search in sources :

Example 1 with DefaultDeploymentFactory

use of org.wildfly.swarm.spi.api.DefaultDeploymentFactory in project wildfly-swarm by wildfly-swarm.

the class DefaultDeploymentCreatorTest method testDistinctFactories.

@Test
public void testDistinctFactories() throws Exception {
    DefaultDeploymentCreator creator = new DefaultDeploymentCreator(new MockDefaultDeploymentFactory("war", 0), new MockDefaultDeploymentFactory("jar", 0));
    DefaultDeploymentFactory jarFactory = creator.getFactory("jar");
    assertThat(jarFactory).isNotNull();
    assertThat(jarFactory.getType()).isEqualTo("jar");
    DefaultDeploymentFactory warFactory = creator.getFactory("war");
    assertThat(warFactory).isNotNull();
    assertThat(warFactory.getType()).isEqualTo("war");
    DefaultDeploymentFactory fooFactory = creator.getFactory("foo");
    assertThat(fooFactory).isNull();
}
Also used : DefaultDeploymentFactory(org.wildfly.swarm.spi.api.DefaultDeploymentFactory) Test(org.junit.Test)

Example 2 with DefaultDeploymentFactory

use of org.wildfly.swarm.spi.api.DefaultDeploymentFactory in project wildfly-swarm by wildfly-swarm.

the class DefaultDeploymentCreatorTest method testNoDeploymentFactories.

@Test
public void testNoDeploymentFactories() throws Exception {
    DefaultDeploymentCreator creator = new DefaultDeploymentCreator();
    DefaultDeploymentFactory factory = creator.getFactory("foo");
    assertThat(factory).isNull();
}
Also used : DefaultDeploymentFactory(org.wildfly.swarm.spi.api.DefaultDeploymentFactory) Test(org.junit.Test)

Example 3 with DefaultDeploymentFactory

use of org.wildfly.swarm.spi.api.DefaultDeploymentFactory in project wildfly-swarm by wildfly-swarm.

the class DefaultRarDeploymentFactory method archiveFromCurrentApp.

public static RARArchive archiveFromCurrentApp() throws Exception {
    final RARArchive archive = ShrinkWrap.create(RARArchive.class, determineName());
    final DefaultDeploymentFactory factory = new DefaultRarDeploymentFactory();
    factory.setup(archive);
    return archive;
}
Also used : RARArchive(org.wildfly.swarm.resource.adapters.RARArchive) DefaultDeploymentFactory(org.wildfly.swarm.spi.api.DefaultDeploymentFactory)

Example 4 with DefaultDeploymentFactory

use of org.wildfly.swarm.spi.api.DefaultDeploymentFactory in project wildfly-swarm by wildfly-swarm.

the class DefaultDeploymentCreatorTest method testConflictingFactories.

@Test
public void testConflictingFactories() throws Exception {
    MockDefaultDeploymentFactory lowPrio = new MockDefaultDeploymentFactory("war", 0);
    MockDefaultDeploymentFactory highPrio = new MockDefaultDeploymentFactory("war", 1000);
    DefaultDeploymentCreator creator = new DefaultDeploymentCreator(lowPrio, highPrio);
    DefaultDeploymentFactory factory = creator.getFactory("war");
    assertThat(factory).isSameAs(highPrio);
    // try reverse registration
    creator = new DefaultDeploymentCreator(highPrio, lowPrio);
    factory = creator.getFactory("war");
    assertThat(factory).isSameAs(highPrio);
}
Also used : DefaultDeploymentFactory(org.wildfly.swarm.spi.api.DefaultDeploymentFactory) Test(org.junit.Test)

Example 5 with DefaultDeploymentFactory

use of org.wildfly.swarm.spi.api.DefaultDeploymentFactory in project wildfly-swarm by wildfly-swarm.

the class DefaultVDBDeploymentFactory method archiveFromCurrentApp.

public static VDBArchive archiveFromCurrentApp() throws Exception {
    final VDBArchive archive = ShrinkWrap.create(VDBArchive.class, determineName());
    final DefaultDeploymentFactory factory = new DefaultVDBDeploymentFactory();
    factory.setup(archive);
    archive.addAllDependencies();
    return archive;
}
Also used : VDBArchive(org.wildfly.swarm.teiid.VDBArchive) DefaultDeploymentFactory(org.wildfly.swarm.spi.api.DefaultDeploymentFactory)

Aggregations

DefaultDeploymentFactory (org.wildfly.swarm.spi.api.DefaultDeploymentFactory)6 Test (org.junit.Test)3 RARArchive (org.wildfly.swarm.resource.adapters.RARArchive)1 VDBArchive (org.wildfly.swarm.teiid.VDBArchive)1 WARArchive (org.wildfly.swarm.undertow.WARArchive)1