Package org.richfaces.test.staging

Examples of org.richfaces.test.staging.ServerResourcePath


  /**
   * Test method for {@link org.richfaces.test.staging.ServerResourcePath#ServerResourcePath(java.lang.String)}.
   */
  @Test
  public void testRootPath() {
    ServerResourcePath path = new ServerResourcePath("/");
    assertNull(path.getNextPath());
    assertNull(path.getNextElementName());
    assertTrue(path.isFile());
    assertEquals("/", path.toString());
  }
View Full Code Here


  /**
   * Test method for {@link org.richfaces.test.staging.ServerResourcePath#ServerResourcePath(java.lang.String)}.
   */
  @Test
  public void testWebInfPath() {
    ServerResourcePath path = ServerResourcePath.WEB_INF;
    assertNotNull(path.getNextPath());
    assertNotNull(path.getNextElementName());
    assertFalse(path.isFile());
    assertEquals("WEB-INF/", path.getNextElementName());
    assertEquals("/WEB-INF/", path.toString());
    path = path.getNextPath();
    assertNotNull(path);
    assertTrue(path.isFile());
    path = path.getNextPath();
    assertNull(path);
  }
View Full Code Here

  /**
   * Test method for {@link org.richfaces.test.staging.ServerResourcePath#ServerResourcePath(java.lang.String)}.
   */
  @Test
  public void testWebInfTrainingSlashPath() {
    ServerResourcePath path = new ServerResourcePath("/WEB-INF/");
    assertNotNull(path.getNextPath());
    assertNotNull(path.getNextElementName());
    assertFalse(path.isFile());
    assertEquals("WEB-INF/", path.getNextElementName());
    assertEquals("/WEB-INF/", path.toString());
    path = path.getNextPath();
    assertNotNull(path);
    assertTrue(path.isFile());
    path = path.getNextPath();
    assertNull(path);
  }
View Full Code Here

  /**
   * Test method for {@link org.richfaces.test.staging.ServerResourcePath#ServerResourcePath(java.lang.String)}.
   */
  @Test
  public void testWebXmlPath() {
    ServerResourcePath path = ServerResourcePath.WEB_XML;
    assertFalse(path.isFile());
    assertEquals("WEB-INF/", path.getNextElementName());
    assertEquals("/WEB-INF/web.xml", path.toString());
    path = path.getNextPath();
    assertNotNull(path.getNextElementName());
    assertFalse(path.isFile());
    assertEquals("web.xml", path.getNextElementName());
    assertEquals("/web.xml", path.toString());
    path = path.getNextPath();
    assertNotNull(path);
    assertTrue(path.isFile());
    path = path.getNextPath();
    assertNull(path);
  }
View Full Code Here

    assertEquals(1, root.getPaths().size());
    ServerResource webInf = root.getResource(ServerResourcePath.WEB_INF);
    assertNotNull(webInf);
    assertEquals(2, webInf.getPaths().size());
    assertSame(webXml, webInf
        .getResource(new ServerResourcePath("/web.xml")));
    assertSame(facesConfig, webInf.getResource(new ServerResourcePath(
        "/faces-config.xml")));
  }
View Full Code Here

    ServerResourcesDirectory root = new ServerResourcesDirectory();
    MockResource webXml = new MockResource();
    root.addResource(ServerResourcePath.WEB_XML, webXml);
    ServerResource webInf = root.getResource(ServerResourcePath.WEB_INF);
    assertNotNull(webInf);
    assertNull(root.getResource(new ServerResourcePath("/foo")));
    assertNull(root.getResource(new ServerResourcePath("/foo/baz")));
    assertEquals(1, root.getPaths().size());
    assertNull(root.getResource(new ServerResourcePath(
        "/WEB-INF/web.xml/foo")));
    assertSame(webXml, webInf.getResource(new ServerResourcePath(
        "/web.xml")));
  }
View Full Code Here

   */
  @Test
  public void testGetResourceRoot() {
    ServerResourcesDirectory root = new ServerResourcesDirectory();
    MockResource indexXhtml = new MockResource();
    root.addResource(new ServerResourcePath("/index.xhtml"), indexXhtml);
    ServerResource index = root.getResource(new ServerResourcePath("/index.xhtml"));
    assertNotNull(index);
    assertNull(root.getResource(new ServerResourcePath("/foo")));
    assertNull(root.getResource(new ServerResourcePath("/foo/baz")));
    assertEquals(1, root.getPaths().size());
  }
View Full Code Here

TOP

Related Classes of org.richfaces.test.staging.ServerResourcePath

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.