Changeset 32693

Show
Ignore:
Timestamp:
16.12.2018 20:24:15 (3 months ago)
Author:
ak19
Message:

Some cleanup and shifting commented out useful code about

Location:
gs3-extensions/testing/trunk/src/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/testing/trunk/src/src/gstests/tutorials/RunGLITest.java

    r32692 r32693  
    2323API: 
    2424https://joel-costigliola.github.io/assertj/swing/api/index.html 
     25 
     26JUNIT: 
     27- https://junit.org/junit4/faq.html#atests_2 
     28   How do I use a test fixture? 
     29- https://junit.org/junit4/faq.html#organize_3 
     30   How can I run setUp() and tearDown() code once for all of my tests? 
     31 
    2532*/ 
    2633 
     
    121128      String expectedWindowTitle = Gatherer.PROGRAM_NAME; 
    122129 
    123     
    124       // https://joel-costigliola.github.io/assertj/assertj-swing-launch.html       
    125       /*window = findFrame(new GenericTypeMatcher<JFrame>(JFrame.class) { 
    126           protected boolean isMatching(JFrame window) { 
    127           return window.getTitle().trim().startsWith(expectedWindowTitle) 
    128           && window.isShowing(); 
    129           } 
    130       }).using(robot()); 
    131       */ 
    132  
    133130      window = findFrame("GUIManager").using(robot()); 
    134131         
     
    137134 
    138135    System.err.println("@@@ Second test: that Gather panel is selected and has right title"); 
    139      
    140     /*GenericTypeMatcher<JTabbedPane> textMatcher = new GenericTypeMatcher<JTabbedPane>(JTabbedPane.class) { 
    141         @Override protected boolean isMatching(JTabbedPane tabPane) { 
    142             int index = GuiActionRunner.execute(() -> tabPane.getSelectedIndex()); 
    143             //int index = tabPane.getSelectedIndex(); 
    144             String selectedTabTitle = GuiActionRunner.execute(() -> tabPane.getTitleAt(index)); 
    145             System.err.println("### GOT TITLE: " + selectedTabTitle); 
    146             return gatherPaneLabel.equals(selectedTabTitle); 
    147         } 
    148         }; 
    149     */ 
    150136 
    151137    JTabbedPaneFixture tab = window.tabbedPane("GUIManager.tab_pane"); 
    152     /* 
    153     JTabbedPaneFixture tab = window.tabbedPane(new GenericTypeMatcher<JTabbedPane>(JTabbedPane.class) { 
    154         @Override protected boolean isMatching(JTabbedPane tabPane) { 
    155             System.err.println("### trying for match"); 
    156             //int index = GuiActionRunner.execute(() -> tabPane.getSelectedIndex()); 
    157             int index = tabPane.getSelectedIndex(); 
    158             String selectedTabTitle = tabPane.getTitleAt(index); //GuiActionRunner.execute(() -> tabPane.getTitleAt(index)); 
    159             System.err.println("### GOT TITLE: " + selectedTabTitle); 
    160             return gatherPaneLabel.equals(selectedTabTitle); 
    161         } 
    162         }); 
    163     */ 
     138 
    164139     
    165140    tab.requireSelectedTab(Index.atIndex(1)); 
  • gs3-extensions/testing/trunk/src/src/org/greenstone/gsdl3/testing/GSGUITestingUtil.java

    r32692 r32693  
    110110    } 
    111111 
     112    // Moving these working bits of code here, in case I can use them to right 
     113    // general get methods that make use of the GenericTypeMatcher method of accessing components 
     114    // See https://joel-costigliola.github.io/assertj/assertj-swing-lookup.html 
     115 
     116    /*window = findFrame(new GenericTypeMatcher<JFrame>(JFrame.class) { 
     117          protected boolean isMatching(JFrame window) { 
     118          return window.getTitle().trim().startsWith(expectedWindowTitle) 
     119          && window.isShowing(); 
     120          } 
     121      }).using(robot()); 
     122      */ 
     123    /* 
     124    JTabbedPaneFixture tab = window.tabbedPane(new GenericTypeMatcher<JTabbedPane>(JTabbedPane.class) { 
     125        @Override protected boolean isMatching(JTabbedPane tabPane) { 
     126            System.err.println("### trying for match"); 
     127            //int index = GuiActionRunner.execute(() -> tabPane.getSelectedIndex()); 
     128            int index = tabPane.getSelectedIndex(); 
     129            String selectedTabTitle = tabPane.getTitleAt(index); //GuiActionRunner.execute(() -> tabPane.getTitleAt(index)); 
     130            System.err.println("### GOT TITLE: " + selectedTabTitle); 
     131            return gatherPaneLabel.equals(selectedTabTitle); 
     132        } 
     133        }); 
     134    */ 
    112135}