Package japidviews.templates

Examples of japidviews.templates.Posts


  public void testSinglePageJapid() throws Exception {
    final List<Post> posts = createPosts();
    // execute the template
    long tt = System.currentTimeMillis();
    ByteArrayOutputStream baos = new ByteArrayOutputStream(10000);
    Posts te = new Posts();
    te.render("抬头", posts);
    te = new Posts();
    te.render("抬头", posts);
    te = new Posts();
    te.render("抬头", posts);
    baos.write(te.toString().getBytes("UTF-8"));
    te = new Posts();
    te.render("抬头", posts);
    baos.write(te.toString().getBytes("UTF-8"));
    baos.write(te.toString().getBytes("UTF-8"));
    for (int i = 0; i < 1000; i++) {
      baos.reset();
      long t = System.currentTimeMillis();
      // System.out.println("run templating: " + i);
      /* Merge data-model with template */

      // StringWriter out = new StringWriter(1000);
      // PrintWriter printWriter = new PrintWriter(out);
      te = new Posts();
      te.render("抬头", posts);
      baos.write(te.toString().getBytes("UTF-8"));
      // System.out.println(out.toString());
      // out.flush();
      // System.out.println(System.currentTimeMillis() - t);
      // System.out.println(out.toString());
      // Thread.sleep(5);
View Full Code Here


  public void testSinglePageJapid() throws Exception {
    final List<Post> posts = createPosts();
    // execute the template
    long tt = System.currentTimeMillis();
    ByteArrayOutputStream baos = new ByteArrayOutputStream(10000);
    Posts te = new Posts();
    te.render("抬头", posts);
    te = new Posts();
    te.render("抬头", posts);
    te = new Posts();
    te.render("抬头", posts);
    baos.write(te.toString().getBytes("UTF-8"));
    te = new Posts();
    te.render("抬头", posts);
    baos.write(te.toString().getBytes("UTF-8"));
    baos.write(te.toString().getBytes("UTF-8"));
    for (int i = 0; i < 100; i++) {
      baos.reset();
      long t = System.currentTimeMillis();
      // System.out.println("run templating: " + i);
      /* Merge data-model with template */

      // StringWriter out = new StringWriter(1000);
      // PrintWriter printWriter = new PrintWriter(out);
      te = new Posts();
      te.render("抬头", posts);
      baos.write(te.toString().getBytes("UTF-8"));
      // System.out.println(out.toString());
      // out.flush();
      System.out.println(System.currentTimeMillis() - t);
      // System.out.println(out.toString());
      // Thread.sleep(5);
View Full Code Here

TOP

Related Classes of japidviews.templates.Posts

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.