本文整理汇总了Java中jetbrains.buildServer.vcs.SVcsModification类的典型用法代码示例。如果您正苦于以下问题:Java SVcsModification类的具体用法?Java SVcsModification怎么用?Java SVcsModification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVcsModification类属于jetbrains.buildServer.vcs包,在下文中一共展示了SVcsModification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: populateCommits
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private void populateCommits(SRunningBuild sRunningBuild) {
List<SVcsModification> changes = sRunningBuild.getContainingChanges();
if(changes == null){
return;
}
for(SVcsModification change : changes){
Collection<SUser> committers = change.getCommitters();
String msteamsUserName = null;
if(committers != null && !committers.isEmpty()){
SUser committer = committers.iterator().next();
msteamsUserName = committer.getPropertyValue(MsTeamsNotificator.USERNAME_KEY);
Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to MsTeams User " + msteamsUserName);
}
commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), msteamsUserName));
}
}
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:18,代码来源:MsTeamsNotificationPayloadContent.java
示例2: triggerCulpritFinding
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private void triggerCulpritFinding(List<SVcsModification> changesBetweenBuilds)
{
List<SVcsModification> suspectChanges = new ArrayList<SVcsModification>(changesBetweenBuilds);
suspectChanges.remove(0);
Collections.reverse(suspectChanges);
BuildCustomizer buildCustomizer = buildCustomizerFactory.createBuildCustomizer(newBuild.getBuildType(), null);
for (SVcsModification change : suspectChanges) {
Loggers.SERVER.info("[SinCity] Queueing change '" + change + "' having failed build " + newBuild);
Map<String, String> buildParameters = getCommonBuildParameters();
buildParameters.put(new ParameterNames().getSincitySuspectChange(), change.getVersion());
buildCustomizer.setParameters(buildParameters);
buildCustomizer.setChangesUpTo(change);
SQueuedBuild queuedBuild = buildCustomizer.createPromotion().addToQueue(
triggeredBy + "; investigating failures between " + (oldBuild == null ? "the Big Bang" : oldBuild.getBuildNumber()) + " and " + newBuild.getBuildNumber());
if (putBuildsToQueueTop)
moveBuildBeyondAllCulpritFindingBuilds(queuedBuild);
}
}
开发者ID:sferencik,项目名称:SinCity,代码行数:25,代码来源:CulpritFinder.java
示例3: test01NoOutstandingFailures
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
@Test
public void test01NoOutstandingFailures() {
/* No failures in the last build, no table. */
// arrange
mockery.checking(new Expectations() {{
allowing(buildGood).getTestMessages(0, -1); will(returnValue(Collections.emptyList()));
}});
// act
Table culpritTable = Analyser.createCulpritMatrix(Collections.singletonList(
new FinishedBuildWithChanges(buildGood, change0, Collections.<SVcsModification>emptyList())));
// assert
assertThat(culpritTable.getNumberOfColumns(), is(0));
assertThat(culpritTable.getNumberOfRows(), is(0));
}
开发者ID:sferencik,项目名称:SinCity,代码行数:18,代码来源:AnalyserTest.java
示例4: SetUp
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
@BeforeMethod
public void SetUp() {
mockery = new Mockery();
buildType = mockery.mock(SBuildType.class, "BuildType");
build1 = mockery.mock(SFinishedBuild.class, "Build1");
build2 = mockery.mock(SFinishedBuild.class, "Build2");
build3 = mockery.mock(SFinishedBuild.class, "Build3");
buildHistory = new ArrayList<SFinishedBuild>();
buildHistory.add(build3);
buildHistory.add(build2);
buildHistory.add(build1);
change1 = mockery.mock(SVcsModification.class, "change1");
change2 = mockery.mock(SVcsModification.class, "change2");
change3 = mockery.mock(SVcsModification.class, "change3");
change4 = mockery.mock(SVcsModification.class, "change4");
mockery.checking(new Expectations() {{
oneOf(buildType).getHistory(null, true, true); will(returnValue(buildHistory));
oneOf(build1).getCanceledInfo(); will(returnValue(null));
oneOf(build2).getCanceledInfo(); will(returnValue(null));
oneOf(build3).getCanceledInfo(); will(returnValue(null));
}});
}
开发者ID:sferencik,项目名称:SinCity,代码行数:27,代码来源:FinishedBuildWithChangesTest.java
示例5: fillModel
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
@Override
protected void fillModel(@NotNull Map<String, Object> model, @NotNull SBuild build) {
model.put("buildId", build.getBuildId());
CustomDataStorage storage = build.getBuildType().getCustomDataStorage("bisectPlugin");
BisectRepository repository = new BisectRepository(storage);
Bisect bisect = repository.get(build.getBuildId());
model.put("bisect", bisect);
List<SBuild> historyRecords = new ArrayList<SBuild>();
if (bisect != null) {
for (BisectBuild bisectBuild : bisect.getBuilds()) {
historyRecords.add(server.findBuildInstanceById(bisectBuild.getBuildId()));
}
if (bisect.isFinished() && bisect.isSolved()) {
SVcsModification answer = server.getVcsHistory().findChangeById(bisect.getAnswerModification());
model.put("answer", answer);
}
}
model.put("historyRecords", historyRecords);
}
开发者ID:tkirill,项目名称:tc-bisect,代码行数:22,代码来源:BisectBuildTab.java
示例6: populateCommits
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private void populateCommits(SRunningBuild sRunningBuild) {
List<SVcsModification> changes = sRunningBuild.getContainingChanges();
if(changes == null){
return;
}
for(SVcsModification change : changes){
Collection<SUser> committers = change.getCommitters();
String slackUserName = null;
if(committers != null && !committers.isEmpty()){
SUser committer = committers.iterator().next();
slackUserName = committer.getPropertyValue(SlackNotificator.USERNAME_KEY);
Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to Slack User " + slackUserName);
}
commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), slackUserName));
}
}
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:18,代码来源:SlackNotificationPayloadContent.java
示例7: test_productivity_boost_not_granted
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public void test_productivity_boost_not_granted() {
Achievement achievement = new ProductivityBoost(getRegistry());
SUser user = createUser();
UserEvents userEvents = getUserEvents(user);
Calendar c = Calendar.getInstance();
c.add(Calendar.DAY_OF_MONTH, -2);
Mock modMock = mock(SVcsModification.class);
modMock.stubs().method("getVcsDate").will(returnValue(c.getTime()));
SVcsModification mod = (SVcsModification) modMock.proxy();
for (int i=0; i<25; i++) {
userEvents.registerEvent(AchievementEvents.changeAdded.name(), mod);
assertFalse(achievement.shouldGrantAchievement(user, userEvents, AchievementEvents.changeAdded.name(), mod));
}
}
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:19,代码来源:AchievementsConfigTest.java
示例8: test_productivity_boost
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public void test_productivity_boost() {
Achievement achievement = new ProductivityBoost(getRegistry());
SUser user = createUser();
UserEvents userEvents = getUserEvents(user);
Mock modMock = mock(SVcsModification.class);
modMock.stubs().method("getVcsDate").will(returnValue(new Date()));
SVcsModification mod = (SVcsModification) modMock.proxy();
for (int i=0; i<19; i++) {
userEvents.registerEvent(AchievementEvents.changeAdded.name(), mod);
assertFalse(achievement.shouldGrantAchievement(user, userEvents, AchievementEvents.changeAdded.name(), mod));
}
userEvents.registerEvent(AchievementEvents.changeAdded.name(), mod);
assertTrue(achievement.shouldGrantAchievement(user, userEvents, AchievementEvents.changeAdded.name(), mod));
}
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:19,代码来源:AchievementsConfigTest.java
示例9: triggerCulpritFindingIfNeeded
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
/**
* Investigate if culprit finding is needed. This is so if there are relevant failures and the finishing build has
* covered multiple changes.
*/
public void triggerCulpritFindingIfNeeded() {
if (newBuild.getBuildStatus().isSuccessful()) {
Loggers.SERVER.debug("[SinCity] the build succeeded; we're done.");
return;
}
List<SVcsModification> changesBetweenBuilds = null;
try {
changesBetweenBuilds = getChanges();
} catch (Exception e) {
e.printStackTrace();
return;
}
if (changesBetweenBuilds.size() <= 1) {
Loggers.SERVER.debug("[SinCity] no intermediate changes found; we're done.");
return;
}
if (getRelevantBuildProblems().isEmpty()
&& getRelevantTestFailures().isEmpty()) {
Loggers.SERVER.debug("[SinCity] no relevant failures; we're done.");
return;
}
Loggers.SERVER.info("[SinCity] will look for culprit");
triggerCulpritFinding(changesBetweenBuilds);
}
开发者ID:sferencik,项目名称:SinCity,代码行数:33,代码来源:CulpritFinder.java
示例10: getLastChange
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
/**
* This is a less glorious method than getListFromBuildType() but it's useful when all you need is to find the last
* change for a build. For that job, calling getListFromBuildType() would be an overkill because
* 1) it iterates the full history and this is not needed (as explained by JetBrains in
* https://devnet.jetbrains.com/message/5561032)
* 2) it also collects the changeDeltas which is more expensive (it requires that you *finish* the iteration of the
* full history - whereas finding the last change can terminate the iteration prematurely)
* @param build the build for which to find the last change
* @return the last change that went into the build
*/
static SVcsModification getLastChange(SFinishedBuild build) {
BuildPromotion buildPromotion = build.getBuildPromotion();
while (buildPromotion != null && buildPromotion.getContainingChanges().isEmpty())
buildPromotion = buildPromotion.getPreviousBuildPromotion(SelectPrevBuildPolicy.SINCE_LAST_BUILD);
if (buildPromotion == null)
return null;
return buildPromotion.getContainingChanges().get(0);
}
开发者ID:sferencik,项目名称:SinCity,代码行数:21,代码来源:FinishedBuildWithChanges.java
示例11: SetUp
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
@BeforeMethod
public void SetUp() {
mockery = new Mockery();
// allow mocking concrete classes; http://vikinghammer.com/2012/05/15/jmock-concrete-classes/
mockery.setImposteriser(ClassImposteriser.INSTANCE);
test1TestName = mockery.mock(TestName.class, "test1TestName");
test2TestName = mockery.mock(TestName.class, "test2TestName");
test1STestRun = mockery.mock(STestRun.class, "test1STestRun");
test1STest = mockery.mock(STest.class, "test1STest");
test1FailureTestInfo = mockery.mock(TestInfo.class, "test1FailureTestInfo");
test2STestRun = mockery.mock(STestRun.class, "test2STestRun");
test2STest = mockery.mock(STest.class, "test2STest");
test2FailureTestInfo = mockery.mock(TestInfo.class, "test2FailureTestInfo");
buildStatisticsGood = mockery.mock(BuildStatistics.class, "buildStatisticsGood");
buildStatisticsNoRun = mockery.mock(BuildStatistics.class, "buildStatisticsNoRun");
change0 = mockery.mock(SVcsModification.class, "change0");
change1 = mockery.mock(SVcsModification.class, "change1");
change2 = mockery.mock(SVcsModification.class, "change2");
buildGood = mockery.mock(SFinishedBuild.class, "buildGood");
buildBad1 = mockery.mock(SFinishedBuild.class, "buildBad1");
buildBad2 = mockery.mock(SFinishedBuild.class, "buildBad2");
buildNoRun = mockery.mock(SFinishedBuild.class, "buildNoRun");
buildNoRunSequence = new ArrayList<SFinishedBuild>(NUMBER_OF_NO_RUN_BUILDS_IN_SEQUENCE);
for (int i = 0; i < NUMBER_OF_NO_RUN_BUILDS_IN_SEQUENCE; i++) {
buildNoRunSequence.add(mockery.mock(SFinishedBuild.class, String.format("buildNoRun%d", i)));
}
}
开发者ID:sferencik,项目名称:SinCity,代码行数:34,代码来源:AnalyserTest.java
示例12: test02RepeatedBuild
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
@Test
public void test02RepeatedBuild() {
/*
Scenario: build1 and build2 run in sequence (e.g. VCS-triggered), then build3 runs with no changes in it
(e.g. triggered manually by a user).
time --------->
change 1 -> build1
change 2
change 3 -> build2 build3
*/
// arrange
mockery.checking(new Expectations() {{
oneOf(build3).getContainingChanges(); will(returnValue(new ArrayList<SVcsModification>()));
oneOf(build2).getContainingChanges(); will(returnValue(Arrays.asList(change3, change2)));
oneOf(build1).getContainingChanges(); will(returnValue(Collections.singletonList(change1)));
}});
// act
List<FinishedBuildWithChanges> list = FinishedBuildWithChanges.getListFromBuildType(buildType);
// assert
mockery.assertIsSatisfied();
assertThat(list.get(0).getBuild(), is(build3));
assertThat(list.get(0).getLastChange(), is(change3));
assertThat(list.get(0).getChangeDelta(), IsEmptyCollection.empty());
assertThat(list.get(1).getBuild(), is(build2));
assertThat(list.get(1).getLastChange(), is(change3));
assertThat(list.get(1).getChangeDelta(), IsIterableContainingInOrder.contains(Arrays.asList(change3, change2).toArray()));
assertThat(list.get(2).getBuild(), is(build1));
assertThat(list.get(2).getLastChange(), is(change1));
assertThat(list.get(2).getChangeDelta(), IsIterableContainingInOrder.contains(change1));
}
开发者ID:sferencik,项目名称:SinCity,代码行数:38,代码来源:FinishedBuildWithChangesTest.java
示例13: getChangeIds
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private List<Long> getChangeIds(SBuild build) {
List<Long> result = new ArrayList<Long>();
for (SVcsModification modification : build.getContainingChanges()) {
result.add(modification.getId());
}
return result;
}
开发者ID:tkirill,项目名称:tc-bisect,代码行数:10,代码来源:BisectController.java
示例14: queueBuild
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private SQueuedBuild queueBuild(SBuild build, Bisect bisect, int nextMid) {
Long changeId = bisect.getChanges().get(nextMid);
SVcsModification vcsModification = server.getVcsHistory().findChangeById(changeId);
BuildCustomizer buildCustomizer = customizerFactory.createBuildCustomizer(build.getBuildType(), null);
buildCustomizer.setParameters(build.getBuildType().getParameters());
buildCustomizer.setChangesUpTo(vcsModification);
return buildCustomizer.createPromotion().addToQueue("bisect");
}
开发者ID:tkirill,项目名称:tc-bisect,代码行数:9,代码来源:BisectBuildTriggerHelper.java
示例15: ProductivityBoost
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public ProductivityBoost(@NotNull final UserEventsRegistry userEventsRegistry) {
super(AchievementEvents.changeAdded.name(), 20);
userEventsRegistry.addListener(new UserEventsListener() {
public void userEventPublished(@NotNull User user, @NotNull String eventName, @Nullable Object additionalData) {
if (!AchievementEvents.changeAdded.name().equals(eventName)) return;
if (!(additionalData instanceof SVcsModification)) return;
SVcsModification mod = (SVcsModification) additionalData;
Date vcsDate = mod.getVcsDate();
if (Calendar.getInstance().getTime().getTime() - vcsDate.getTime() < 24 * 3600 * 1000) {
userEventsRegistry.getUserEvents(user).registerEvent(getId() + ":changeAdded");
}
}
});
}
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:16,代码来源:ProductivityBoost.java
示例16: DumpDebugInformation
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
/**
* Used for dumping debugging information to the LOG file.
*
* @param buildInfo
*/
private void DumpDebugInformation(RallyBuild buildInfo) {
LOG.info("BuildInfo: ID =" + buildInfo.getBuildID());
LOG.info("BuildInfo: NAME =" + buildInfo.getBuildName());
LOG.info("BuildInfo: URL =" + buildInfo.getUrl());
LOG.info("BuildInfo: START =" + buildInfo.getStartTime());
LOG.info("BuildInfo: ELAPSED =" + buildInfo.getDuration());
LOG.info("BuildInfo: isFORCED =" + buildInfo.isForced());
LOG.info("BuildInfo: isSUCCESS =" + buildInfo.isSuccessful());
LOG.info("BuildInfo: BUILDTYPE =" + buildInfo.getTeamCityBuildInfo().getBuildType());
LOG.info("BuildInfo: BUILDTYPENAME =" + buildInfo.getTeamCityBuildInfo().getBuildTypeName());
LOG.info("BuildInfo: FULLNAME =" + buildInfo.getTeamCityBuildInfo().getFullName());
LOG.info("BuildInfo: STATUSDESC =" + buildInfo.getTeamCityBuildInfo().getStatusDescriptor());
LOG.info("BuildInfo: STATUS =" + buildInfo.getTeamCityBuildInfo().getBuildStatus().toString());
LOG.info("BuildInfo: NUMBER =" + buildInfo.getTeamCityBuildInfo().getBuildNumber());
for (Iterator<SVcsModification> it = buildInfo.getBuildChanges().iterator(); it.hasNext(); ) {
SVcsModification mod = it.next();
LOG.info("BuildInfo: MODIFICATIONS");
LOG.info("BuildInfo: MODIFICATIONS DESC=" + mod.getDescription());
LOG.info("BuildInfo: MODIFICATIONS DVER=" + mod.getDisplayVersion());
LOG.info("BuildInfo: MODIFICATIONS USER=" + mod.getUserName());
LOG.info("BuildInfo: MODIFICATIONS VCN =" + mod.getVersionControlName());
LOG.info("BuildInfo: MODIFICATIONS VER =" + mod.getVersion());
LOG.info("BuildInfo: MODIFICATIONS ID =" + mod.getId());
LOG.info("BuildInfo: MODIFICATIONS DSP =" + mod.getDisplayVersion());
LOG.info("BuildInfo: MODIFICATIONS ROOT=" + mod.getVcsRoot());
LOG.info("BuildInfo: MODIFICATIONS ROOTNAME=" + mod.getVcsRoot().getName());
LOG.info("BuildInfo: MODIFICATIONS NAME=" + mod.getId());
}
LOG.info("Change Set IDs: " + buildInfo.getChangeSetIDs().toString());
}
开发者ID:trevleyb,项目名称:TeamCityRallyIntegration,代码行数:37,代码来源:RallyManager.java
示例17: getChangeSetIDs
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public List<String> getChangeSetIDs() {
List<String> changeIDs = new ArrayList<String>();
if (getBuildChanges() != null && getBuildChanges().size() > 0) {
for (SVcsModification s : getBuildChanges()) {
changeIDs.add(s.getDisplayVersion());
}
}
return changeIDs;
}
开发者ID:trevleyb,项目名称:TeamCityRallyIntegration,代码行数:10,代码来源:RallyBuild.java
示例18: getChanges
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public List<SVcsModification> getChanges(SelectPrevBuildPolicy arg0,
boolean arg1) {
// TODO Auto-generated method stub
return null;
}
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:6,代码来源:MockSRunningBuild.java
示例19: getContainingChanges
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
public List<SVcsModification> getContainingChanges() {
// TODO Auto-generated method stub
return null;
}
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:5,代码来源:MockSRunningBuild.java
示例20: getChanges
import jetbrains.buildServer.vcs.SVcsModification; //导入依赖的package包/类
private List<SVcsModification> getChanges() throws Exception {
// use a linked set to avoid duplicates and to keep the changes in descending order
Set<SVcsModification> changeList = new LinkedHashSet<SVcsModification>();
BuildPromotion buildPromotion = newBuild.getBuildPromotion();
// find oldBuildchange, the changelist of oldBuild; in the while loop below, reaching oldBuildChange will be our
// terminating condition
// NB: oldBuildChange will be null if oldBuild was executed before any VCS was attached to the build
// configuration; otherwise oldBuild really should have a change associated with it
SVcsModification oldBuildChange = null;
if (oldBuild != null) {
oldBuildChange = FinishedBuildWithChanges.getLastChange(oldBuild);
}
while (true) {
if (oldBuildChange == null) {
// we are supposed to search all the way to Big Bang
if (buildPromotion == null) {
// we have reached Big Bang
return new ArrayList<SVcsModification>(changeList);
}
else {
// keep going; we haven't reached Big Bang yet
}
}
else {
// we should only go as far as oldBuildChange
if (buildPromotion == null) {
// we have reached Big Bang and never found oldBuildChange
throw new Exception("Could not find changes between " + oldBuild + " and " + newBuild);
}
else if (buildPromotion.getContainingChanges().contains(oldBuildChange)) {
// we have reached oldBuildChange
changeList.addAll(buildPromotion.getContainingChanges().subList(0, buildPromotion.getContainingChanges().indexOf(oldBuildChange)));
return new ArrayList<SVcsModification>(changeList);
}
else {
// keep going; we haven't seen oldBuildChange yet
}
}
Loggers.SERVER.debug("[SinCity] build promotion " + buildPromotion);
Loggers.SERVER.debug("[SinCity] changes " + buildPromotion.getContainingChanges());
changeList.addAll(buildPromotion.getContainingChanges());
buildPromotion = buildPromotion.getPreviousBuildPromotion(SelectPrevBuildPolicy.SINCE_LAST_BUILD);
}
}
开发者ID:sferencik,项目名称:SinCity,代码行数:48,代码来源:CulpritFinder.java
注:本文中的jetbrains.buildServer.vcs.SVcsModification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论