當前位置: 首頁>>代碼示例>>Java>>正文


Java InheritableBoolean類代碼示例

本文整理匯總了Java中com.google.gerrit.extensions.client.InheritableBoolean的典型用法代碼示例。如果您正苦於以下問題:Java InheritableBoolean類的具體用法?Java InheritableBoolean怎麽用?Java InheritableBoolean使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InheritableBoolean類屬於com.google.gerrit.extensions.client包,在下文中一共展示了InheritableBoolean類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: submitChainOneByOneManualRebase

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
@TestProjectInput(useContentMerge = InheritableBoolean.TRUE)
public void submitChainOneByOneManualRebase() throws Exception {
  RevCommit initialHead = getRemoteHead();
  PushOneCommit.Result change1 = createChange("subject 1", "fileName 1", "content 1");
  PushOneCommit.Result change2 = createChange("subject 2", "fileName 2", "content 2");

  // for rebase if necessary, otherwise, the manual rebase of change2 will
  // fail since change1 would be merged as fast forward
  testRepo.reset(initialHead);
  PushOneCommit.Result change = createChange();
  submit(change.getChangeId());

  submit(change1.getChangeId());
  // Do manual rebase first.
  gApi.changes().id(change2.getChangeId()).current().rebase();
  submit(change2.getChangeId());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:19,代碼來源:AbstractSubmitByRebase.java

示例2: submitWithFastForward

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
@TestProjectInput(useContentMerge = InheritableBoolean.TRUE)
public void submitWithFastForward() throws Exception {
  RevCommit oldHead = getRemoteHead();
  PushOneCommit.Result change = createChange();
  submit(change.getChangeId());
  RevCommit head = getRemoteHead();
  assertThat(head.getId()).isEqualTo(change.getCommit());
  assertThat(head.getParent(0)).isEqualTo(oldHead);
  assertApproved(change.getChangeId());
  assertCurrentRevision(change.getChangeId(), 1, head);
  assertSubmitter(change.getChangeId(), 1);
  assertPersonEquals(admin.getIdent(), head.getAuthorIdent());
  assertPersonEquals(admin.getIdent(), head.getCommitterIdent());
  assertRefUpdatedEvents(oldHead, head);
  assertChangeMergedEvents(change.getChangeId(), head.name());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:18,代碼來源:SubmitByRebaseIfNecessaryIT.java

示例3: pushSameCommitTwice

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void pushSameCommitTwice() throws Exception {
  ProjectConfig config = projectCache.checkedGet(project).getConfig();
  config.getProject().setCreateNewChangeForAllNotInTarget(InheritableBoolean.TRUE);
  saveProjectConfig(project, config);

  PushOneCommit push =
      pushFactory.create(
          db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content");
  PushOneCommit.Result r = push.to("refs/for/master");
  r.assertOkStatus();

  push =
      pushFactory.create(
          db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent");
  r = push.to("refs/for/master");
  r.assertOkStatus();

  assertPushRejected(
      pushHead(testRepo, "refs/for/master", false),
      "refs/for/master",
      "commit(s) already exists (as current patchset)");
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:24,代碼來源:AbstractPushForReview.java

示例4: pushSameCommitTwiceWhenIndexFailed

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void pushSameCommitTwiceWhenIndexFailed() throws Exception {
  ProjectConfig config = projectCache.checkedGet(project).getConfig();
  config.getProject().setCreateNewChangeForAllNotInTarget(InheritableBoolean.TRUE);
  saveProjectConfig(project, config);

  PushOneCommit push =
      pushFactory.create(
          db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content");
  PushOneCommit.Result r = push.to("refs/for/master");
  r.assertOkStatus();

  push =
      pushFactory.create(
          db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent");
  r = push.to("refs/for/master");
  r.assertOkStatus();

  indexer.delete(r.getChange().getId());

  assertPushRejected(
      pushHead(testRepo, "refs/for/master", false),
      "refs/for/master",
      "commit(s) already exists (as current patchset)");
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:26,代碼來源:AbstractPushForReview.java

示例5: pushTwoCommitWithSameChangeId

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void pushTwoCommitWithSameChangeId() throws Exception {
  RevCommit commitChange1 = createCommitWithChangeId(testRepo, "some change");

  createCommit(testRepo, commitChange1.getFullMessage());

  pushForReviewRejected(
      testRepo,
      "same Change-Id in multiple changes.\n"
          + "Squash the commits with the same Change-Id or ensure Change-Ids are unique for each"
          + " commit");

  ProjectConfig config = projectCache.checkedGet(project).getConfig();
  config.getProject().setRequireChangeID(InheritableBoolean.FALSE);
  saveProjectConfig(project, config);

  pushForReviewRejected(
      testRepo,
      "same Change-Id in multiple changes.\n"
          + "Squash the commits with the same Change-Id or ensure Change-Ids are unique for each"
          + " commit");
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:23,代碼來源:AbstractPushForReview.java

示例6: setPartialConfig

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void setPartialConfig() throws Exception {
  ConfigInput input = createTestConfigInput();
  ConfigInfo info = gApi.projects().name(project.get()).config(input);

  ConfigInput partialInput = new ConfigInput();
  partialInput.useContributorAgreements = InheritableBoolean.FALSE;
  info = gApi.projects().name(project.get()).config(partialInput);

  assertThat(info.description).isNull();
  assertThat(info.useContributorAgreements.configuredValue)
      .isEqualTo(partialInput.useContributorAgreements);
  assertThat(info.useContentMerge.configuredValue).isEqualTo(input.useContentMerge);
  assertThat(info.useSignedOffBy.configuredValue).isEqualTo(input.useSignedOffBy);
  assertThat(info.createNewChangeForAllNotInTarget.configuredValue)
      .isEqualTo(input.createNewChangeForAllNotInTarget);
  assertThat(info.requireChangeId.configuredValue).isEqualTo(input.requireChangeId);
  assertThat(info.rejectImplicitMerges.configuredValue).isEqualTo(input.rejectImplicitMerges);
  assertThat(info.enableReviewerByEmail.configuredValue).isEqualTo(input.enableReviewerByEmail);
  assertThat(info.createNewChangeForAllNotInTarget.configuredValue)
      .isEqualTo(input.createNewChangeForAllNotInTarget);
  assertThat(info.maxObjectSizeLimit.configuredValue).isEqualTo(input.maxObjectSizeLimit);
  assertThat(info.submitType).isEqualTo(input.submitType);
  assertThat(info.state).isEqualTo(input.state);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:26,代碼來源:ProjectIT.java

示例7: createTestConfigInput

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
private ConfigInput createTestConfigInput() {
  ConfigInput input = new ConfigInput();
  input.description = "some description";
  input.useContributorAgreements = InheritableBoolean.TRUE;
  input.useContentMerge = InheritableBoolean.TRUE;
  input.useSignedOffBy = InheritableBoolean.TRUE;
  input.createNewChangeForAllNotInTarget = InheritableBoolean.TRUE;
  input.requireChangeId = InheritableBoolean.TRUE;
  input.rejectImplicitMerges = InheritableBoolean.TRUE;
  input.enableReviewerByEmail = InheritableBoolean.TRUE;
  input.createNewChangeForAllNotInTarget = InheritableBoolean.TRUE;
  input.maxObjectSizeLimit = "5m";
  input.submitType = SubmitType.CHERRY_PICK;
  input.state = ProjectState.HIDDEN;
  return input;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:17,代碼來源:ProjectIT.java

示例8: revertChangeWithoutCLA

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void revertChangeWithoutCLA() throws Exception {
  assume().that(isContributorAgreementsEnabled()).isTrue();

  // Create a change succeeds when agreement is not required
  setUseContributorAgreements(InheritableBoolean.FALSE);
  ChangeInfo change = gApi.changes().create(newChangeInput()).get();

  // Approve and submit it
  setApiUser(admin);
  gApi.changes().id(change.changeId).current().review(ReviewInput.approve());
  gApi.changes().id(change.changeId).current().submit(new SubmitInput());

  // Revert is not allowed when CLA is required but not signed
  setApiUser(user);
  setUseContributorAgreements(InheritableBoolean.TRUE);
  exception.expect(AuthException.class);
  exception.expectMessage("A Contributor Agreement must be completed");
  gApi.changes().id(change.changeId).revert();
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:21,代碼來源:AgreementsIT.java

示例9: createChangeRespectsCLA

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void createChangeRespectsCLA() throws Exception {
  assume().that(isContributorAgreementsEnabled()).isTrue();

  // Create a change succeeds when agreement is not required
  setUseContributorAgreements(InheritableBoolean.FALSE);
  gApi.changes().create(newChangeInput());

  // Create a change is not allowed when CLA is required but not signed
  setUseContributorAgreements(InheritableBoolean.TRUE);
  try {
    gApi.changes().create(newChangeInput());
    fail("Expected AuthException");
  } catch (AuthException e) {
    assertThat(e.getMessage()).contains("A Contributor Agreement must be completed");
  }

  // Sign the agreement
  gApi.accounts().self().signAgreement(caAutoVerify.getName());

  // Explicitly reset the user to force a new request context
  setApiUser(user);

  // Create a change succeeds after signing the agreement
  gApi.changes().create(newChangeInput());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:27,代碼來源:AgreementsIT.java

示例10: addReviewerThatIsInactiveEmailFallback

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void addReviewerThatIsInactiveEmailFallback() throws Exception {
  assume().that(notesMigration.readChanges()).isTrue();

  ConfigInput conf = new ConfigInput();
  conf.enableReviewerByEmail = InheritableBoolean.TRUE;
  gApi.projects().name(project.get()).config(conf);

  PushOneCommit.Result result = createChange();

  String username = "[email protected]";
  gApi.accounts().create(username).setActive(false);

  AddReviewerInput in = new AddReviewerInput();
  in.reviewer = username;
  in.state = ReviewerState.CC;
  AddReviewerResult r = gApi.changes().id(result.getChangeId()).addReviewer(in);

  assertThat(r.input).isEqualTo(username);
  assertThat(r.error).isNull();
  // When adding by email, the reviewers field is also empty because we can't
  // render a ReviewerInfo object for a non-account.
  assertThat(r.reviewers).isNull();
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:25,代碼來源:ChangeIT.java

示例11: changeCommitMessageWithNoChangeIdSucceedsIfChangeIdNotRequired

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void changeCommitMessageWithNoChangeIdSucceedsIfChangeIdNotRequired() throws Exception {
  ConfigInput configInput = new ConfigInput();
  configInput.requireChangeId = InheritableBoolean.FALSE;
  gApi.projects().name(project.get()).config(configInput);

  PushOneCommit.Result r = createChange();
  r.assertOkStatus();
  assertThat(getCommitMessage(r.getChangeId()))
      .isEqualTo("test commit\n\nChange-Id: " + r.getChangeId() + "\n");

  String newMessage = "modified commit\n";
  gApi.changes().id(r.getChangeId()).setMessage(newMessage);
  RevisionApi rApi = gApi.changes().id(r.getChangeId()).current();
  assertThat(rApi.files().keySet()).containsExactly("/COMMIT_MSG", "a.txt");
  assertThat(getCommitMessage(r.getChangeId())).isEqualTo(newMessage);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:18,代碼來源:ChangeIT.java

示例12: authorAndCommitDateAreEqual

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void authorAndCommitDateAreEqual() throws Exception {
  assume().that(getSubmitType()).isNotEqualTo(SubmitType.FAST_FORWARD_ONLY);

  ConfigInput ci = new ConfigInput();
  ci.matchAuthorToCommitterDate = InheritableBoolean.TRUE;
  gApi.projects().name(project.get()).config(ci);

  RevCommit initialHead = getRemoteHead();
  testRepo.reset(initialHead);
  PushOneCommit.Result change = createChange("Change 1", "b", "b");

  testRepo.reset(initialHead);
  PushOneCommit.Result change2 = createChange("Change 2", "c", "c");

  if (getSubmitType() == SubmitType.MERGE_IF_NECESSARY
      || getSubmitType() == SubmitType.REBASE_IF_NECESSARY) {
    // Merge another change so that change2 is not a fast-forward
    submit(change.getChangeId());
  }

  submit(change2.getChangeId());
  assertAuthorAndCommitDateEquals(getRemoteHead());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:25,代碼來源:AbstractSubmit.java

示例13: submitWithPossibleFastForward

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
@TestProjectInput(useContentMerge = InheritableBoolean.TRUE)
public void submitWithPossibleFastForward() throws Exception {
  RevCommit oldHead = getRemoteHead();
  PushOneCommit.Result change = createChange();
  submit(change.getChangeId());

  RevCommit head = getRemoteHead();
  assertThat(head.getId()).isNotEqualTo(change.getCommit());
  assertThat(head.getParent(0)).isEqualTo(oldHead);
  assertApproved(change.getChangeId());
  assertCurrentRevision(change.getChangeId(), 2, head);
  assertSubmitter(change.getChangeId(), 1);
  assertSubmitter(change.getChangeId(), 2);
  assertPersonEquals(admin.getIdent(), head.getAuthorIdent());
  assertPersonEquals(admin.getIdent(), head.getCommitterIdent());
  assertRefUpdatedEvents(oldHead, head);
  assertChangeMergedEvents(change.getChangeId(), head.name());
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:SubmitByRebaseAlwaysIT.java

示例14: alwaysAddFooters

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
@TestProjectInput(useContentMerge = InheritableBoolean.TRUE)
public void alwaysAddFooters() throws Exception {
  PushOneCommit.Result change1 = createChange();
  PushOneCommit.Result change2 = createChange();

  assertThat(getCurrentCommit(change1).getFooterLines(FooterConstants.REVIEWED_BY)).isEmpty();
  assertThat(getCurrentCommit(change2).getFooterLines(FooterConstants.REVIEWED_BY)).isEmpty();

  // change1 is a fast-forward, but should be rebased in cherry pick style
  // anyway, making change2 not a fast-forward, requiring a rebase.
  approve(change1.getChangeId());
  submit(change2.getChangeId());
  // ... but both changes should get reviewed-by footers.
  assertLatestRevisionHasFooters(change1);
  assertLatestRevisionHasFooters(change2);
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:18,代碼來源:SubmitByRebaseAlwaysIT.java

示例15: rejectWhenFeatureIsDisabled

import com.google.gerrit.extensions.client.InheritableBoolean; //導入依賴的package包/類
@Test
public void rejectWhenFeatureIsDisabled() throws Exception {
  assume().that(notesMigration.readChanges()).isTrue();

  ConfigInput conf = new ConfigInput();
  conf.enableReviewerByEmail = InheritableBoolean.FALSE;
  gApi.projects().name(project.get()).config(conf);

  PushOneCommit.Result r = createChange();

  AddReviewerResult result =
      gApi.changes().id(r.getChangeId()).addReviewer("Foo Bar <[email protected]>");
  assertThat(result.error)
      .isEqualTo(
          "Foo Bar <[email protected]> does not identify a registered user or group");
  assertThat(result.reviewers).isNull();
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:18,代碼來源:ChangeReviewersByEmailIT.java


注:本文中的com.google.gerrit.extensions.client.InheritableBoolean類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。