You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by "Deng, Lea" <Le...@ccc.govt.nz> on 2016/01/13 03:49:19 UTC

multiple line assertion comment

Hi,

I'm trying to display the comment for a failed assertion into multiple lines. But '\n' does not work.
The comment for the failed assertion is still in one line in the test case logging.

Any suggestion would be appreciated.
Many thanks,
Lea

String comment = 'these items are NOT found in Pathway response: '+'\n'+ notFoundList.toString()
String comment1 = "  lea  "
assert notFoundList.isEmpty(),comment


  *   -> java.lang.AssertionError: these items are NOT found in Pathway response: [leaMockUpCode, another mock up decision, NOTPAP, Publicly notified at applicant's request, leaMadeUp, lea mock decision]. Expression: notFoundList.isEmpty()




Kind Regards
Lea Deng

Creating connections to make IT easier for everyone

Lead Test Analyst
IT Regulatory Services Team
Christchurch City Council
New Zealand
DDI: +64 (3) 941 88 55
Extn: 8855
lea.deng@ccc.govt.nz<ma...@ccc.govt.nz>

**********************************************************************
This electronic email and any files transmitted with it are intended
solely for the use of the individual or entity to whom they are addressed.

The views expressed in this message are those of the individual sender
and may not necessarily reflect the views of the Christchurch City Council.

If you are not the correct recipient of this email please advise the
sender and delete.

Christchurch City Council
http://www.ccc.govt.nz
**********************************************************************

Re: multiple line assertion comment

Posted by Marc Paquette <ma...@mac.com>.
The '\n' is working, meaning it is part of the string until it is removed or ignored by the text widget displaying the assertion message.  In other words, this is something done in soapui, not a groovy problem.  You can write the content to System.out or to a file to convince yourself that putting a '\n' character in a String does output a newline to the output stream.  

Maybe there is a way to configure soapui so the newlines in assertion message are rendered in the text widget, but I've never found it (although I didn't look very hard).

Marc Paquette

> Le 12 janv. 2016 à 21:49, Deng, Lea <Le...@ccc.govt.nz> a écrit :
> 
> Hi, 
>  
> I'm trying to display the comment for a failed assertion into multiple lines. But '\n' does not work.
> The comment for the failed assertion is still in one line in the test case logging.
>  
> Any suggestion would be appreciated. 
> Many thanks, 
> Lea
>  
> String comment = 'these items are NOT found in Pathway response: '+'\n'+ notFoundList.toString()
> String comment1 = "  lea  "
> assert notFoundList.isEmpty(),comment
>  
> -> java.lang.AssertionError: these items are NOT found in Pathway response: [leaMockUpCode, another mock up decision, NOTPAP, Publicly notified at applicant's request, leaMadeUp, lea mock decision]. Expression: notFoundList.isEmpty() 
>  
>  
>  
>  
> Kind Regards
> Lea Deng
>  
> Creating connections to make IT easier for everyone
>  
> Lead Test Analyst
> IT Regulatory Services Team
> Christchurch City Council
> New Zealand
> DDI: +64 (3) 941 88 55
> Extn: 8855
> lea.deng@ccc.govt.nz <ma...@ccc.govt.nz>
>  
> **********************************************************************
> This electronic email and any files transmitted with it are intended 
> solely for the use of the individual or entity to whom they are addressed.
> 
> The views expressed in this message are those of the individual sender
> and may not necessarily reflect the views of the Christchurch City Council.
> 
> If you are not the correct recipient of this email please advise the
> sender and delete.
> 
> Christchurch City Council
> http://www.ccc.govt.nz <http://www.ccc.govt.nz/>
> **********************************************************************
>