1

I'd like to test GUI client with fest-swing but... The client based on custom layer which wrapps swing components. The problem is that my custom gui components do not inherite from swing components but are composed from them (the author of the layer prefered composition over inheritance).

So now I am able to write a test using fest-swing, the test starts the client but I cannot refer to any Frame, Component, Dialog, Window because my ui components are not subclasses of standard swing/awt components. I got stuck here. I am now reading fest-swing code and it seems that I cannot use this lib in my case bacuase fest-swing use generalization with subtyping (inheritance) :(

Any one of you faced this problem? Any hinst?

StanislavL
  • 56,971
  • 9
  • 68
  • 98
Marcin Sanecki
  • 1,324
  • 3
  • 19
  • 35
  • I have found out that this was not the real problem. I wanted to find a special GUI Element by type what is actually not a good idea if you work with complex GUI layer. I got back to documentation and found out the the preferable way is to look for components by name. Then composition is no more a problem at all. – Marcin Sanecki Jan 25 '13 at 09:40

1 Answers1

2

Have you read the documentation article about creating a new Fixture for your onw GUI-Component?

Cite of Chapter 2. of the article:

If the custom GUI component does not extend any JDK Swig component, or if you prefer to create a FEST fixture from scratch, please read the following: Extend ComponentFixture. This class provides all the necessary wiring of a GUI component to test and a Robot. It also provides some very basic functionality and convenience methods.

I did not try this, but this should help you fixing your problem.

Simulant
  • 19,190
  • 8
  • 63
  • 98
  • Thanks for your hint. I am new in fest-swing. I have just started studing documentation and source code of fest-swing deeper to actually understand what kind of possibilities are there. I am impressed! – Marcin Sanecki Dec 25 '12 at 08:41