当前位置: 首页>>代码示例>>Java>>正文


Java Status类代码示例

本文整理汇总了Java中org.eclipse.jgit.transport.RemoteRefUpdate.Status的典型用法代码示例。如果您正苦于以下问题:Java Status类的具体用法?Java Status怎么用?Java Status使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Status类属于org.eclipse.jgit.transport.RemoteRefUpdate包,在下文中一共展示了Status类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldShowSuccessWhenPushSucceeds

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void shouldShowSuccessWhenPushSucceeds() throws Exception {
  XulMessageBox message = spy( new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT ) );
  when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
  doReturn( true ).when( uiGit ).hasRemote();
  PushResult result = mock( PushResult.class );
  doReturn( new URIish( "https://test.example.com" ) ).when( result ).getURI();
  RemoteRefUpdate update = mock( RemoteRefUpdate.class );
  when( update.getStatus() ).thenReturn( Status.OK );
  when( result.getRemoteUpdates() ).thenReturn( Arrays.asList( update ) );

  controller.push();
  controller.push( IVCS.TYPE_BRANCH );

  verify( uiGit ).push( "default" );
  verify( uiGit ).push( IVCS.TYPE_BRANCH );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:18,代码来源:GitControllerTest.java

示例2: testPullConflicts

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void testPullConflicts() throws Exception {
	pushOneFileToRemote();

	gitAccess.setRepository(SECOND_LOCAL_TEST_REPOSITORY);
	OptionsManager.getInstance().saveSelectedRepository(SECOND_LOCAL_TEST_REPOSITORY);
	File file = new File(SECOND_LOCAL_TEST_REPOSITORY + "/test.txt");
	file.createNewFile();
	
	PrintWriter out = new PrintWriter(LOCAL_TEST_REPOSITPRY + "/test.txt");
	out.println("teeeeeest");
	out.close();
	
	gitAccess.add(new FileStatus(GitChangeType.ADD, "test.txt"));
	gitAccess.commit("conflict");
	PushResponse pushResponse = gitAccess.push("", "");
	Status pushActual = pushResponse.getStatus();
	Status pushExpected = Status.REJECTED_NONFASTFORWARD;
	assertEquals(pushExpected, pushActual);
	
	PullResponse pullResponse = gitAccess.pull("", "");
	PullStatus pullActual = pullResponse.getStatus();
	PullStatus pullExpected = PullStatus.CONFLICTS;
	assertEquals(pullExpected, pullActual);
}
 
开发者ID:oxygenxml,项目名称:oxygen-git-plugin,代码行数:26,代码来源:GitAccessPullTest.java

示例3: testVisualDiff

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void testVisualDiff() throws Exception {
  XulMessageBox message = spy( new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT ) );
  when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
  UIFile file = new UIFile( "test.txt", ChangeType.MODIFY, true );
  doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
  controller.visualdiff();
  verify( message ).setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) );

  // .ktr
  file = new UIFile( "test.ktr", ChangeType.MODIFY, true );
  doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
  doReturn( new FileInputStream( new File( "src/test/resources/r1.ktr" ) ) ).when( uiGit ).open( "test.ktr", Constants.HEAD );
  doReturn( new FileInputStream( new File( "src/test/resources/r2.ktr" ) ) ).when( uiGit ).open( "test.ktr", IVCS.WORKINGTREE );
  controller.visualdiff();
  verify( uiGit ).open( "test.ktr", Constants.HEAD );
  verify( uiGit ).open( "test.ktr", IVCS.WORKINGTREE );
  verify( controller ).loadMainPerspective();

  // conflicted ktr
  file = new UIFile( "test.kjb.ours", ChangeType.ADD, false );
  File dir = File.createTempFile( "git_test_", "_controller" );
  dir.delete();
  dir.mkdir();
  File ours = new File( dir.getPath(), "test.kjb.ours" );
  File theirs = new File( dir.getPath(), "test.kjb.theirs" );
  FileUtils.copyFile( new File( "src/test/resources/r1.kjb" ), ours );
  FileUtils.copyFile( new File( "src/test/resources/r2.kjb" ), theirs );
  doReturn( dir.getPath() ).when( uiGit ).getDirectory();
  doReturn( Collections.singletonList( file ) ).when( controller ).getSelectedChangedFiles();
  doReturn( new FileInputStream( ours ) ).when( uiGit ).open( "test.kjb.ours", IVCS.WORKINGTREE );
  doReturn( new FileInputStream( theirs ) ).when( uiGit ).open( "test.kjb.theirs", IVCS.WORKINGTREE );
  controller.visualdiff();
  FileUtils.deleteDirectory( dir );
  verify( uiGit ).open( "test.kjb.ours", IVCS.WORKINGTREE );
  verify( uiGit ).open( "test.kjb.theirs", IVCS.WORKINGTREE );
  verify( controller, times( 2 ) ).loadMainPerspective();
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:39,代码来源:GitControllerTest.java

