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

Bug 395679

Summary: Provide API to run unit test
Product: [RT] RAP Reporter: RĂ¼diger Herrmann <ruediger.herrmann>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: ivan, jsetya, rsternberg
Version: 2.0   
Target Milestone: 3.0 M4   
Hardware: All   
OS: All   
Whiteboard:

Description RĂ¼diger Herrmann CLA 2012-12-04 04:47:44 EST
Unit tests for application code which create widgets depend on the test Fixture that comes with RAP.
Is suggest to make parts of the current Fixture API. Probably just setUp() and tearDown() will do.
Comment 1 Setya Nugdjaja CLA 2014-11-09 07:38:52 EST
Hi All,

It this bug already covered by org.eclipse.rap.rwt.testfixture ?

Regards,
Setya
Comment 2 Ivan Furnadjiev CLA 2014-11-10 04:09:14 EST
(In reply to Setya Mising name from comment #1)
> Hi All,
> 
> It this bug already covered by org.eclipse.rap.rwt.testfixture ?
> 
> Regards,
> Setya

We are working on public test API for 3.0. The first step is TestContext JUnit rule, which is available in master and will replace the old Fixture#setUp and Fixture#tearDown methods.
Comment 3 Setya Nugdjaja CLA 2014-11-14 21:47:34 EST
Hi Ivan,

It this going to work on 2.0 ?
Comment 4 Ivan Furnadjiev CLA 2014-11-15 03:19:59 EST
I don't think so. A lot of code has been changed since RAP 2.0.
Comment 5 Ralf Sternberg CLA 2015-03-27 04:47:22 EDT
As of RAP 3.0 M4, a public JUnit rule TestContext has been added. Simply add this line to every test class:

    @Rule public TestContext context = new TestContext();

This obsoletes Fixture.setUp() and Fixture.tearDown(), and also the need for setting the phase to PROCESS_ACTION in order to test events.