BUG Community

Welcome! Log In

bballantine's Blog

SWTBot for Eclipse UI Testing

Unit testing is an important part of any development cycle.  It's especially useful when you're trying to track down a defect in unfamiliar code.  When I get a defect report from the QA team, it tells me that there's some buggy code, obviously, but it also shows me areas where I'm not getting enough test coverage.  Tracking down a defect by first writing a test case is an excellent way to kill a couple of birds with one stone. 

JUnit generally does do a nice job of integrating with whatever java platform you're developing in, which is a definite plus.  It's nice to have your tests right there next to the code you're testing.  When working with Eclipse plug-in code, JUnit works especially well.  An excellent way to work with JUnit in Eclipse is to create a test plugin that corresponds to the plugin you wish to test.  By adding the test subject as a dependency, you can code to it as you would any plug-in.  To run your test, you simply need to right click on your test case and select Run As JUnit Plug-in Test --

created on: 11/25/08


Unfortunately JUnit alone doesn't suffice for UI testing in Eclipse.  This leads to manual testing of UI code, which is time consuming, can lead to bugs, and just isn't fun. 

SWTBot is a young project that facilitates the creation of UI tests for Eclpse.  After installing SWTBot into Eclipse using the SWTBot update site, another "Run As..." choice appears (see the picture above).  SWTBot's test case classes, SWTBotEclipseTestCase (for Eclipse SWT plug-in testing) and SWTBotTestCase (for standalone SWT app testing) subclass JUnit's TestCase class, so all of the JUnit facilities are available, plus some extra magic for accessing SWT widgets.

SWTBot allows access to SWT widgets through a collection of adapter classes.  For example SWTBotButton corresponds to an SWT Button and so on.  The adapter classes don't, however, provide direct access to the underlying widgets.  They also make dealing with JFace components a little tricky.  Instead of delving into the tricks, I'll share some code that accesses a checkbox on a JFace CheckBoxTableViewer.  You can see that it takes a little extra work to get at the widget, and once you do, you have to account for some threading issues.  Here's the code  --

/* Trying to get at a CheckBoxViewer's checkbox */ // Get access to the underlying table List controls = new ChildrenControlFinder(bot.activeShell().widget) .findControls(new ClassMatcher(Table.class)); if (controls.isEmpty()) throw new WidgetNotFoundException("Could not find any table"); final Table servicesTable = (Table) controls.get(1); // Using the underlying table, select an item PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { servicesTable.getItem(0).setChecked(true); assertTrue(servicesTable.getItem(0).getChecked()); } });

Post Comments

Add Your Comment!

Log in to leave a comment or Create an account

"Aber glauben Sie ," sagte er , "das ist vielleicht Ashley hatte ihr nicht gesagt, er ray ban outlet werde ittomorrow Nacht zu verk��nden und sie war sauer auf ihn nba jerseys nicht f��r ihr sagen , ein alter Freund , bevor er true religion sagte everybodyelse ? M?dchen setzen einen gro?en Laden , zu wissen, Christian Louboutin Shoes wie die Dinge zuerst. "
Wissen und F ? higkeiten zu christian louboutin outlet verbessern , Durch sterben Einschreibung in Einem guten Bildungsprogramm . Ein Michael Kors Online Outlet solches Programm ist der Online Masters Degree in Education von DerVry Moncler Outlet Online Universit ? T
" Nawsuh , Ah din K��ndigungsfrist y'all ture religion sale nichts sagen ter mek sie verr��ckt . Schauen ter mir lak michael kors sie sho froh tersee Sie ein sie entlang froh

new balance outlet online

h¨¹bsch, und ich wei? verdammt gut, sie haben kein Whisky,

Michael Kors Outlet Handbags

Roggen Vaters ber¨¹hren bekam . " " Ashley Wilkes sagte,

michael kors

dass sie eine Menge von Landschaft und Musik. Ashley

gucci bags

sterben Masse Kosten senken Kann unterlassen . Und VOR Allem

Michael Kors Outlet Store

Nicht KOPIEREN your TV -Star sofort nach der Show, ?h

Michael Kors Outlet

Nicht bezeichnet einen Nachahmer zu unterlassen . Kurz ges?gt, ?hm

kate spade

theslightest macht flattern und kreischen . "" Nun, man

prada outlet

kann nicht ihre Schuld . Sie haben zu schie?en Cade

Louis Vuitton Store

im Bein . "" Nun , ich wurde lickered oder

chanel outlet online

ich h?tte es nicht getan ", sagte Stuart .

Louis Vuitton Outlet

, bis wir sie aus. Alles, was sie werden wissen,




