File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
tmc-langs-java/src/test/java/fi/helsinki/cs/tmc/langs/java/maven Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import java .io .File ;
18
18
import java .io .IOException ;
19
- import java .io .UnsupportedEncodingException ;
20
19
import java .nio .file .Path ;
21
20
import java .util .List ;
22
21
import java .util .Locale ;
@@ -76,6 +75,19 @@ public void testRunTestsWhenBuildFailing() {
76
75
assertEquals (RunResult .Status .COMPILE_FAILED , runResult .status );
77
76
}
78
77
78
+ @ Test
79
+ public void testRunTestsOutputLogIsNotEmptyWhenBuildFails () throws IOException {
80
+ Path project = TestUtils .getPath (getClass (), "failing_maven_exercise" );
81
+ RunResult result = mavenPlugin .runTests (project );
82
+
83
+ byte [] stdoutBytes = result .logs .get ("stdout" );
84
+ String stdoutLog = new String (stdoutBytes , "utf-8" );
85
+ assertTrue ( "Expected stdout log of failed maven test build to contain any text" ,
86
+ stdoutLog .length () > 0 );
87
+ assertTrue ("Expected stdout log of failed maven test build to contain \" BUILD_FAILURE\" !" ,
88
+ stdoutLog .contains ("BUILD FAILURE" ));
89
+ }
90
+
79
91
@ Test
80
92
public void testMavenProjectWithFailingTestsCompilesAndFailsTests () {
81
93
Path path = TestUtils .getPath (getClass (), "maven_exercise" );
You can’t perform that action at this time.
0 commit comments