Examples of XdocFile


Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    URLConnection c = url.openConnection();
    assertNotNull(c);
  }

  public void testNamedReference() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR
        + "namedRefAndTextTest.xdoc");
    Ref r = (Ref) (file.getMainSection().getContents()
        .get(0)).getContents().get(0);
    assertEquals(file.getMainSection(), r.getRef());
    assertEquals("a Chapter", ((TextPart) r.getContents().get(0)
        .getContents().get(0)).getText());
  }
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    assertEquals("a Chapter", ((TextPart) r.getContents().get(0)
        .getContents().get(0)).getText());
  }

  public void testNestedList() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "nestedListTest.xdoc");
    UnorderedList outer = (UnorderedList) (file.getMainSection().getContents().get(0)).getContents().get(0);
    List<Item> items = outer.getItems();
    assertEquals(1, items.size());
    List<TextOrMarkup> itemContents = items.get(0).getContents();
    assertEquals(1, itemContents.size());
    List<EObject> contents = itemContents.get(0).getContents();
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    assertEquals(1, itemContents.get(0).getContents().size());
    assertEquals("some item", ((TextPart)itemContents.get(0).getContents().get(0)).getText());
  }

  public void testSimpleRef() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "simpleRefTest.xdoc");
    AbstractSection section = file.getMainSection();
    List<TextOrMarkup> contents = section.getContents();
    assertEquals(1, contents.size());
    TextOrMarkup textOrMarkup = contents.get(0);
    assertEquals(2, textOrMarkup.getContents().size());
    assertEquals("This is ", ((TextPart)textOrMarkup.getContents().get(0)).getText());
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    assertEquals("This is ", ((TextPart)textOrMarkup.getContents().get(0)).getText());
    assertEquals(section, ((Ref)textOrMarkup.getContents().get(1)).getRef());
  }

  public void testEscape() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "testEscape.xdoc");
    TextOrMarkup textOrMarkup = file.getMainSection()
        .getContents().get(0);
    assertEquals(1, textOrMarkup.getContents().size());
    TextPart p = (TextPart) textOrMarkup.getContents().get(0);
    assertEquals("\\\\ \\[ \\]", p.getText());
  }
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

  public void testImg() throws Exception {
    getDocFromFile(TEST_FILE_DIR + "imgTest.xdoc");
  }

  public void testUL() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "ulTest.xdoc");
    Chapter chapter = (Chapter) file.getMainSection();
    List<TextOrMarkup> contents = chapter.getContents();
    assertEquals(1, contents.size());
    TextOrMarkup textOrMarkup = contents.get(0);
    assertEquals(1, textOrMarkup.getContents().size());
    UnorderedList list = (UnorderedList) textOrMarkup.getContents().get(0);
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    assertEquals(1, textOrMarkup.getContents().size());
    assertEquals("\titem", ((TextPart)textOrMarkup.getContents().get(0)).getText());
  }

  public void testOL() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "olTest.xdoc");
    Chapter chapter = (Chapter) file.getMainSection();
    List<TextOrMarkup> contents = chapter.getContents();
    assertEquals(1, contents.size());
    TextOrMarkup textOrMarkup = contents.get(0);
    assertEquals(1, textOrMarkup.getContents().size());
    OrderedList list = (OrderedList) textOrMarkup.getContents().get(0);
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

    String row = "tr[";
    String dataString = "this is";
      String dataString2 = "a two paragraph table entry";
    String d = CHAPTER_HEAD + tableStart + row +"td["+ dataString + DNL+dataString2+
      CLOSE_BRACKET + "td[]" + CLOSE_BRACKET + CLOSE_BRACKET;
    XdocFile file = getDoc(d);
    EList<TextOrMarkup> textOrMarkup = file.getMainSection().getContents();
    assertEquals(1, textOrMarkup.size());
    Table t = (Table)textOrMarkup.get(0).getContents().get(0);
    assertEquals(1, t.getRows().size());
    EList<TableData> data = t.getRows().get(0).getData();
    assertEquals(2, data.size());
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

  public void testCodeLangDef() throws Exception {
    String name = "Java";
    String[] expectedKeywords = {"final", "const", "goto", "strictfp"};
    String d = DOC_HEAD + "codelanguage-def[" + name + "]["+ expectedKeywords[0] + "," + expectedKeywords[1] + " , " + expectedKeywords[2] +", " + expectedKeywords[3]+"]\n\nchapter[foo]\n\n";
    XdocFile file = getDoc(d);
    Document doc = (Document) file.getMainSection();
    List<LangDef> defs = doc.getLangDefs();
    assertEquals(1, defs.size());
    LangDef def = defs.get(0);
    assertEquals(name, def.getName());
    List<String> keywords = def.getKeywords();
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

      assertEquals(expectedKeywords[i], keywords.get(i));
    }
  }

  public void testFullSectionHirarchy() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "downToSection4Test.xdoc");
    Document doc = (Document) file.getMainSection();
    assertEquals(1, doc.getTitle().getContents().size());
    TextPart textPart = (TextPart)(doc.getTitle().getContents().get(0));
    assertEquals("foo", textPart.getText());
    assertEquals(1, doc.getChapters().size());
    Chapter chapter = doc.getChapters().get(0);
View Full Code Here

Examples of org.eclipse.xtext.xdoc.xdoc.XdocFile

      _builder.append(secondPart, "");
      _builder.newLineIfNotEmpty();
      _builder.newLine();
      final String text = _builder.toString();
      String _string = text.toString();
      final XdocFile model = this._parseHelperExtensions.parse(_string);
      this._validationTestHelper.assertNoErrors(model);
      AbstractSection _mainSection = model.getMainSection();
      final Chapter chapter = ((Chapter) _mainSection);
      TextOrMarkup _title = chapter.getTitle();
      EList<EObject> _contents = _title.getContents();
      EObject _head = IterableExtensions.<EObject>head(_contents);
      String _text = ((TextPart) _head).getText();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.