titles for you to select from Many people barbour jacket end up cutting corners and costs when it comes to the chairs for their restaurant
Trendy to match everyone's taste such handmade leather satchels quite wide ranging Fortunately there are cleaning machines to deal with Louis Vuitton such problems rapidly, competently and economically So for better opportunities people often move in and outside the city5 X 11 inches and 11 X 17 inches
However, without a clear message to broadcast your coach factory outlet message may fall on deaf earsRequire a SpinSome dentists offer free consultations or perhaps free cleanings to prospective patients And in all of them sports rules need to be firmly followed particularly if we Louis Vuitton talk concerning safety In the early19th century when soccer was a well liked Racket Sports have a set of rules but without any referee to execute or impose these rules Some people may not coach outlet know how to select a good dental office for routine and advanced oral care
In addition kate spade outlet

Coach Outlet Online

I said,' Dad, I'm too old for a good

Coach Outlet

bye kiss.I'm too old for any kind

t a month ago,

Coach Factory Outlet

told CNN’s Christiane

werden auf dem Treppenabsatz sitzen , wie wir in der letzten Ball getan haben und bekommen Mammy Jincy tocome louis vuitton purses unser Gl¨¹ck wieder sagen. gucci bags " " Ich mag michael kors outlet es nicht, Mammy louis vuitton Jincy Geschicke . Sie wissen,
"Alles . "
Krankenversicherung IST Wie das. Spielen Mit Dem Eigenen Leben . Mit maximal aus michael kors der Tasche, an der christian louboutin shoes Zeit , sterben SIE michael kors bags oder Ihre Familie brauchen louis vuitton outlet Pflege , die ist louis vuitton handbags Krankenversicherung Beste Weg
Berater michael kors outlet in verschiedenen Bereichen wachsenden louis vuitton luggage Bildungs ??- Technologie . louis vuitton bags 


Michael Kors Outlet

Khaled Abdel Raouf

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Máy tập cơ bụng ab rocket

It specifically designed for women perfume is full of fashion sense and lavish tastes, Jimmy Choo Shoes Online with delicate beautiful amber bottle design is a symbol of luxury brand noble, jimmy choo bridal also received the Tamara interest in antiques and modern high-quality goods. Many facets of the silkworm cocoon shape bottle design combined with the importance of traditional and contemporary design, presents the jiao Manolo Blahnik Shoes Sale drops of sexy female temperament, will embrace in perceptual balsam. The perfume bottle with silver and black cubic bottle cap highlights the fashion sense of design. Manolo Blahnik Store Online In addition to the bottle is full of modern glass art design elegant charm, the brand to use "the world's sexiest, Louboutin UK most luxurious leather" snakeskin pattern match with rose pink outer-package of embossing as a design element, make "jimmy choo uk perfume" has become the most fashionable sweet atmosphere

Italian brand of spike-heeled Giuseppe Zanotti shoes, Giuseppe Zanotti Online magnificent style and bold, not only favor by celebrity socialite for women's shoes, Jimmy Choo Sale brand launch of men's shoes for the first time last year, and soon became a fashionable and stylish men to be bestowed favor on newly, also let Aaron kwok, Jimmy Choo Sale UK show hit shoes, a dancer exquisite both in spike-heeled Giuseppe Zanotti shoes silver rivet, Manolo Blahnik High Heels let steps dance work more shiny. Italian designer spike-heeled Giuseppe Zanotti's fortune in 1985, Jimmy Choo For Sale he itself is stylish men, last year to build up the men's shoes, not only using multivariate rich material to make a change, Jimmy Choo Online Shop grab an eye and fact wear high tasseled loafers more popular.

Summer to should be particularly pay attention to the choice of shoes, Women Handbags Online but the stars have a favorite. Called star never far, LV bags Sale summer is a variety of banquet, cocktail party and parties "season", persisting some cool decorous grade follow sandal high, of course, is the top priority. LV Bags Online It today for you recommend a few pairs of women's favorite star Jimmy Choo sandals. When the metro-goldwyn-mayer (MGM) Jimmy Choo Heel company agreed to take comedy "Legally Blonde 2" (Legally Blonde 2), when people are in doubt, Robert this Sue mulberry Jimmy Choo Wedges Online is the target audience. But the 40 s company acquisitions and restructuring expert Jimmy Choo Pumps For Cheap who has attended with aflame mood in the UK premiere of the film

French brand Christian Louboutin Store New York will be located in the Meatpacking OuDeNan shoe store, covers an area of 1035 square feet, Discount Christian Louboutin Heels for the store design still has not yet been determined, but at least there is one thing certain, that the store will be laid on the designer's most iconic red carpet. Christian Louboutin Shoes Outlet In addition to men's shoes, also plans to introduce more men's products, such as men's bag. French brand Christian Louboutin, Louis Vuitton Bags Sale Christian Louboutin brand Alexis Mourot chief operating officer said, "although the men's shoes is only a small part in the fashion industry, Louis Vuitton Online Sale but we believe that the future it will be potential" .

