2

I'm trying to integrate assertJ-swing to a NetBeans project with no Maven. So I downloaded assertj-swing-3.8.0.jar from http://repo1.maven.org/maven2/org/assertj/assertj-swing/3.8.0/ and added it as a Library to NetBeans.

In the test main() I execute my application using:

org.assertj.swing.launcher.ApplicationLauncher.application(STInt_Client.class).start();

and the application fires off correctly. The application pops up 2 JDialog boxes and after pressing OK on both, it creates a new JFrame and calls setVisible(true) on it.

In my test I want to locate that frame programatically, so I do:

FrameFixture chooseModeFrame = findFrame("Frame_ChooseMode").withTimeout(10000).using(robot());

Frame_ChooseMode is the name of the JFrame class. But this line throws an exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/assertj/core/util/Preconditions
    at org.assertj.swing.core.NameMatcher.<init>(NameMatcher.java:83)
    at org.assertj.swing.finder.ComponentFinderTemplate.<init>(ComponentFinderTemplate.java:57)
    at org.assertj.swing.finder.WindowFinderTemplate.<init>(WindowFinderTemplate.java:42)
    at org.assertj.swing.finder.FrameFinder.<init>(FrameFinder.java:40)
    at org.assertj.swing.finder.WindowFinder.findFrame(WindowFinder.java:85)
    at com.stinternational.client.test.Test_GUI.main(Test_GUI.java:107)

Test_GUID.java:107 is my call to findFrame(). Any idea what why this exception is thrown? Thank you in advance.

Dula
  • 1,404
  • 1
  • 14
  • 29

1 Answers1

1

I was missing the assertj core utils jar file. Had to download assertj-core-3.10.0.jar file from here and reference it in the project.

Dula
  • 1,404
  • 1
  • 14
  • 29
  • Note, that these files are versioned. The given links are for those particular versions. Those locations will change with future updates. – Dula Jul 12 '18 at 06:23
  • Thanks for being awesome. I would never have guessed that I was missing a dependency from the error that I had. I have to work from a standalone machine, so I was managing dependencies manually. Easy fix, much appreciated. –  Jul 23 '19 at 17:57