I am trying to make a simple test after the Fest Tutorial for a JFrame, JButton.
Here's my code:
private FrameFixture window;
@Before
public void setUp() {
MyMainFrame myMainFrame = GuiActionRunner.execute(new GuiQuery<MyMainFrame>(){
protected MyMainFrame executeInEDT()
{
return new MyMainFrame();
}
});
window = new FrameFixture(myMainFrame);
window.show();
}
No matter what i do, the code crushes (casues error) at the creation of the FrameFixture; I even tried to replace myMainFrame with new JFrame.
errors i get:
org/fest/reflect/exception/ReflectionError
java.lang.NoClassDefFoundError
at org.fest.swing.input.InputState.<init>(InputState.java:42)
at org.fest.swing.fixture.WindowFixture.<init>(WindowFixture.java:103)
at org.fest.swing.fixture.FrameFixture.<init>(FrameFixture.java:49)
at javatestgui.MainFrameTest.setUp(MainFrameTest.java:48)
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
and
Could not initialize class org.fest.swing.core.BasicRobot
java.lang.NoClassDefFoundError
at org.fest.swing.fixture.WindowFixture.<init>(WindowFixture.java:103)
at org.fest.swing.fixture.FrameFixture.<init>(FrameFixture.java:49)
at javatestgui.MainFrameTest.setUp(MainFrameTest.java:48)
Any help what's going wring?
You Need to add all the Jars inside the folder fest-swing ,
fest-swing-1.2.jar lib/fest-assert-1.2.jar lib/fest-reflect-1.2.jar lib/fest-util-1.1.2.jar lib/jcip-annotations-1.0.jar