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

Failure message not displayed for junit 4 assertEquals test results

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 2.5 M6, 2.5
    • 2.0.4
    • User Interface
    • None

      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>
      

        1. report.xml
          11 kB
          James Dumay

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

                Created:
                Updated:
                Resolved:

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