Package juzu.plugin.less.impl.lesser

Examples of juzu.plugin.less.impl.lesser.Compilation


  }

  @Test
  public void testSimple() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "simple.less");
    Assert.assertEquals(".class {\n" +
      "  width: 2;\n" +
      "}\n", compilation.getValue());

    //
    compilation = (Compilation)lesser.compile(context, "simple.less", true);
    Assert.assertEquals(".class{width:2;}\n", compilation.getValue());
  }
View Full Code Here


  @Test
  public void testBootstrap() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/bootstrap/"));
    long time = -System.currentTimeMillis();
    Compilation compilation = (Compilation)lesser.compile(context, "bootstrap.less");
    time += System.currentTimeMillis();
    Assert.assertNotNull(compilation);
    System.out.println("Bootstrap parsed in " + time + "ms");
  }
View Full Code Here

  }

  @Test
  public void testImport() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "importer.less");
    Assert.assertEquals("a {\n" +
      "  width: 2px;\n" +
      "}\n", compilation.getValue());
  }
View Full Code Here

  }

  @Test
  public void testImportRelative() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "relative.less");
    Assert.assertEquals("a {\n" +
        "  width: 2px;\n" +
        "}\n", compilation.getValue());
  }
View Full Code Here

          //
          if (result instanceof Compilation) {
            try {
              log.info("Resource " + resource + " compiled about to write on disk as " + to);
              Compilation compilation = (Compilation)result;
              FileObject fo = env.createResource(StandardLocation.CLASS_OUTPUT, to);
              Writer writer = fo.openWriter();
              try {
                writer.write(compilation.getValue());
              }
              finally {
                Tools.safeClose(writer);
              }
            }
View Full Code Here

TOP

Related Classes of juzu.plugin.less.impl.lesser.Compilation

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.