@Deployment
 public static Archive createDeployment() throws Exception {
   WARArchive deployment = ShrinkWrap.create(WARArchive.class);
   deployment.staticContent("foo");
   // Make sure we're testing from contents inside the jar only
   deployment.delete("WEB-INF/undertow-external-mounts.conf");
   return deployment;
 }
示例#2
0
  // @Test
  // TODO Once https://issues.jboss.org/browse/WFLY-4889 is resolved, attempt to get the test
  // working
  public void testSimple() throws Exception {
    container = newContainer();
    container.start();

    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.staticContent();
    container.deploy(deployment);

    String result = fetch(DEFAULT_URL);
    assertThat(result).contains("This is static.");
  }
 @Test
 public void testStaticContentWithBase() throws Exception {
   Container container = newContainer();
   container.start();
   try {
     WARArchive deployment = ShrinkWrap.create(WARArchive.class);
     deployment.staticContent("foo");
     container.deploy(deployment);
     assertContains("", "This is foo/index.html.");
     assertContains("index.html", "This is foo/index.html.");
   } finally {
     container.stop();
   }
 }
 @Test
 public void testStaticContent() throws Exception {
   Container container = newContainer();
   container.start();
   try {
     WARArchive deployment = ShrinkWrap.create(WARArchive.class);
     deployment.staticContent();
     container.deploy(deployment);
     assertBasicStaticContentWorks("");
     assertFileChangesReflected("");
   } finally {
     container.stop();
   }
 }
  @Override
  public List<Archive> getImplicitDeployments(TopologyWebAppFraction fraction) throws Exception {
    String context = System.getProperty(TopologyProperties.CONTEXT_PATH);
    if (context == null) context = DEFAULT_CONTEXT;

    List<Archive> list = new ArrayList<>();
    WARArchive war = ShrinkWrap.create(WARArchive.class, "topology-webapp.war");
    war.addAsWebInfResource(new StringAsset(getWebXml(fraction)), "web.xml");
    war.addClass(TopologySSEServlet.class);
    war.addModule("swarm.application");
    war.addModule("org.wildfly.swarm.topology");
    war.addAsWebResource(
        new ClassLoaderAsset("topology.js", this.getClass().getClassLoader()), "topology.js");
    war.setContextRoot(context);
    war.as(TopologyArchive.class);
    list.add(war);
    return list;
  }
 @Deployment(testable = false)
 public static Archive createDeployment() {
   WARArchive deployment = ShrinkWrap.create(WARArchive.class);
   deployment.add(EmptyAsset.INSTANCE, "nothing");
   return deployment;
 }