コード例 #1
0
  @Test
  public void shouldPopulatePathList() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR, PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);

    String[] contents = window.list(PATH_LIST_NAME).contents();
    assertThat(contents.length, is(2));
    assertThat(contents[0], is(PATH_JAR));
    assertThat(contents[1], is(PATH_JAR));
  }
コード例 #2
0
  @Test
  public void shouldReturnAllPaths() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR, PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);

    List<String> result = panel.getUserDefinedLibraryPaths();

    assertThat(result.size(), is(2));
    assertThat(result.get(0), is(PATH_JAR));
    assertThat(result.get(1), is(PATH_JAR));
  }
コード例 #3
0
  @Test
  public void shouldRemoveSelectedPositionAfterActioningRemoveButton() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);
    panel.getPathList().setSelectedIndex(0);

    simulateAction(action, event);

    assertThat(window.list(PATH_LIST_NAME).contents().length, is(0));
  }
コード例 #4
0
  @Test
  public void shouldInvokeChangeListenerAfterChangeOfPathListContents() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);
    panel.setUpChangeListeners(aggregatingPanel, listener);
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);
    panel.getPathList().setSelectedIndex(0);

    simulateAction(action, event);

    verifyChangeListenerInvokedForCurrentConfigurationState();
  }
コード例 #5
0
  @Test
  public void shouldRemoveSelectedPositionAfterActioningRemoveButton() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);
    panel.getPathList().setSelectedIndex(0);

    execute(
        new GuiTask() {
          @Override
          protected void executeInEDT() throws Throwable {
            action.actionPerformed(event);
          }
        });

    assertThat(window.list(PATH_LIST_NAME).contents().length, is(0));
  }
コード例 #6
0
  @Test
  public void shouldInvokeChangeListenerAfterChangeOfPathListContents() {
    cfg.USER_DEFINED_LIBRARY_PATHS = asList(PATH_JAR);
    setUpPanelWithUserLibrary(ENABLED);
    panel.setUpChangeListeners(aggregatingPanel, listener);
    final AnActionButton action = getAnActionButton(REMOVE);
    final AnActionEvent event = new TestActionEvent(action);
    panel.getPathList().setSelectedIndex(0);

    execute(
        new GuiTask() {
          @Override
          protected void executeInEDT() throws Throwable {
            action.actionPerformed(event);
          }
        });

    verifyChangeListenerInvokedForCurrentConfigurationState();
  }
コード例 #7
0
 public void updateConfigurationWithChanges(XQueryDataSourceConfiguration currentConfiguration) {
   currentConfiguration.USER_DEFINED_LIBRARY_ENABLED = isUserDefinedLibraryEnabled();
   currentConfiguration.USER_DEFINED_LIBRARY_PATHS = getUserDefinedLibraryPaths();
 }