@Test public void compileWhenImportDoesNotExist() throws Exception { when(skinManager.getSkin("skin")).thenReturn(skin); Less4jException caughtException = null; try { StringWriter source = new StringWriter(); IOUtils.copy(new FileInputStream(getClass().getResource("/style3.less").getFile()), source); mocker.getComponentUnderTest().compile(source.toString(), "skin", false); } catch (Less4jException e) { caughtException = e; } assertNotNull(caughtException); StringWriter exceptionMessage = new StringWriter(); IOUtils.copy(new FileInputStream(getClass().getResource("/lessException.txt").getFile()), exceptionMessage); assertEquals(exceptionMessage.toString(), caughtException.getMessage()); }
public String compile(String lessCode, String skin, boolean inlineSourceMap) throws Less4jException { LessCompiler lessCompiler = new DefaultLessCompiler(); LessCompiler.Configuration options = new LessCompiler.Configuration(); options.setCompressing(true); options.getSourceMapConfiguration().setInline(inlineSourceMap); options.getSourceMapConfiguration().setIncludeSourcesContent(true); LessSource lessSource = new CustomContentLESSSource(lessCode, templateManager, skinManager.getSkin(skin)); LessCompiler.CompilationResult lessResult = lessCompiler.compile(lessSource, options); return lessResult.getCss(); }
Less4jCompiler { public String compile(String lessCode, String skin, boolean inlineSourceMap) throws Less4jException { LessCompiler lessCompiler = new DefaultLessCompiler(); LessCompiler.Configuration options = new LessCompiler.Configuration(); options.setCompressing(true); options.getSourceMapConfiguration().setInline(inlineSourceMap); options.getSourceMapConfiguration().setIncludeSourcesContent(true); LessSource lessSource = new CustomContentLESSSource(lessCode, templateManager, skinManager.getSkin(skin)); LessCompiler.CompilationResult lessResult = lessCompiler.compile(lessSource, options); return lessResult.getCss(); } }
Less4jCompiler { public String compile(String lessCode, String skin, boolean inlineSourceMap) throws Less4jException { LessCompiler lessCompiler = new DefaultLessCompiler(); LessCompiler.Configuration options = new LessCompiler.Configuration(); options.setCompressing(true); options.getSourceMapConfiguration().setInline(inlineSourceMap); options.getSourceMapConfiguration().setIncludeSourcesContent(true); LessSource lessSource = new CustomContentLESSSource(lessCode, templateManager, skinManager.getSkin(skin)); LessCompiler.CompilationResult lessResult = lessCompiler.compile(lessSource, options); return lessResult.getCss(); }  }
Less4jCompiler { public String compile(String lessCode, String skin, boolean inlineSourceMap) throws Less4jException { LessCompiler lessCompiler = new DefaultLessCompiler(); LessCompiler.Configuration options = new LessCompiler.Configuration(); options.setCompressing(true); options.getSourceMapConfiguration().setInline(inlineSourceMap); options.getSourceMapConfiguration().setIncludeSourcesContent(true); LessSource lessSource = new CustomContentLESSSource(lessCode, templateManager, skinManager.getSkin(skin)); LessCompiler.CompilationResult lessResult = lessCompiler.compile(lessSource, options); return lessResult.getCss(); }  String compile(String lessCode, String skin, boolean inlineSourceMap); }
Less4jCompiler { public String compile(String lessCode, String skin, boolean inlineSourceMap) throws Less4jException { LessCompiler lessCompiler = new DefaultLessCompiler(); LessCompiler.Configuration options = new LessCompiler.Configuration(); options.setCompressing(true); options.getSourceMapConfiguration().setInline(inlineSourceMap); options.getSourceMapConfiguration().setIncludeSourcesContent(true); LessSource lessSource = new CustomContentLESSSource(lessCode, templateManager, skinManager.getSkin(skin)); LessCompiler.CompilationResult lessResult = lessCompiler.compile(lessSource, options); return lessResult.getCss(); }  String compile(String lessCode, String skin, boolean inlineSourceMap);  }