Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. public class JavaApp extends FestSwingTestCaseTemplate {
  2.  
  3.  
  4.  
  5. public static void main(String[] args)
  6. {
  7. FailOnThreadViolationRepaintManager.install();
  8. HTMLDocumentEditor frame = GuiActionRunner.execute(new GuiQuery<HTMLDocumentEditor>() {
  9. protected HTMLDocumentEditor executeInEDT() {
  10. return new HTMLDocumentEditor();
  11. }
  12. });
  13.  
  14. FrameFixture window = new FrameFixture(frame);
  15. window.show(); // shows the frame to test
  16. ApplicationLauncher.application(HTMLDocumentEditor.class);
  17. window.menuItemWithPath("File", "Open").click();
  18. JavaApp app = new JavaApp();
  19. app.testFile();
  20.  
  21.  
  22. }
  23.  
  24. public void testFile()
  25. {
  26. JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser().using(robot());
  27. fileChooser.setCurrentDirectory(Files.temporaryFolder()).selectFile(new File("htmleditor.html")).approve();
  28. }
  29.  
  30.  
  31. Exception in thread "main" java.lang.NullPointerException
  32. at org.fest.swing.finder.ComponentFinderTemplate.findComponentWith(ComponentFinderTemplate.java:88)
  33. at org.fest.swing.finder.JFileChooserFinder.using(JFileChooserFinder.java:122)
  34. at org.fest.demo.JavaApp.testFile(JavaApp.java:63)
  35. at org.fest.demo.JavaApp.main(JavaApp.java:56)
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement