Package org.eclipse.jgit.events

Examples of org.eclipse.jgit.events.ListenerHandle


    writeLooseRef("refs/heads/my/a+b", A);
    writeLooseRef("refs/heads/my/a/b/c", B);

    final int[] count = new int[1];

    ListenerHandle listener = Repository.getGlobalListenerList()
        .addRefsChangedListener(new RefsChangedListener() {

          public void onRefsChanged(RefsChangedEvent event) {
            count[0]++;
          }
        });

    refs = refdir.getRefs(RefDatabase.ALL);
    refs = refdir.getRefs(RefDatabase.ALL);
    listener.remove();
    assertEquals(1, count[0]); // Bug 348834 multiple RefsChangedEvents
    assertEquals(2, refs.size());
    assertEquals(A, refs.get("refs/heads/my/a+b").getObjectId());
    assertEquals(B, refs.get("refs/heads/my/a/b/c").getObjectId());
View Full Code Here


    new ConfigChangedListener() {
      public void onConfigChanged(ConfigChangedEvent event) {
        changed.set(true);
      }
    };
    ListenerHandle handle = repo.getConfig().addChangeListener(listener);
    // only now click ok
    configureBranchDialog.bot().button("OK").click();

    // cleanup behind ourselves
    handle.remove();
    if (!changed.get())
      fail("We should have received a config change event");

    rebase = repo.getConfig().getBoolean(
        ConfigConstants.CONFIG_BRANCH_SECTION, "configTest",
View Full Code Here

    };
    control.addDisposeListener(disposeListener);
  }

  private void removeListener() {
    final ListenerHandle handle = listenerHandle;
    if (handle != null)
      handle.remove();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.events.ListenerHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.