Examples of XdocFile


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

    validate(EXPECTATION_DIR + "simpleRefTest.html", RESULT_FILE);
  }

  @Override
  public void testTable() throws Exception {
    XdocFile file = pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "table.xdoc");
    generate(file.getMainSection());
    validate(EXPECTATION_DIR + "table.html", RESULT_FILE);
  }
View Full Code Here

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

  @Override
  public void testTwoChapters() throws Exception {
    XtextResourceSet set = get(XtextResourceSet.class);
    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "01-twoChapters.xdoc"), true);
    set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "02-twoChapters.xdoc"), true);
    XdocFile file = (XdocFile) getModel((XtextResource)set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "twoChaptersDoc.xdoc"), true));
    Document doc = (Document) file.getMainSection();
    for(int i = 0; i < doc.getChapters().size(); i++) {
      Chapter chapter = doc.getChapters().get(i);
      generate(chapter);
    }
    generate(doc);
View Full Code Here

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

    generate(doc);
  }

  @Override
  public void testFullHirarchy () throws Exception {
    XdocFile file = pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "downToSection4Test.xdoc");
    // gen toc.xml
    generate(file.getMainSection());
    validate(EXPECTATION_DIR + "fullHirarchyTOC.xml", RESULT_DIR + "toc.xml");
    validate(EXPECTATION_DIR + "fullHirarchy.xdoc.html", RESULT_DIR + "mytestmodel.xdoc-0.html");
  }
View Full Code Here

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

    validate(EXPECTATION_DIR + "fullHirarchy.xdoc.html", RESULT_DIR + "mytestmodel.xdoc-0.html");
  }

  @Override
  public void testEscape() throws Exception {
    XdocFile file = pTest.getDocFromFile(ParserTest.TEST_FILE_DIR + "testEscape.xdoc");
    generate(file.getMainSection());
    validate(EXPECTATION_DIR + "escapeTest.html", RESULT_FILE);
  }
View Full Code Here

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

    String emphasized = "manchmal fett";
    String secondPart = " und manchmal nicht.\nNewlines und so gibt es auch.";
    String text = "chapter[" + title + "]\r\n\r\n" + firstPart + "e["
        + emphasized + "]" + secondPart + "\n\n";
    //System.out.println(text);
    XdocFile model = getDoc(text);
    Chapter chapter = (Chapter) model.getMainSection();
    assertEquals(title,
        ((TextPart) ((chapter.getTitle()).getContents()
            .get(0))).getText());
    assertEquals(1, chapter.getContents().size());
    TextOrMarkup p = chapter.getContents().get(0);
View Full Code Here

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

  public void testAnchoredReference() throws Exception {
    String anchor = " a[refName]";
    String fill = " Jump ";
    String refText = " to ";
    String ref = " ref:refName[" + refText + "]";
    XdocFile file = getDoc(CHAPTER_HEAD + anchor + fill + ref);
    TextOrMarkup textOrMarkup = file.getMainSection()
        .getContents().get(0);
    assertEquals(4, textOrMarkup.getContents().size());
    Anchor a = (Anchor) textOrMarkup.getContents().get(1);
    Ref r = (Ref) textOrMarkup.getContents().get(3);
    assertEquals(a, r.getRef());
View Full Code Here

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

  // public void testCodeRef() throws Exception {
  // 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);
View Full Code Here

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

    cb = (CodeBlock) textOrMarkup.getContents().get(0);
    assertEquals(0, cb.getContents().size());
  }

  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"
View Full Code Here

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

        ((Code) cb.getContents().get(0)).getContents());
    assertEquals("Java", cb.getLanguage().getName());
  }

  public void testComment() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "commentTest.xdoc");
    assertEquals(1, file.getMainSection().getContents().size());
  }
View Full Code Here

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

    XdocFile file = getDocFromFile(TEST_FILE_DIR + "commentTest.xdoc");
    assertEquals(1, file.getMainSection().getContents().size());
  }

  public void testLink() throws Exception {
    XdocFile file = getDocFromFile(TEST_FILE_DIR + "linkTest.xdoc");
    Link link = (Link) (file.getMainSection()
        .getContents().get(0)).getContents().get(0);
    URL url;
    url = new URL(link.getUrl());
    URLConnection c = url.openConnection();
    assertNotNull(c);
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.