Skip to content

Commit 483b4d1

Browse files
author
Igor Polevoy
committed
#223 Lessc plugin need to be able to process more than one file - damn!!
1 parent 4ede056 commit 483b4d1

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

activeweb-lessc-integration-test/src/test/java/org/javalite/lessc/maven/IntegrationTest.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
*/
1515
public class IntegrationTest {
1616

17-
protected String execute(String root, String... args) throws IOException, InterruptedException, MavenInvocationException {
17+
protected String execute(String root, boolean offline, String... args) throws IOException, InterruptedException, MavenInvocationException {
1818
InvocationRequest request = new DefaultInvocationRequest();
1919
request.setPomFile( new File( root + "/pom.xml" ) );
2020
request.setGoals(Arrays.asList(args));
21+
request.setOffline(offline);
2122
Invoker invoker = new DefaultInvoker();
2223
invoker.setWorkingDirectory(new File(root));
2324

25+
2426
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
2527
ByteArrayOutputStream errorStream = new ByteArrayOutputStream();
2628
invoker.setErrorHandler(new PrintStreamHandler(new PrintStream(outputStream), true));
@@ -31,25 +33,15 @@ protected String execute(String root, String... args) throws IOException, Interr
3133
return output;
3234
}
3335

34-
private String getContent(BufferedReader reader) throws IOException {
35-
String line;
36-
String content = "";
37-
while ((line = reader.readLine()) != null) {
38-
System.out.println("[IntegrationTest > Stderr] " + line);
39-
content += line;
40-
}
41-
return content;
42-
}
43-
4436
@Test
4537
public void shouldCompileProjectWithSingleLessFile() throws IOException, InterruptedException, MavenInvocationException {
4638

4739
String root = "target/test-project";
4840

49-
String output = execute(root, "clean");
41+
String output = execute(root, true, "clean");
5042
the(output).shouldContain("BUILD SUCCESS");
5143

52-
output = execute(root, "install", "-o");
44+
output = execute(root, true, "install");
5345
the(output).shouldContain("BUILD SUCCESS");
5446

5547
File f = new File(root + "/target/web/bootstrap.css");
@@ -59,9 +51,9 @@ public void shouldCompileProjectWithSingleLessFile() throws IOException, Interru
5951
@Test
6052
public void shouldCompileProjectWithMultipleLessFile() throws IOException, InterruptedException, MavenInvocationException {
6153
String root = "target/test-project-list";
62-
String output = execute(root, "clean");
54+
String output = execute(root, true, "clean");
6355
the(output).shouldContain("BUILD SUCCESS");
64-
output = execute(root, "install", "-o");
56+
output = execute(root, true, "install");
6557
the(output).shouldContain("BUILD SUCCESS");
6658

6759
File f = new File(root + "/target/web1/bootstrap.css");

0 commit comments

Comments
 (0)