Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.PushOperation.run()


        operation.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
            credentials.getUser(), credentials.getPassword()));
      getContainer().run(true, true, new IRunnableWithProgress() {
        public void run(IProgressMonitor monitor)
            throws InvocationTargetException, InterruptedException {
          operation.run(monitor);
        }
      });
    } catch (final IOException e) {
      setErrorMessage(NLS.bind(
          UIText.ConfirmationPage_errorCantResolveSpecs, e
View Full Code Here


  @Test
  public void testPush() throws Exception {

    // push from repository1 to repository2
    PushOperation pop = createPushOperation();
    pop.run(new NullProgressMonitor());
    assertEquals(Status.UP_TO_DATE, getStatus(pop.getOperationResult()));

    // let's add a new file to the project shared with repository1
    IProject proj = importProject(repository1, projectName);
    ArrayList<IFile> files = new ArrayList<IFile>();
View Full Code Here

    cop.execute(null);

    proj.delete(false, false, null);

    pop = createPushOperation();
    pop.run(null);
    assertEquals(Status.OK, getStatus(pop.getOperationResult()));

    try {
      // assert that we cannot run this again
      pop.run(null);
View Full Code Here

    pop.run(null);
    assertEquals(Status.OK, getStatus(pop.getOperationResult()));

    try {
      // assert that we cannot run this again
      pop.run(null);
      fail("Expected Exception not thrown");
    } catch (IllegalStateException e) {
      // expected
    }
View Full Code Here

    } catch (IllegalStateException e) {
      // expected
    }

    pop = createPushOperation();
    pop.run(null);
    assertEquals(Status.UP_TO_DATE, getStatus(pop.getOperationResult()));

    String newFilePath = newFile.getFullPath().toOSString();

    File testFile = new File(workdir2, newFilePath);
View Full Code Here

    ILog log = Activator.getDefault().getLog();
    LogListener listener = new LogListener();
    log.addLogListener(listener);

    PushOperation pop = createInvalidPushOperation();
    pop.run(new NullProgressMonitor());
    PushOperationResult result = pop.getOperationResult();
    String errorMessage = result.getErrorMessage(new URIish(INVALID_URI));
    assertNotNull(errorMessage);
    assertTrue(errorMessage.contains(INVALID_URI));
View Full Code Here

    refUpdates.add(update);
    spec.addURIRefUpdates(remote, refUpdates);

    PushOperation pop = new PushOperation(repository1.getRepository(),
        spec, false, 0);
    pop.run(null);

    pop = new PushOperation(repository1.getRepository(), spec, false, 0);
    try {
      pop.run(null);
      fail("Expected Exception not thrown");
View Full Code Here

        spec, false, 0);
    pop.run(null);

    pop = new PushOperation(repository1.getRepository(), spec, false, 0);
    try {
      pop.run(null);
      fail("Expected Exception not thrown");
    } catch (IllegalStateException e) {
      // expected
    }
  }
View Full Code Here

    PushOperationSpecification spec = new PushOperationSpecification();
    spec.addURIRefUpdates(remote, Arrays.asList(update));

    PushOperation push = new PushOperation(repository2.getRepository(),
        spec, false, 0);
    push.run(null);

    PushOperationResult result = push.getOperationResult();
    PushResult pushResult = result.getPushResult(remote);
    assertNotNull("Expected result to have tracking ref update", pushResult.getTrackingRefUpdate(trackingRef));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.