示例4: assertChange

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
public void assertChange(
    Change.Status expectedStatus,
    String expectedTopic,
    List<TestAccount> expectedReviewers,
    List<TestAccount> expectedCcs)
    throws OrmException {
  Change c = getChange().change();
  assertThat(c.getSubject()).isEqualTo(resSubj);
  assertThat(c.getStatus()).isEqualTo(expectedStatus);
  assertThat(Strings.emptyToNull(c.getTopic())).isEqualTo(expectedTopic);
  if (notesMigration.readChanges()) {
    assertReviewers(c, ReviewerStateInternal.REVIEWER, expectedReviewers);
    assertReviewers(c, ReviewerStateInternal.CC, expectedCcs);
  } else {
    assertReviewers(
        c,
        ReviewerStateInternal.REVIEWER,
        Stream.concat(expectedReviewers.stream(), expectedCcs.stream()).collect(toList()));
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:21,代码来源:PushOneCommit.java

示例5: pushChangeTo

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
protected ObjectId pushChangeTo(
    TestRepository<?> repo, String ref, String file, String content, String message, String topic)
    throws Exception {
  ObjectId ret =
      repo.branch("HEAD").commit().insertChangeId().message(message).add(file, content).create();

  String pushedRef = ref;
  if (!topic.isEmpty()) {
    pushedRef += "/" + name(topic);
  }
  String refspec = "HEAD:" + pushedRef;

  Iterable<PushResult> res =
      repo.git().push().setRemote("origin").setRefSpecs(new RefSpec(refspec)).call();

  RemoteRefUpdate u = Iterables.getOnlyElement(res).getRemoteUpdate(pushedRef);
  assertThat(u).isNotNull();
  assertThat(u.getStatus()).isEqualTo(Status.OK);
  assertThat(u.getNewObjectId()).isEqualTo(ret);

  return ret;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:AbstractSubmoduleSubscription.java

示例6: pushChangesTo

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
protected ObjectId pushChangesTo(TestRepository<?> repo, String branch, int numChanges)
    throws Exception {
  for (int i = 0; i < numChanges; i++) {
    repo.branch("HEAD")
        .commit()
        .insertChangeId()
        .message("Message " + i)
        .add(name("file"), "content" + i)
        .create();
  }
  String remoteBranch = "refs/heads/" + branch;
  Iterable<PushResult> res =
      repo.git()
          .push()
          .setRemote("origin")
          .setRefSpecs(new RefSpec("HEAD:" + remoteBranch))
          .call();
  List<Status> status =
      StreamSupport.stream(res.spliterator(), false)
          .map(r -> r.getRemoteUpdate(remoteBranch).getStatus())
          .collect(toList());
  assertThat(status).containsExactly(Status.OK);
  return Iterables.getLast(res).getRemoteUpdate(remoteBranch).getNewObjectId();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:25,代码来源:AbstractSubmoduleSubscription.java

示例7: createAndDeleteBranchByPush

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void createAndDeleteBranchByPush() throws Exception {
  grant(project, "refs/*", Permission.PUSH, true);
  projectIndexedCounter.clear();

  assertThat(getRemoteHead(project.get(), "foo")).isNull();

  PushOneCommit.Result r = pushTo("refs/heads/foo");
  r.assertOkStatus();
  assertThat(getRemoteHead(project.get(), "foo")).isEqualTo(r.getCommit());
  projectIndexedCounter.assertNoReindex();

  PushResult r2 = GitUtil.pushOne(testRepo, null, "refs/heads/foo", false, true, null);
  assertThat(r2.getRemoteUpdate("refs/heads/foo").getStatus()).isEqualTo(Status.OK);
  assertThat(getRemoteHead(project.get(), "foo")).isNull();
  projectIndexedCounter.assertNoReindex();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:18,代码来源:ProjectIT.java

示例8: fastForward

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void fastForward() throws Exception {
  allowTagCreation();
  String tagName = pushTagForExistingCommit(Status.OK);

  fastForwardTagToExistingCommit(tagName, Status.REJECTED_OTHER_REASON);
  fastForwardTagToNewCommit(tagName, Status.REJECTED_OTHER_REASON);

  allowTagDeletion();
  fastForwardTagToExistingCommit(tagName, Status.REJECTED_OTHER_REASON);
  fastForwardTagToNewCommit(tagName, Status.REJECTED_OTHER_REASON);

  allowPushOnRefsTags();
  Status expectedStatus = tagType == ANNOTATED ? Status.REJECTED_OTHER_REASON : Status.OK;
  fastForwardTagToExistingCommit(tagName, expectedStatus);
  fastForwardTagToNewCommit(tagName, expectedStatus);

  allowForcePushOnRefsTags();
  fastForwardTagToExistingCommit(tagName, Status.OK);
  fastForwardTagToNewCommit(tagName, Status.OK);

  removePushFromRefsTags();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:24,代码来源:AbstractPushTag.java

示例9: forceUpdate

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void forceUpdate() throws Exception {
  allowTagCreation();
  String tagName = pushTagForExistingCommit(Status.OK);

  forceUpdateTagToExistingCommit(tagName, Status.REJECTED_OTHER_REASON);
  forceUpdateTagToNewCommit(tagName, Status.REJECTED_OTHER_REASON);

  allowPushOnRefsTags();
  forceUpdateTagToExistingCommit(tagName, Status.REJECTED_OTHER_REASON);
  forceUpdateTagToNewCommit(tagName, Status.REJECTED_OTHER_REASON);

  allowTagDeletion();
  forceUpdateTagToExistingCommit(tagName, Status.REJECTED_OTHER_REASON);
  forceUpdateTagToNewCommit(tagName, Status.REJECTED_OTHER_REASON);

  allowForcePushOnRefsTags();
  forceUpdateTagToExistingCommit(tagName, Status.OK);
  forceUpdateTagToNewCommit(tagName, Status.OK);

  removePushFromRefsTags();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:AbstractPushTag.java

示例10: delete

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void delete() throws Exception {
  allowTagCreation();
  String tagName = pushTagForExistingCommit(Status.OK);

  pushTagDeletion(tagName, Status.REJECTED_OTHER_REASON);

  allowPushOnRefsTags();
  pushTagDeletion(tagName, Status.REJECTED_OTHER_REASON);

  allowForcePushOnRefsTags();
  tagName = pushTagForExistingCommit(Status.OK);
  pushTagDeletion(tagName, Status.OK);

  removePushFromRefsTags();
  allowTagDeletion();
  tagName = pushTagForExistingCommit(Status.OK);
  pushTagDeletion(tagName, Status.OK);
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:20,代码来源:AbstractPushTag.java

示例11: pushToExternalIdsBranch

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void pushToExternalIdsBranch() throws Exception {
  TestRepository<InMemoryRepository> allUsersRepo = cloneProject(allUsers);
  fetch(allUsersRepo, RefNames.REFS_EXTERNAL_IDS + ":" + RefNames.REFS_EXTERNAL_IDS);
  allUsersRepo.reset(RefNames.REFS_EXTERNAL_IDS);

  // different case email is allowed
  ExternalId newExtId = createExternalIdWithOtherCaseEmail("foo:bar");
  addExtId(allUsersRepo, newExtId);
  allUsersRepo.reset(RefNames.REFS_EXTERNAL_IDS);

  List<AccountExternalIdInfo> extIdsBefore = gApi.accounts().self().getExternalIds();

  allowPushOfExternalIds();
  PushResult r = pushHead(allUsersRepo, RefNames.REFS_EXTERNAL_IDS);
  assertThat(r.getRemoteUpdate(RefNames.REFS_EXTERNAL_IDS).getStatus()).isEqualTo(Status.OK);

  List<AccountExternalIdInfo> extIdsAfter = gApi.accounts().self().getExternalIds();
  assertThat(extIdsAfter)
      .containsExactlyElementsIn(
          Iterables.concat(extIdsBefore, ImmutableSet.of(toExternalIdInfo(newExtId))));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:ExternalIdIT.java

示例12: shouldInitializeGitOnAccept

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void shouldInitializeGitOnAccept() throws Exception {
  XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.ACCEPT );
  when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );
  XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
  when( document.createElement( MESSAGEBOX ) ).thenReturn( message );

  controller.initGit( "random-path" );

  verify( uiGit ).initRepo( anyString() );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:12,代码来源:GitControllerTest.java

示例13: shouldNotInitializeGitOnCencel

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void shouldNotInitializeGitOnCencel() throws Exception {
  XulConfirmBox confirm = new XulConfirmBoxMock( XulDialogCallback.Status.CANCEL );
  when( document.createElement( CONFIRMBOX ) ).thenReturn( confirm );

  controller.initGit( "random-path" );

  verify( uiGit, never() ).initRepo( anyString() );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:10,代码来源:GitControllerTest.java

示例14: shouldNotCommitWhenNoStagedObjects

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void shouldNotCommitWhenNoStagedObjects() throws Exception {
  XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
  when( document.createElement( MESSAGEBOX ) ).thenReturn( message );
  doReturn( false ).when( uiGit ).hasStagedFiles();

  controller.commit();

  verify( uiGit, never() ).commit( any(), anyString() );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitControllerTest.java

示例15: shouldCommit

import org.eclipse.jgit.transport.RemoteRefUpdate.Status; //导入依赖的package包/类
@Test
public void shouldCommit() throws Exception {
  XulMessageBox message = new XulMessageBoxMock( XulDialogCallback.Status.ACCEPT );
  when( document.getElementById( MESSAGEBOX ) ).thenReturn( message );
  doReturn( true ).when( uiGit ).hasStagedFiles();

  controller.commit();

  verify( uiGit ).commit( any(), anyString() );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitControllerTest.java


注:本文中的org.eclipse.jgit.transport.RemoteRefUpdate.Status类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。