Examples of Bibliography


Examples of br.com.caelum.tubaina.bibliography.Bibliography

        latexBibGenerator = new LatexBibliographyGenerator();
    }
   
    @Test
    public void shouldGenerateBibContent() throws Exception {
        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibsimple.xml"));

        String expectedBib = new Scanner(new File("src/test/resources/bibliography/book.bib"))
                .useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }

    @Test
    public void shouldGenerateBibContentWithPublisher() throws Exception {

        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibwithpublisher.xml"));

        String expectedBib = new Scanner(new File(
                "src/test/resources/bibliography/bookwithpublisher.bib")).useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldGenerateBibWithoutAField() throws Exception {

        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/miscwithoutyear.xml"));

        String expectedBib = new Scanner(new File(
                "src/test/resources/bibliography/miscwithoutyear.bib")).useDelimiter("$$").next();
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldGenerateBibliographyWithEmptyHowAuthor() throws Exception {
        BibliographyEntry entry = new BibliographyEntry(null, "title", "1999", null, "article", "label", null);
        Bibliography bibliography = new Bibliography(Arrays.asList(entry));
        latexBibGenerator.generateTextOf(bibliography);
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldAcceptJournalWhenIsArticle() throws Exception {
        BibliographyEntry entry = new BibliographyEntry("joao", "title", "1999", null, "article", "label", "international conference");
        Bibliography bibliography = new Bibliography(Arrays.asList(entry));
        String bib = latexBibGenerator.generateTextOf(bibliography);
        assertTrue(bib.contains("journal = {international conference}"));
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldNotAppearJournalWhenEmpty() throws Exception {
        BibliographyEntry entry = new BibliographyEntry("joao", "title", "1999", null, "article", "label", null);
        Bibliography bibliography = new Bibliography(Arrays.asList(entry));
        String bib = latexBibGenerator.generateTextOf(bibliography);
        assertFalse(bib.contains("journal ="));
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

        XStream xstream = new XStream();
        xstream.addImplicitCollection(Bibliography.class, "entries");
        xstream.alias("bibliography", Bibliography.class);
        xstream.alias("bibliography-entry", BibliographyEntry.class);

        Bibliography bibliography = (Bibliography) xstream.fromXML(new File(
                "src/test/resources/bibliography/bib.xml"));
       
        assertEquals("livro-jose", bibliography.getEntries().get(0).label);
        assertEquals("artigo-jose", bibliography.getEntries().get(1).label);
       
       
       
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

        htmlBibGenerator = new HtmlBibliographyGenerator(cfg);
    }

    @Test
    public void shouldGenerateHtmlBibContent() throws Exception {
        Bibliography bibliography = new BibliographyFactory().build(new File(
                "src/test/resources/bibliography/bibsimple.xml"));

        String html = htmlBibGenerator.generateTextOf(bibliography);
        assertTrue(html.contains("Jose da silva"));
        assertTrue(html.contains("Livro legal"));
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldGenerateHtmlWithJournal() throws Exception {
        BibliographyEntry bibliographyEntry = new BibliographyEntry("autor", "titulo", "2012", "", "article", "ref", "some journal");
        Bibliography bibliography = new Bibliography(Arrays.asList(bibliographyEntry));
       
        String html = htmlBibGenerator.generateTextOf(bibliography);
        assertTrue(html.contains("some journal"));
    }
View Full Code Here

Examples of br.com.caelum.tubaina.bibliography.Bibliography

    }
   
    @Test
    public void shouldNotGenerateHtmlWithEmptyYear() throws Exception {
        BibliographyEntry bibliographyEntry = new BibliographyEntry("autor", "titulo", "", "", "article", "ref", "some journal");
        Bibliography bibliography = new Bibliography(Arrays.asList(bibliographyEntry));
        String html = htmlBibGenerator.generateTextOf(bibliography);
        System.out.println(html);
        assertFalse(html.contains("()"));
    }
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.