How to use Service Messages through Java application?

Hi,

 

I am new to teamcity. Please give some sample java program, so it should support the following teamcity service messages.

 

Let’s suppose I have three java test classes (e.g. test1.java, test2.java, test3.java) and TeamCity provides on-the-fly reporting with specially formatted messages using a java program(e.g. ReportGenerator.java).

 

##teamcity[testStarted name='test1']

##teamcity[testFailed name='test1' message='failure message' details='message and stack trace']

##teamcity[testFinished name='test1' duration='50']

 

##teamcity[testStarted name='test2']

##teamcity[testFailed type='comparisonFailure' name='test2' message='failure message' details='message and stack trace' expected='expected value' actual='actual value']

##teamcity[testFinished name='test2' duration='150']

 

##teamcity[testIgnored name='test3' message='ignore comment']

 

Thanks,

Pawan

4 comments

You can output the messages into stdout (e.g. use System.println() for each line). When TeamCity detects the output and reports corresponding tests.

Can you explain why do you need the service messages? What is your original goal?

0

Thanks for quick and correct response..

My main goal is write a java class which will integrate our java test cases with teamcity and Test report by using Service Messages.

0

I just wanted to make sure that this is your custom tests framework since TeamCity comes with integrated support for JUnit and TestNG frameworks.

0

I have custom tests framework. I am not using any JUnit and TestNG frameworks.

0

Please sign in to leave a comment.