Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » RCP recommended naming technique not working
RCP recommended naming technique not working [message #884820] Mon, 11 June 2012 22:37 Go to next message
Timothy Vogel is currently offline Timothy VogelFriend
Messages: 82
Registered: July 2009
Member
I am trying to take advantage of the suggestion on page 206 of the user manual.
Quote:
However, you can improve the testability of your application by using the following method in your SWT or RCP code for the current component class: setData(String key, String ComponentName). For the key, use TEST_COMP_NAME.


My code:
public void createPartControl(Composite parent) {

	Composite compositeWindingData = new Composite(section, SWT.NONE);
	compositeWindingData.setData("TEST_COMP_NAME", "windingComposite");
	viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	viewer.setData("TEST_COMP_NAME", "tv_motor_list");
	Table table = this.viewer.getTable();
	viewer.setData("TEST_COMP_NAME", "tbl_motor_list");
}


The technical name in the Object Mapper is the same before and after adding the above setData() statements. I even created a new Test Project in the database after adding the setData() statements.

Any suggestions what I can do to get more consistent names?
Re: RCP recommended naming technique not working [message #885048 is a reply to message #884820] Tue, 12 June 2012 10:54 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

a) Only SWT components are evaluated by their Data property. Setting Data on the TableViewer won't help since it is not used.
b) In RCP a few components are identified by their IDs (Editors, Views, etc.). The Data property might be ignored on these components.
c) In your example, you are setting the Data property twice on the Viewer (which looks like a copy/paste/modify error). Setting Data on the Table should give you a new name for the component.

HTH

Achim
Re: RCP recommended naming technique not working [message #885214 is a reply to message #885048] Tue, 12 June 2012 16:10 Go to previous message
Timothy Vogel is currently offline Timothy VogelFriend
Messages: 82
Registered: July 2009
Member
Embarrassed OOPS!! Embarrassed

Thanks for finding my typo and being so kind as to provide the other points at the same time.
Previous Topic:Null Pointer Exception
Next Topic:Running AUTs View
Goto Forum:
  


Current Time: Wed Apr 24 18:21:36 GMT 2024

Powered by FUDForum. Page generated in 0.02628 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top