Package juzu.plugin.less.impl.lesser

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


  }

  @Test
  public void testFail() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure ret = (Failure)lesser.compile(context, "fail.less");
    LinkedList<LessError> errors = ret.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals("fail.less", error.src);
    Assert.assertEquals(1, error.line);
    Assert.assertEquals(8, error.column);
View Full Code Here


  }

  @Test
  public void testCannotResolveImport() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "cannotresolveimport.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals(1, error.line);
    Assert.assertEquals(4, error.column);
    Assert.assertEquals(4, error.index);
View Full Code Here

  }

  @Test
  public void testSeveralErrors() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "severalerrors1.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(2, errors.size());
  }
View Full Code Here

  }

  @Test
  public void testUnresolableVariable() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "unresolvablevariable.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals(1, error.line);
    Assert.assertEquals(17, error.column);
    Assert.assertEquals(17, error.index);
View Full Code Here

  }

  @Test
  public void testExtract() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "extract.less");
    Assert.assertEquals(1, failure.getErrors().size());
    LessError error = failure.getErrors().get(0);
    Assert.assertEquals(2, error.line);
    String[] extract = error.extract;
    Assert.assertEquals(3, extract.length);
    Assert.assertEquals("// comment 1", extract[0]);
    Assert.assertEquals("a { width: + 1px }", extract[1]);
View Full Code Here

            catch (IOException e) {
              log.info("Resource " + to + " could not be written on disk", e);
            }
          }
          else {
            Failure failure = (Failure)result;
            LinkedList<LessError> errors = failure.getErrors();
            ArrayList<Message> messages = new ArrayList<Message>(errors.size());
            StringBuilder sb = new StringBuilder();
            for (LessError error : errors) {
              String text = error.message != null ? error.message : "There is an error in your .less file";
              int index = error.line - (error.extract.length - 1) / 2;
View Full Code Here

TOP

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

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.