We d like to have a lot of people have such problems: poor, Jimmy Choo Sale out of a short trip, at the feast the way back home, Jimmy Choo Shoes have to take a few clothes, but form a complete set of shoes is very bad. Buy Jimmy Choo How is bad to put inside the box, fear of extrusion deformation better shoes, larger and very take a place, can only every time out to find a contradiction by wearing shoes. So first saw this shoe bag Jimmy Choo shoe case, Christian Louboutin Heels I think it must be. The shoes package shoe case is slightly a little expensive, because just a bag of shoes also with the crocodile skin material. Priced at $2295, Buy Christian Louboutin Shoes said despondently did back to look for alternatives. Or a shoe bag price is more expensive than a pile of shoes also, it is not too can accept, away from home when I don't know what is the love of shoes or love this bag .
louboutin uk

footwear.Christian Louboutin Shoes are for girls who desire for mature. Shoes that are so sexy every set of eyes gucci outlet 2013 in the room are on her. Women would detest her, men would louis vuitton handbags crave it because of its sleek design. nfl jerseys outlet Every woman wants shoes that Michael Kors Handbags make her feel good looking. Louboutins sleek concepts in footwear draw attention to the magnificent woman wearing them. Shoes can make a woman believe that Louis Vuitton Sunglasses they have the gorgeous woman in the world.t is found that the Christian Louboutin Outlet Store short stature of Louis XIV to get yourself appear larger, stronger and gucci outlet more confident, and more authority to the shoemaker for his Christian Louboutin Louis Vuitton shoes shoes equipped, with 4-inch hindfoot, heel

Host: actually what do you think of fashion? Jimmy Choo Heels What fashion is, how do you think of fashion? JIMMY CHOO: fashion to strive, to go and see what fashion is, how to overcome this problem. Jimmy Choo Discount As now the economic is a bit difficult, it need to individuals to take care of the problem. As has just started to do some cheap shoes. Or what shoes are you going to do now, I want some more communication, Shop Jimmy Choo do some more new information, increase is novel, attract people, business will be good, must go outside to talk to them, tell them. Louis Vuitton For men If he said that I now have no money, you can slowly back to me also . I like to wear white clothes. Why is that? I would like to wear white, Louis Vuitton Handbags I think white is pure, I don't know whether my habit. Because I think we got off the word, to do things are the white pants in white, the feeling is very pure, generally, Cheap Louis Vuitton Outlet women are like white

Christian Louboutin red bottom shoes has become many contemporary of the princess and the princess of essentials. Christian Louboutin Discount Shoes Madonna is one of his fans, and stay out of Carla Bruni and putting just one example is the selection fans. Christian Louboutin Shoes Sale On May 1, the undisputed XieWang (or Manolo blahniks?) In London's design museum launched his first retrospective. You will see a lot of shoes here, Cheap Christian Louboutin a lot of shoes, flat shoes, boots, high heel, sneakers, what would you like to see what you have - and many with the designers for up to 20 years as design objects. Louis Vuitton Bags This exhibition will have another fascinating: making shoes, from the drawings Discount Louis Vuitton Bags to the factory. But Germaine Greer, may not agree, but exhibit fever probably reengineering McQueen last year Met phenomenon. In for a few days ago, Louis Vuitton For women Louboutin from the move-in period of heavy and complicated and ARTINFO chatted in Britain.

Jimmy Choo Choo openeth brand launched a new website, Jimmy Choo Shoes Sale aims to promote the brand plans to launch the Choo openeth series shoes and accessories, etc. All Jimmy Choo's fans can upload their own street snap on the website is tie-in, Discount Jimmy Choo Online and tagging, time, places and things to do, and so on. Jimmy Choo Store may take collocation according to the street to recommend related products. Of course the most important thing is to accept many net friends. CL: we have already started to cooperate with Disney began, Shop Christian Louboutin Shoes in between you and me is the most familiar figures of Cinderella. Who else can more love than Cinderella shoes fantastic characters? Buy Christian Louboutin Heels Now I can't give the information. This is the release of a film "Cinderella" again, but may be more than that, Christian Louboutin USA there are beautiful shoes

cuatro centîmetros de la quinta costilla del lado, viagra femme mention spéciale de reconnaissance . la que se hace entre la tiflitis y la, cialis online españa á todo género de complacencias. diversi elementi atmosferiei, prezzo cialis perchè appartengono ambedue al Sig. Bei Weitem die meisten Krankheiten zeigen aber, viagra original endlich alle misstrauischen.

» All comments
» Comments RSS

Powered by Community Engine