Package org.jboss.shrinkwrap.api.spec

Examples of org.jboss.shrinkwrap.api.spec.WebArchive


{

   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest.getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsWebResource(new StringAsset("exists"), "index.html")
               .addAsServiceProvider(RewriteProvider.class,
                        RewriteFilterInvalidRewriteProvider.class);
      return deployment;
View Full Code Here


{

   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class,
                        RelocatingConfigurationProvider1.class, RelocatingConfigurationProvider2.class,
                        RelocatingConfigurationProvider3.class);
View Full Code Here

public class ConfigurationCacheProviderTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, Root.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, ConfigurationCacheProviderConfig1.class,
                        ConfigurationCacheProviderConfig2.class)
               .addAsServiceProvider(ConfigurationCacheProvider.class, ConfigurationCacheProviderMock.class);
View Full Code Here

public class AnnotationConfigurationTest extends RewriteTest
{
   @Deployment(testable = false)
   public static WebArchive getDeployment()
   {
      WebArchive deployment = RewriteTest
               .getDeployment()
               .addPackages(true, AnnotationConfigurationTest.class.getPackage())
               .addAsServiceProvider(ConfigurationProvider.class, AnnotationConfigProvider.class)
               .addAsServiceProvider(AnnotationHandler.class, FieldHandler.class, MethodHandler.class,
                        ParamHandler.class, TypeHandler.class);
View Full Code Here

    static WebArchive spArchive;

    static Map<String, WebArchive> webArchives = new HashMap<String, WebArchive>();

    static WebArchive getArchive(String entity) {
        WebArchive webArchive = webArchives.get(entity);
        if (webArchive == null) {
            webArchive = createTestArchive(entity);
            webArchives.put(entity, webArchive);
        }
        return webArchive;
View Full Code Here

        }
        return webArchive;
    }

    static private WebArchive createTestArchive(String entity) {
        WebArchive war = ShrinkWrap.create(WebArchive.class, entity + ".war");

        war.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
            .loadReposFromPom("../external/pom.xml")
            .artifact("org.jboss.solder:solder-impl")
                .artifact("org.jboss.seam.security:seam-security")
            .artifact("org.openid4java:openid4java-consumer:pom").exclusion("xerces:xercesImpl")
            .artifact("nekohtml:nekohtml")
            .artifact("org.apache:xmlsec")
            .artifact("commons-httpclient:commons-httpclient")
            .resolveAs(GenericArchive.class));

        war.addAsLibraries(
            ShrinkWrap.create(ZipImporter.class, "seam-security-external.jar")
              .importFrom(new File("../external/target/seam-security-external.jar"))
              .as(JavaArchive.class));

        war.addAsWebInfResource("WEB-INF/" + entity + "-beans.xml", "beans.xml");
        war.addAsWebInfResource("WEB-INF/" + entity + "-seam-beans.xml", "classes/META-INF/seam-beans.xml");
        war.addAsWebInfResource("WEB-INF/context.xml", "context.xml");

        war.addPackage(MetaDataLoader.class.getPackage());
        if (entity.equals("sp")) {
            war.addPackage(SpCustomizer.class.getPackage());
            war.addAsWebInfResource("test_keystore.jks", "classes/test_keystore.jks");
        } else if (entity.equals("idp")) {
            war.addPackage(IdpCustomizer.class.getPackage());
            war.addAsWebInfResource("test_keystore.jks", "classes/test_keystore.jks");
        } else if (entity.equals("op")) {
            war.addPackage(OpCustomizer.class.getPackage());
        } else if (entity.equals("rp")) {
            war.addPackage(RpCustomizer.class.getPackage());
        }

        return war;
    }
View Full Code Here

/**
* @author <a href="http://community.jboss.org/people/LightGuard">Jason Porter</a>
*/
public class BasicArchiveBuilder {
    public static WebArchive baseArchive(final String archiveName, boolean includeBeansXml) {
        WebArchive war = ShrinkWrap.create(WebArchive.class, archiveName + ".war");

        war.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
                .loadMetadataFromPom("pom.xml")
                .artifact("org.jboss.solder:solder-impl")
                .artifact("org.jboss.seam.security:seam-security")
                .artifact("org.jboss.seam.transaction:seam-transaction")
                .artifact("joda-time:joda-time:1.6.2") // I think there's a bug here with modular servers
                .resolveAs(JavaArchive.class));

        if (includeBeansXml)
            war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");

        return war;
    }
View Full Code Here

    private HttpSessionStatus httpSessionStatus;

    @Deployment(testable = false)
    public static Archive<?> createTestArchive() {
        WebArchive war = BasicArchiveBuilder.baseArchive("logoutTest", true);

        war.addClasses(SimpleAuthenticator.class, LogoutServlet.class);
        war.addAsWebInfResource("WEB-INF/logouttest-seam-beans.xml", "classes/META-INF/seam-beans.xml");

        return war;
    }
View Full Code Here

    /**
     * Returns the final testable archive - packages all the resources which were configured separately
     */
    public WebArchive getFinalArchive() {
        WebArchive finalArchive = archive
                .addAsWebInfResource(new StringAsset(facesConfig.exportAsString()), "faces-config.xml")
                .addAsWebInfResource(new StringAsset(webXml.exportAsString()), "web.xml");



View Full Code Here

        EnterpriseArchive enterpriseArchive = new EnterpriseArchiveBuilder()
                .withTestClassDefinition(InstalledLibraryEarTest.class).withClasses(Alpha.class).withBeanLibrary(Bravo.class)
                .withLibrary(AssertBean.class).noDefaultWebModule().build();

        WebArchive webArchive = new WebArchiveBuilder().withClasses(InstalledLibraryEarTest.class, Charlie.class)
                .notTestArchive().withDefaultEjbModuleDependency().build();
        enterpriseArchive.addAsModule(webArchive);

        enterpriseArchive.setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class)
                .attribute("Extension-List", "CDITCKExtLib")
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.spec.WebArchive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.