Package org.eclipse.xtext.xdoc.xdoc

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


    validate("codeWithLanguageTest.html", name(document.getChapters().get(0)));
  }

  @Override
  public void testGenCode() throws Exception {
    Document document = createDocumentFrom("codeTest.xdoc");
    generate(document);
    assertGenerated(document);
    generate(document.getChapters().get(0));
    assertGenerated(document.getChapters().get(0));
    validate("codeTest.html", name(document.getChapters().get(0)));
  }
View Full Code Here


    Resource res = set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "01-twoChapters.xdoc"), true);
    Chapter chapter0 = (Chapter) ((XdocFile) getModel((XtextResource)res)).getMainSection();
    res = set.getResource(URI.createURI(ParserTest.TEST_FILE_DIR + "02-twoChapters.xdoc"), true);
    Chapter chapter1 = (Chapter) ((XdocFile) getModel((XtextResource)res)).getMainSection();
    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);
    validate("01-twoChapters.html", name(chapter0));
    validate("02-twoChapters.html", name(chapter1));
View Full Code Here

  }

  @Override
  protected Document initDocFromFile(String string, String filename)
      throws Exception {
    Document doc = super.initDocFromFile(string, HTML_SRC + filename);
    URI uri = doc.eResource().getURI();
    URI appendSegment = uri.trimSegments(1).appendSegment(string+".xdoc");
    doc.eResource().setURI(appendSegment);
    return doc;
  }
View Full Code Here

  public Pair<String, Integer> testGenCode() throws Exception {
    Pair<String, Integer> _xblockexpression = null;
    {
      final XdocFile file = this.getDoc((ParserTestConstants.TEST_FILE_DIR + "codeTest.xdoc"));
      AbstractSection _mainSection = file.getMainSection();
      final Document doc = ((Document) _mainSection);
      this.stateFullGen.generate(doc);
      _xblockexpression = Pair.<String, Integer>of("foo", Integer.valueOf(3));
    }
    return _xblockexpression;
  }
View Full Code Here

    XdocFile file = pTest.getDocFromFile(SRC_DIR + filename);
    AbstractSection mainSection = file.getMainSection();
    if(mainSection instanceof Document) {
      return (Document) mainSection;
    } else if(mainSection instanceof Chapter) {
      Document doc = initDoc(string);
      doc.getChapters().add((Chapter) mainSection);
      return doc;
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  protected Document initDoc(String name) {
    Document result = XdocFactory.eINSTANCE.createDocument();
    TextOrMarkup tomTitle = XdocFactory.eINSTANCE.createTextOrMarkup();
    TextPart title = XdocFactory.eINSTANCE.createTextPart();
    title.setText(name);
    tomTitle.getContents().add(title);
    result.setTitle(tomTitle);
    return result;
  }
View Full Code Here

  @Inject
  LatexGenerator gen;

  public void testSimpleDoc() throws Exception {
    Document doc = initDoc("Simple Doc");
    generate(doc);
  }
View Full Code Here

    generate(doc);
  }

  @Override
  public void testFullHirarchy() throws Exception {
    Document doc = initDocFromFile("downToSection4Test", "downToSection4Test.xdoc");
    generate(doc);
    validate(EXPECTATION_DIR + "fullHirarchy.tex", RESULT_DIR + "foo.tex");
  }
View Full Code Here

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

  @Override
  public void testGenCode() throws Exception {
    Document doc = initDocFromFile("code", "codeTest.xdoc");
    generate(doc);
    validate(EXPECTATION_DIR+"codeTest.tex", RESULT_DIR+"Main.tex");
  }
View Full Code Here

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

  @Override
  public void testGenCodeWithLanguage() throws Exception {
    Document doc = initDocFromFile("codeWithLanguage", "codeWithLanguageTest.xdoc");
    generate(doc);
    validate(EXPECTATION_DIR + "codeWithLanguage.tex", RESULT_DIR + "Main.tex");
  }
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.