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

Bug 317755

Summary: [JUnit] JUnit -> Activate on Error/Failure Only not working
Product: [Eclipse Project] JDT Reporter: Brad Cupit <bradcupit>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad, dirk.olmes, jason.brittain, raksha.vasisht
Version: 3.6Flags: daniel_megert: review+
Target Milestone: 3.6.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Brad Cupit CLA 2010-06-23 18:59:55 EDT
Build Identifier: 20100617-1415

in Helios, JUnit's "Activate on Error/Failure Only" no longer works. Instead, the JUnit tab is always activated. This happens whether in Fast View or not.

This happens with JUnit 3 and 4.

Expected:
when "Activate on Error/Failure Only" is checked and the tests pass, the JUnit dialog should not get focused. If in Fast View, the panel should not be displayed.

Reproducible: Always

Steps to Reproduce:
1. in the JUnit UI, in the upper right corner click the 'down arrow' icon, and check "Activate on Error/Failure Only"
2. Run a JUnit test where every test passes
3. see the JUnit UI activates (a.k.a. gets focus, displays)
Comment 1 Markus Keller CLA 2010-08-19 05:55:55 EDT
Created attachment 176975 [details]
Fix

This patch restores the 3.5 behavior. Committed to HEAD.

Test cases:

package testing;
import org.junit.Test;
public class Good {
	@Test
	public void good() throws Exception {
		System.out.println("Running good...");
		Thread.sleep(3000);
		System.out.println("Done.");
	}
}

package testing;
import static org.junit.Assert.fail;
import org.junit.Test;
public class Bad {
	@Test
	public void bad() throws Exception {
		System.out.println("Running bad...");
		Thread.sleep(3000);
		System.out.println("Done.");
		fail("too bad");
	}
}

package testing;
import org.junit.Test;
public class GoodFast {
	@Test
	public void good() throws Exception {
		System.out.println("Running good.");
	}
}

package testing;
import static org.junit.Assert.fail;
import org.junit.Test;
public class BadFast {
	@Test
	public void bad() throws Exception {
		System.out.println("Running bad.");
		fail("too bad");
	}
}
Comment 2 Markus Keller CLA 2010-08-19 05:57:45 EDT
Dani, please approve for 3.6.1.
Comment 3 Dani Megert CLA 2010-08-19 08:54:13 EDT
The fix is good for 3.6.1 but we also have to fix bug 323134 for 3.6.1 since we messed up the action state saving on shutdown in 3.6.
Comment 4 Markus Keller CLA 2010-08-23 06:59:42 EDT
Branched org.eclipse.jdt.junit and released the fix for 3.6.1.
Comment 5 Dani Megert CLA 2010-08-26 02:50:50 EDT
Starting verification...
Comment 6 Dani Megert CLA 2010-08-26 03:22:34 EDT
Verified on Windows 7 using M20100825-0800.
Comment 7 Raksha Vasisht CLA 2010-08-26 03:42:44 EDT
Verified for 3.6.1 RC2 with M20100825-0800 on Win Xp.
Comment 8 Brad Cupit CLA 2010-10-25 10:51:18 EDT
Thanks for the fix guys!