Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-2845

Failure message not displayed for junit 4 assertEquals test results

    XMLWordPrintable

Details

    Description

      I added the following test to our build:

      package com.concerto;
      
      import static org.junit.Assert.assertEquals;
      
      import org.junit.Test;
      
      public class BambooTest {
      
      	@Test
      	public void testAssertEqualsNoMessage() {
      		assertEquals("monkey", "butter");
      	}
      	
      	@Test
      	public void testAssertEqualsMessage() {
      		assertEquals("message", "monkey", "butter");
      	}
      	
      }
      

      And got the following information about the failed test in Bamboo:

      BambooTest : Assert equals no message (testAssertEqualsNoMessage) History
      
      	at com.concerto.BambooTest.testAssertEqualsNoMessage(BambooTest.java:11)
      
      
      BambooTest : Assert equals message (testAssertEqualsMessage) History
      
      	at com.concerto.BambooTest.testAssertEqualsMessage(BambooTest.java:16)
      
      

      The message, expected value & actual value are all missing.

      The junit result xml file contains this:

        <testcase classname="com.concerto.BambooTest" name="testAssertEqualsNoMessage" time="0.018">
          <error message="expected:&lt;[monkey]&gt; but was:&lt;[butter]&gt;" type="org.junit.ComparisonFailure">     at com.concerto.BambooTest.testAssertEqualsNoMessage(BambooTest.java:11)
          </error>
        </testcase>
        <testcase classname="com.concerto.BambooTest" name="testAssertEqualsMessage" time="-0.0080">
          <error message="message expected:&lt;[monkey]&gt; but was:&lt;[butter]&gt;" type="org.junit.ComparisonFailure">     at com.concerto.BambooTest.testAssertEqualsMessage(BambooTest.java:16)
          </error>
        </testcase>
      

      Attachments

        Activity

          People

            jdumay JamesA
            a864b394e847 Tom Parker
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4h
                4h