Package com.google.gdt.eclipse.designer.model.web

Examples of com.google.gdt.eclipse.designer.model.web.ServletMappingElement


        "  </servlet-mapping>",
        "</web-app>");
    assertThat(m_webElement.getChildren()).hasSize(1);
    //
    List<ServletMappingElement> elements = m_webElement.getServletMappingElements();
    ServletMappingElement element = elements.get(0);
    assertThat(elements).hasSize(1);
    assertEquals("someName", element.getName());
    assertEquals("some/pattern", element.getPattern());
    // set new "name" value
    {
      element.setName("newName");
      m_webContent = StringUtils.replace(m_webContent, "someName", "newName");
      assertUpdatedModuleFile(m_webContent);
    }
    // set new "pattern" value
    {
      element.setPattern("new/pattern");
      m_webContent = StringUtils.replace(m_webContent, "some/pattern", "new/pattern");
      assertUpdatedModuleFile(m_webContent);
    }
    // toString()
    assertEquals(
View Full Code Here


   */
  public void test_ServletMappingElement_new() throws Exception {
    parse("<web-app>", "</web-app>");
    assertThat(m_webElement.getChildren()).isEmpty();
    //
    ServletMappingElement element = new ServletMappingElement();
    m_webElement.addChild(element);
    assertEquals(null, element.getName());
    assertEquals(null, element.getPattern());
    // set attributes
    element.setName("newName");
    element.setPattern("new/pattern");
    assertEquals("newName", element.getName());
    assertEquals("new/pattern", element.getPattern());
    // toString()
    assertEquals(
        getSource(
            "<web-app>",
            "  <servlet-mapping>",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.web.ServletMappingElement

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.