TESTING TOOL FOR SWT

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

TESTING TOOL FOR SWT

Postby raghavan_26 » Thu Oct 05, 2006 9:14 pm

hi all,
I am raghavan . i am new to this forum ..
i want to just know if any one can help me out in generating a test case using eclipse TPTP tool i am unable to generate test case for the following class



import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;



public class SWTSimpleTree {
Display display = new Display();
Shell shell = new Shell(display);

Tree tree;

/**
* Constructor for SWTSimpleTree.
* @param name
*/



public SWTSimpleTree() {
shell.setLayout(new GridLayout());

tree = new Tree(shell, SWT.BORDER);

tree.setLayoutData(new GridData(GridData.FILL_BOTH));

TreeItem item = new TreeItem(tree, SWT.NULL);
item.setText("ITEM");

TreeItem item2 = new TreeItem(item, SWT.NULL);
item2.setText("ITEM2");

TreeItem item3 = new TreeItem(item2, SWT.NULL);
item3.setText("ITEM3");

System.out.println("item: " + item.getParent() + ", " + item.getParentItem());
System.out.println("item2: " + item2.getParent() + ", " + item2.getParentItem());

System.out.println(tree.getItemCount());
System.out.println(tree.getItems().length);

shell.setSize(300, 200);
shell.open();
//textUser.forceFocus();

// Set up the event loop.
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
// If no more entries in event queue
display.sleep();
}
}

display.dispose();
}

// private void init() {
//
// }

public static void main(String[] args) {
new SWTSimpleTree();
}

}
The test case should navigate through complete tree structute .
like it should ist test wether item is being set correctly or not then the item2 and so on .....

I wanted to just ensure wether this is possible using TPTP tool or not ,
If no what is the other possible tool for testing such code.

Thanks inadvance
raghavan
raghavan_26
 
Posts: 7
Joined: Thu Oct 05, 2006 9:12 pm

Re: TESTING TOOL FOR SWT

Postby Eric Clayberg » Fri Oct 06, 2006 3:56 am

If you need help with TPTP, you should post your questions to the Eclipse TPTP newsgroup.

I should also point out that our SWT WindowTester product (part of RCP Developer) is much more powerful and easy to use than the GUI recorder in TPTP.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest