fest-swing and wrappers for swing/awt components

499 Views Asked by At

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?

1

There are 1 best solutions below

1
On

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.