Check output in Maven IC tests
This commit is contained in:
+16
-1
@@ -1,6 +1,8 @@
|
|||||||
package org.jetbrains.kotlin.maven;
|
package org.jetbrains.kotlin.maven;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class IncrementalCompilationIT extends MavenITBase {
|
public class IncrementalCompilationIT extends MavenITBase {
|
||||||
@@ -9,10 +11,20 @@ public class IncrementalCompilationIT extends MavenITBase {
|
|||||||
MavenProject project = new MavenProject("kotlinSimple");
|
MavenProject project = new MavenProject("kotlinSimple");
|
||||||
project.exec("package")
|
project.exec("package")
|
||||||
.succeeded()
|
.succeeded()
|
||||||
.fileExists("target/classes/test.properties")
|
.filesExist(kotlinSimpleOutputPaths())
|
||||||
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt", "src/main/kotlin/Dummy.kt");
|
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt", "src/main/kotlin/Dummy.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private String[] kotlinSimpleOutputPaths() {
|
||||||
|
return new String[]{
|
||||||
|
"target/classes/test.properties",
|
||||||
|
"target/classes/A.class",
|
||||||
|
"target/classes/UseAKt.class",
|
||||||
|
"target/classes/Dummy.class"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNoChanges() throws Exception {
|
public void testNoChanges() throws Exception {
|
||||||
MavenProject project = new MavenProject("kotlinSimple");
|
MavenProject project = new MavenProject("kotlinSimple");
|
||||||
@@ -20,6 +32,7 @@ public class IncrementalCompilationIT extends MavenITBase {
|
|||||||
|
|
||||||
project.exec("package")
|
project.exec("package")
|
||||||
.succeeded()
|
.succeeded()
|
||||||
|
.filesExist(kotlinSimpleOutputPaths())
|
||||||
.compiledKotlin();
|
.compiledKotlin();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +53,7 @@ public class IncrementalCompilationIT extends MavenITBase {
|
|||||||
MavenTestUtils.replaceFirstInFile(aKt, replacement, original);
|
MavenTestUtils.replaceFirstInFile(aKt, replacement, original);
|
||||||
project.exec("package")
|
project.exec("package")
|
||||||
.succeeded()
|
.succeeded()
|
||||||
|
.filesExist(kotlinSimpleOutputPaths())
|
||||||
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt");
|
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -54,6 +68,7 @@ public class IncrementalCompilationIT extends MavenITBase {
|
|||||||
|
|
||||||
project.exec("package")
|
project.exec("package")
|
||||||
.succeeded()
|
.succeeded()
|
||||||
|
.filesExist(kotlinSimpleOutputPaths())
|
||||||
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt");
|
.compiledKotlin("src/main/kotlin/A.kt", "src/main/kotlin/useA.kt");
|
||||||
|
|
||||||
// todo rebuild and compare output
|
// todo rebuild and compare output
|
||||||
|
|||||||
+5
-3
@@ -111,12 +111,14 @@ class MavenExecutionResult {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
MavenExecutionResult fileExists(@NotNull final String path) throws Exception {
|
MavenExecutionResult filesExist(@NotNull final String... paths) throws Exception {
|
||||||
return check(new Action<MavenExecutionResult>() {
|
return check(new Action<MavenExecutionResult>() {
|
||||||
@Override
|
@Override
|
||||||
public void run(MavenExecutionResult execResult) {
|
public void run(MavenExecutionResult execResult) {
|
||||||
File file = new File(workingDir, path);
|
for (String path : paths) {
|
||||||
Assert.assertTrue(file + " does not exist", file.exists());
|
File file = new File(workingDir, path);
|
||||||
|
Assert.assertTrue(file + " does not exist", file.exists());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user