Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317313

Summary: [junit] view does not display multiples tests with the same name correctly
Product: [Eclipse Project] JDT Reporter: John Dean <john.dean.3>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Show mal-formed junit results none

Description John Dean CLA 2010-06-18 12:04:01 EDT
Build Identifier: 

When two test classes are run back-to-back then all of the results for all of the tests with the same name show up in the last test of that grouping.

We have been experimenting with new test drivers which can be the same test run over and over again but with different data points, but the junit test results in the Junit view are hard to interpret.  

The only known workaround is to insert a dummy test between test duplicates which does have the fringe benefit of artificially raising test case numbers, but can be cumbersome to catch all instances.

Reproducible: Always

Steps to Reproduce:
Compile and run this Junit4 test:

If the results look like the attached picture, then BUG

package junitview.test;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

import com.nokia.carbide.automation.debug.test.blackflag.JunitViewTest.TestDriver;

import static org.junit.Assert.assertEquals;


@RunWith(Suite.class)
@SuiteClasses( { TestDriver.class, TestDriver.class, TestDriver.class, TestDriver.class } )
public class JunitViewTest {

	protected static int count = 0;
	
	public static class TestDriver {
		@Test
		public void runTest() {
			assertEquals(2, count++);
		}
	}
	
}
Comment 1 John Dean CLA 2010-06-18 12:04:44 EDT
Created attachment 172228 [details]
Show mal-formed junit results
Comment 2 John Dean CLA 2010-06-18 12:07:16 EDT
Sorry, forgot to include the Eclipse build number.  Last seen on Eclipse 3.6 RC4 Build id: I20100603-1500
Comment 3 Markus Keller CLA 2010-06-18 12:11:23 EDT

*** This bug has been marked as a duplicate of bug 172256 ***