Package org.apache.chemistry.opencmis.util.content.loremipsum

Examples of org.apache.chemistry.opencmis.util.content.loremipsum.LoremIpsum


        ContentStreamImpl content = new ContentStreamImpl();
        content.setFileName("data.html");
        content.setMimeType("text/html");
        int len = fContentSizeInK * 1024; // size of document in K
       
        LoremIpsum ipsum = new LoremIpsum();
        String text = ipsum.generateParagraphsFullHtml(len, true);
        content.setStream(new ByteArrayInputStream(text.getBytes()));
        return content;
    }
View Full Code Here


        ContentStreamImpl content = new ContentStreamImpl();
        content.setFileName("data.txt");
        content.setMimeType("text/plain");
        int len = fContentSizeInK * 1024; // size of document in K
       
        LoremIpsum ipsum = new LoremIpsum();
        String text = ipsum.generateParagraphsPlainText(len, 80, true);
        content.setStream(new ByteArrayInputStream(text.getBytes()));
        return content;
    }
View Full Code Here

    }
   
    @Test
    public void testGenerateLoreIpsumPlainTextWriter() throws IOException  {
        LOG.debug("Generate new Lore Ipsum as plain text with PrintWriter: ");
        LoremIpsum ipsum = new LoremIpsum();
        StringWriter writer = new StringWriter();
        ipsum.generateParagraphsPlainText(writer, 2048, true);
        LOG.debug(writer.toString());
        LOG.debug("End Test.");
    }
View Full Code Here

    }
   
    @Test
    public void testGenerateLoreIpsumPlainTextFormattedWriter() throws IOException {
        LOG.debug("Generate new Lore Ipsum as plain text with 60 columns with PrintWriter: ");
        LoremIpsum ipsum = new LoremIpsum();
        StringWriter writer = new StringWriter();
        ipsum.generateParagraphsPlainText(writer, 256, 60, false);
        LOG.debug(writer.toString());
        LOG.debug("End Test.");
    }
View Full Code Here

          sample.append(buffer, 0, read);
        }
      } while (read>=0);

     
      LoremIpsum ipsum = new LoremIpsum(sample.toString());
      String output = ipsum.generateParagraphsPlainText(4096, 80, false);
      LOG.debug(output);
        LOG.debug("End Test.");
    }
View Full Code Here

      doGenerate(" .\n\n .");
    }
   
    private void doGenerate(String text) {
      try {
        generator = new LoremIpsum(text, dictionary);
        generator.generateParagraph(false);
        fail("Sample text " + text + " should generate exception.");
      } catch (RuntimeException e) {
        assertTrue(e.getMessage().contains("Invalid sample text"));
      }
View Full Code Here

      doGenerateNoDict("  \n\n  ");
    }
   
    private void doGenerateNoDict(String dict) {
      try {
        generator = new LoremIpsum(sample, dict);
        generator.generateParagraph(false);
        fail("Dictionary " + dict + " should generate exception.");
      } catch (RuntimeException e) {
        assertEquals(e.getMessage(), "Invalid dictionary.");
      }
View Full Code Here

    }
   
    @Test
    public void testGenerateLoreIpsum() {
      LOG.debug("Generate new Lore Ipsum text: ");
      LoremIpsum ipsum = new LoremIpsum();
      String[] newParagraphs = new String[4];
      for (int i=0; i<newParagraphs.length; i++) {
        newParagraphs[i] = ipsum.generateParagraph(false);
        LOG.debug(newParagraphs[i]);
        LOG.debug("");
        LOG.debug("");
      }
    }
View Full Code Here

    }
   
    @Test
    public void testGenerateLoreIpsumHtml1() {
      LOG.debug("Generate new Lore Ipsum as html paragraphs:");
      LoremIpsum ipsum = new LoremIpsum();
      String output = ipsum.generateParagraphsHtml(2048, true);
      LOG.debug(output);
      LOG.debug("");
    }
View Full Code Here

    }
   
    @Test
    public void testGenerateLoreIpsumHtml2() {
      LOG.debug("Generate new Lore Ipsum as one html paragraph:");
      LoremIpsum ipsum = new LoremIpsum();
      String output = ipsum.generateOneParagraphHtml(2048, true);
      LOG.debug(output);
      LOG.debug("");
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.util.content.loremipsum.LoremIpsum

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.