Package org.eclipse.xtext.xdoc.xdoc

Examples of org.eclipse.xtext.xdoc.xdoc.Document


    validate(EXPECTATION_DIR + "table.tex", RESULT_DIR + "table.tex");
  }

  @Override
  public void testTwoChapters() throws Exception {
    Document doc = initDocFromFile("twoChapters", "twoChapters.xdoc");
    generate(doc);
    validate(EXPECTATION_DIR + "twoChapters.tex", RESULT_DIR + "Foo Title.tex");
  }
View Full Code Here


  // getDocFromFile(TEST_FILE_DIR + "codeRef.xdoc");
  // }

  public void testCode() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "codeTest.xdoc");
    Document doc = (Document) file.getMainSection();
    EList<TextOrMarkup> contents = doc.getChapters().get(0)
        .getContents();
    TextOrMarkup textOrMarkup = contents.get(0);
    assertEquals(1, textOrMarkup.getContents().size());
    CodeBlock cb = (CodeBlock) textOrMarkup.getContents().get(0);
    Code code = (Code) cb.getContents().get(0);
View Full Code Here

  }

  public void testCodeWithLanguage() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR
        + "codeWithLanguageTest.xdoc");
    Document abstractSection = (Document) file.getMainSection();
    TextOrMarkup textOrMarkup = abstractSection.getChapters().get(0).getContents().get(0);
    assertEquals(1, textOrMarkup.getContents().size());
    CodeBlock cb = (CodeBlock) textOrMarkup.getContents().get(0);
    assertEquals("\n\t/* a testclass */\n"
        + "\tclass Foo {\n"
        + "\t\tpublic static void main(String\\[\\] args){\n"
View Full Code Here

  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();
    assertEquals(expectedKeywords.length, keywords.size());
View Full Code Here

    }
  }

  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);
    assertEquals(1, chapter.getTitle().getContents().size());
    textPart = (TextPart)(chapter.getTitle().getContents().get(0));
    assertEquals("bar", textPart.getText());
    assertEquals(1, chapter.getSubSections().size());
    Section section = chapter.getSubSections().get(0);
View Full Code Here

  @Test
  public void testCode() {
    try {
      final XdocFile file = this._parseHelperExtensions.getDocFromFile((ParserTestConstants.TEST_FILE_DIR + "codeTest.xdoc"));
      AbstractSection _mainSection = file.getMainSection();
      final Document doc = ((Document) _mainSection);
      EList<Chapter> _chapters = doc.getChapters();
      Chapter _head = IterableExtensions.<Chapter>head(_chapters);
      final EList<TextOrMarkup> contents = _head.getContents();
      TextOrMarkup textOrMarkup = IterableExtensions.<TextOrMarkup>head(contents);
      EList<EObject> _contents = textOrMarkup.getContents();
      int _size = _contents.size();
View Full Code Here

  public void testCodeWithLanguage() {
    try {
      final XdocFile file = this._parseHelperExtensions.getDocFromFile(
        (ParserTestConstants.TEST_FILE_DIR + "codeWithLanguageTest.xdoc"));
      AbstractSection _mainSection = file.getMainSection();
      final Document abstractSection = ((Document) _mainSection);
      EList<Chapter> _chapters = abstractSection.getChapters();
      Chapter _get = _chapters.get(0);
      EList<TextOrMarkup> _contents = _get.getContents();
      final TextOrMarkup textOrMarkup = _contents.get(0);
      EList<EObject> _contents_1 = textOrMarkup.getContents();
      int _size = _contents_1.size();
View Full Code Here

      _builder.newLine();
      _builder.newLine();
      _builder.newLine();
      final XdocFile file = this._parseHelperExtensions.parse(_builder);
      AbstractSection _mainSection = file.getMainSection();
      final Document doc = ((Document) _mainSection);
      final EList<LangDef> defs = doc.getLangDefs();
      int _size = defs.size();
      Assert.assertEquals(1, _size);
      final LangDef def = IterableExtensions.<LangDef>head(defs);
      String _name = def.getName();
      Assert.assertEquals(name, _name);
View Full Code Here

  @Test
  public void testFullSectionHirarchy() {
    try {
      final XdocFile file = this._parseHelperExtensions.getDocFromFile((ParserTestConstants.TEST_FILE_DIR + "downToSection4Test.xdoc"));
      AbstractSection _mainSection = file.getMainSection();
      final Document doc = ((Document) _mainSection);
      TextOrMarkup _title = doc.getTitle();
      EList<EObject> _contents = _title.getContents();
      int _size = _contents.size();
      Assert.assertEquals(1, _size);
      TextOrMarkup _title_1 = doc.getTitle();
      EList<EObject> _contents_1 = _title_1.getContents();
      EObject _head = IterableExtensions.<EObject>head(_contents_1);
      TextPart textPart = ((TextPart) _head);
      String _text = textPart.getText();
      Assert.assertEquals("foo", _text);
      EList<Chapter> _chapters = doc.getChapters();
      int _size_1 = _chapters.size();
      Assert.assertEquals(1, _size_1);
      EList<Chapter> _chapters_1 = doc.getChapters();
      final Chapter chapter = IterableExtensions.<Chapter>head(_chapters_1);
      TextOrMarkup _title_2 = chapter.getTitle();
      EList<EObject> _contents_2 = _title_2.getContents();
      int _size_2 = _contents_2.size();
      Assert.assertEquals(1, _size_2);
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.xdoc.xdoc.Document

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.