[MINVOKER-260] confirm streamLogs by IT tests · apache/maven-invoker-plugin@bfecb96 (original) (raw)

``

1

`+

/*

`

``

2

`+

`

``

3

`+

`

``

4

`+

`

``

5

`+

`

``

6

`+

`

``

7

`+

`

``

8

`+

`

``

9

`+

*

`

``

10

`+

`

``

11

`+

*

`

``

12

`+

`

``

13

`+

`

``

14

`+

`

``

15

`+

`

``

16

`+

`

``

17

`+

`

``

18

`+

*/

`

``

19

+

``

20

`+

def FS = File.separator

`

``

21

+

``

22

`+

// make sure the Invoker Plugin was indeed run and the build didn't fail somewhere else,

`

``

23

`+

// so check if touch.txt exist

`

``

24

+

``

25

`+

assert new File(basedir, 'target/its/beanshell/touch.txt').exists()

`

``

26

`+

assert new File(basedir, 'target/its/groovy/touch.txt').exists()

`

``

27

+

``

28

`+

// logs

`

``

29

`+

def buildLog = new File(basedir, 'build.log').text

`

``

30

`+

def beanshellLog = new File(basedir, 'target/its/beanshell/build.log').text

`

``

31

`+

def groovyLog = new File(basedir, 'target/its/groovy/build.log').text

`

``

32

+

``

33

`+

// beanshell failed and no log message

`

``

34

`+

assert !buildLog.contains('[INFO] Output form beanshell script')

`

``

35

`+

assert buildLog.contains('[INFO] org.apache.maven.shared.scriptinterpreter.ScriptEvaluationException: java.lang.OutOfMemoryError: Requested array size exceeds VM limit')

`

``

36

`+

assert buildLog.contains('[INFO] beanshell' + FS + 'pom.xml ................................ FAILED')

`

``

37

+

``

38

`+

assert beanshellLog.contains('Output form beanshell script')

`

``

39

`+

assert beanshellLog.contains('java.lang.OutOfMemoryError: Requested array size exceeds VM limit')

`

``

40

+

``

41

`+

// groovy failed and no log message

`

``

42

`+

assert !buildLog.contains('[INFO] Output from groovy script')

`

``

43

`+

assert !buildLog.contains('Assertion failed:')

`

``

44

`+

assert !buildLog.contains('assert pom.contains("9.9.9")')

`

``

45

`+

assert buildLog.contains('[INFO] org.apache.maven.shared.scriptinterpreter.ScriptEvaluationException: Assertion Error')

`

``

46

`+

assert buildLog.contains('[INFO] groovy' + FS + 'pom.xml ................................... FAILED')

`

``

47

+

``

48

`+

assert groovyLog.contains('Output from groovy script')

`

``

49

`+

assert groovyLog.contains('Assertion failed:')

`

``

50

`+

assert groovyLog.contains('assert pom.contains("9.9.9")')

`