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


Java Status类代码示例

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


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

示例1: setUp

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@BeforeMethod
public void setUp()
{
  myCtx = new Mockery();

  myServerExtensionHolder = myCtx.mock(ServerExtensionHolder.class);
  myBuildDataStorage = myCtx.mock(BuildDataStorage.class);
  myMetricComparer = myCtx.mock(MetricComparer.class);
  myStatisticKeyFactory = myCtx.mock(StatisticKeyFactory.class);
  myStatisticProvider = myCtx.mock(StatisticProvider.class);
  myHistory = myCtx.mock(History.class);
  myRunningBuild = myCtx.mock(SRunningBuild.class);
  myBuildType = myCtx.mock(SBuildType.class);

  buildMessage1 = new BuildMessage1("sourceId", "typeId", Status.NORMAL, new Date(1234567), "value", Arrays.asList("a", "b"));
  myBuild1 = myCtx.mock(SFinishedBuild.class, "Build1");
  myBuild2 = myCtx.mock(SFinishedBuild.class, "Build2");

  myHistoryElement1 = myCtx.mock(HistoryElement.class, "HistoryElement1");
  myHistoryElement2 = myCtx.mock(HistoryElement.class, "HistoryElement2");
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:22,代码来源:DotTraceStatisticTranslatorTest.java

示例2: MsTeamsNotificationMockingFrameworkImpl

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
private MsTeamsNotificationMockingFrameworkImpl() {
		msteamsNotificationImpl = new MsTeamsNotificationImpl();
		spyMsTeamsNotification = spy(msteamsNotificationImpl);
		whl = new MsTeamsNotificationListener(sBuildServer, settings, configSettings, manager, factory);
		projSettings = new MsTeamsNotificationProjectSettings();
		when(factory.getMsTeamsNotification()).thenReturn(spyMsTeamsNotification);
		//when(manager.isRegisteredFormat("JSON")).thenReturn(true);
//		when(manager.getFormat("JSON")).thenReturn(payload);
		//when(manager.getServer()).thenReturn(sBuildServer);
		when(projectManager.findProjectById("project01")).thenReturn(sProject);
		when(sBuildServer.getHistory()).thenReturn(buildHistory);
		when(sBuildServer.getRootUrl()).thenReturn("http://test.server");
		when(sBuildServer.getProjectManager()).thenReturn(projectManager);
		when(previousSuccessfulBuild.getBuildStatus()).thenReturn(Status.NORMAL);
		when(previousSuccessfulBuild.isPersonal()).thenReturn(false);
		when(previousFailedBuild.getBuildStatus()).thenReturn(Status.FAILURE);
		when(previousFailedBuild.isPersonal()).thenReturn(false);
		finishedSuccessfulBuilds.add(previousSuccessfulBuild);
		finishedFailedBuilds.add(previousFailedBuild);
		((MockSBuildType) sBuildType).setProject(sProject);
		when(settings.getSettings(sRunningBuild.getProjectId(), "msteamsNotifications")).thenReturn(projSettings);
		
		when(build2.getBuildTypeId()).thenReturn("bt2");
		when(build2.getInternalId()).thenReturn("bt2");
		when(build2.getName()).thenReturn("This is Build 2");
		when(build3.getBuildTypeId()).thenReturn("bt3");
		when(build3.getInternalId()).thenReturn("bt3");
		when(build3.getName()).thenReturn("This is Build 3");
		((MockSProject) sProject).addANewBuildTypeToTheMock(build2);
		((MockSProject) sProject).addANewBuildTypeToTheMock(build3);
		((MockSProject) sProject02).addANewBuildTypeToTheMock(sBuildType02);
		((MockSProject) sProject03).addANewBuildTypeToTheMock(sBuildType03);
		((MockSProject) sProject03).setParentProject(sProject02);
		((MockSProject) sProject02).addChildProjectToMock(sProject03);
		whl.register();
		
	}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:38,代码来源:MsTeamsNotificationMockingFrameworkImpl.java

示例3: setUp

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Before
	public void setUp() throws Exception {
        HttpClient httpClient = mock(HttpClient.class);
        BasicHttpResponse response = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("http", 1, 1), 200, ""));
        PostMessageResponse successfulResponse = new PostMessageResponse();
        successfulResponse.setOk(true);
        successfulResponse.setError("channel_not_found");
        response.setEntity(new StringEntity(successfulResponse.toJson()));

        when(httpClient.execute(isA(HttpUriRequest.class))).thenReturn(response);
		msteamsNotificationImpl = new MsTeamsNotificationImpl(httpClient);
		spyMsTeamsNotification = spy(msteamsNotificationImpl);
		whl = new MsTeamsNotificationListener(sBuildServer, settings, configSettings, manager, factory);
		projSettings = new MsTeamsNotificationProjectSettings();
		when(factory.getMsTeamsNotification()).thenReturn(spyMsTeamsNotification);
		//when(manager.isRegisteredFormat("JSON")).thenReturn(true);
//		when(manager.getFormat("JSON")).thenReturn(payload);
		//when(manager.getServer()).thenReturn(sBuildServer);
		when(sBuildServer.getProjectManager()).thenReturn(projectManager);
		when(projectManager.findProjectById("project1")).thenReturn(sProject);
		when(sBuildServer.getHistory()).thenReturn(buildHistory);
		when(sBuildServer.getRootUrl()).thenReturn("http://test.server");
		when(previousSuccessfulBuild.getBuildStatus()).thenReturn(Status.NORMAL);
		when(previousSuccessfulBuild.isPersonal()).thenReturn(false);
		when(previousFailedBuild.getBuildStatus()).thenReturn(Status.FAILURE);
		when(previousFailedBuild.isPersonal()).thenReturn(false);
		finishedSuccessfulBuilds.add(previousSuccessfulBuild);
		finishedFailedBuilds.add(previousFailedBuild);
		sBuildType.setProject(sProject);
		when(settings.getSettings(sRunningBuild.getProjectId(), "msteamsNotifications")).thenReturn(projSettings);
		whl.register();
	}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:33,代码来源:MsTeamsNotificationListenerTest.java

示例4: MockSRunningBuild

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
public MockSRunningBuild(SBuildType buildType, String triggeredBy, Status status, String statusText, String buildNumber) {
	this.sBuildType = buildType;
	this.sBuildAgent = new MockSBuildAgent("Test Agent", 
								"agent.hostname.domain.name", 
								"192.168.0.1",
								1, 
								"Linux, version 2.6.27.21" );
	sBuildAgent.setRunningBuild(this);
	this.triggeredBy = new MockTriggeredBy(triggeredBy);
	this.status = status;
	this.statusText = statusText;
	this.buildNumber = buildNumber;
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:14,代码来源:MockSRunningBuild.java

示例5: handleLog

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
private void handleLog(final String txt, final Throwable e) {
    log.message(HubConstantValues.PLUGIN_LOG + txt, Status.NORMAL, new Date(), "", "", Collections.EMPTY_LIST);
    if (e != null) {
        final StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        log.message(HubConstantValues.PLUGIN_LOG + sw.toString(), Status.NORMAL, new Date(), "", "", Collections.EMPTY_LIST);
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-teamcity,代码行数:9,代码来源:HubParametersPreprocessor.java

示例6: SlackNotificationMockingFrameworkImpl

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
private SlackNotificationMockingFrameworkImpl() {
		slackNotificationImpl = new SlackNotificationImpl();
		spySlackNotification = spy(slackNotificationImpl);
		whl = new SlackNotificationListener(sBuildServer, settings, configSettings, manager, factory);
		projSettings = new SlackNotificationProjectSettings();
		when(factory.getSlackNotification()).thenReturn(spySlackNotification);
		//when(manager.isRegisteredFormat("JSON")).thenReturn(true);
//		when(manager.getFormat("JSON")).thenReturn(payload);
		//when(manager.getServer()).thenReturn(sBuildServer);
		when(projectManager.findProjectById("project01")).thenReturn(sProject);
		when(sBuildServer.getHistory()).thenReturn(buildHistory);
		when(sBuildServer.getRootUrl()).thenReturn("http://test.server");
		when(sBuildServer.getProjectManager()).thenReturn(projectManager);
		when(previousSuccessfulBuild.getBuildStatus()).thenReturn(Status.NORMAL);
		when(previousSuccessfulBuild.isPersonal()).thenReturn(false);
		when(previousFailedBuild.getBuildStatus()).thenReturn(Status.FAILURE);
		when(previousFailedBuild.isPersonal()).thenReturn(false);
		finishedSuccessfulBuilds.add(previousSuccessfulBuild);
		finishedFailedBuilds.add(previousFailedBuild);
		((MockSBuildType) sBuildType).setProject(sProject);
		when(settings.getSettings(sRunningBuild.getProjectId(), "slackNotifications")).thenReturn(projSettings);
		
		when(build2.getBuildTypeId()).thenReturn("bt2");
		when(build2.getInternalId()).thenReturn("bt2");
		when(build2.getName()).thenReturn("This is Build 2");
		when(build3.getBuildTypeId()).thenReturn("bt3");
		when(build3.getInternalId()).thenReturn("bt3");
		when(build3.getName()).thenReturn("This is Build 3");
		((MockSProject) sProject).addANewBuildTypeToTheMock(build2);
		((MockSProject) sProject).addANewBuildTypeToTheMock(build3);
		((MockSProject) sProject02).addANewBuildTypeToTheMock(sBuildType02);
		((MockSProject) sProject03).addANewBuildTypeToTheMock(sBuildType03);
		((MockSProject) sProject03).setParentProject(sProject02);
		((MockSProject) sProject02).addChildProjectToMock(sProject03);
		whl.register();
		
	}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:38,代码来源:SlackNotificationMockingFrameworkImpl.java

示例7: setUp

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Before
	public void setUp() throws Exception {
        HttpClient httpClient = mock(HttpClient.class);
        BasicHttpResponse response = new BasicHttpResponse(new BasicStatusLine(new ProtocolVersion("http", 1, 1), 200, ""));
        PostMessageResponse successfulResponse = new PostMessageResponse();
        successfulResponse.setOk(true);
        successfulResponse.setError("channel_not_found");
        response.setEntity(new StringEntity(successfulResponse.toJson()));

        when(httpClient.execute(isA(HttpUriRequest.class))).thenReturn(response);
		slackNotificationImpl = new SlackNotificationImpl(httpClient, "");
		spySlackNotification = spy(slackNotificationImpl);
		whl = new SlackNotificationListener(sBuildServer, settings, configSettings, manager, factory);
		projSettings = new SlackNotificationProjectSettings();
		when(factory.getSlackNotification()).thenReturn(spySlackNotification);
		//when(manager.isRegisteredFormat("JSON")).thenReturn(true);
//		when(manager.getFormat("JSON")).thenReturn(payload);
		//when(manager.getServer()).thenReturn(sBuildServer);
		when(sBuildServer.getProjectManager()).thenReturn(projectManager);
		when(projectManager.findProjectById("project1")).thenReturn(sProject);
		when(sBuildServer.getHistory()).thenReturn(buildHistory);
		when(sBuildServer.getRootUrl()).thenReturn("http://test.server");
		when(previousSuccessfulBuild.getBuildStatus()).thenReturn(Status.NORMAL);
		when(previousSuccessfulBuild.isPersonal()).thenReturn(false);
		when(previousFailedBuild.getBuildStatus()).thenReturn(Status.FAILURE);
		when(previousFailedBuild.isPersonal()).thenReturn(false);
		finishedSuccessfulBuilds.add(previousSuccessfulBuild);
		finishedFailedBuilds.add(previousFailedBuild);
		sBuildType.setProject(sProject);
		when(settings.getSettings(sRunningBuild.getProjectId(), "slackNotifications")).thenReturn(projSettings);
		whl.register();
	}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:33,代码来源:SlackNotificationListenerTest.java

示例8: getStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
public Status getStatus() {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:5,代码来源:MockSBuildType.java

示例9: setBuildStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
public void setBuildStatus(Status arg0) {
	this.status = arg0;
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:4,代码来源:MockSRunningBuild.java

示例10: getBuildStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
public Status getBuildStatus() {
	return this.status;
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:4,代码来源:MockSRunningBuild.java

示例11: getStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
public Status getStatus() {
	return this.status;
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:4,代码来源:MockSProject.java

示例12: shouldTranslate

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Test
public void shouldTranslate() {
  // Given
  final List<SFinishedBuild> builds = Arrays.asList(myBuild1, myBuild2);
  final List<HistoryElement> historyElements = Arrays.asList(myHistoryElement1, myHistoryElement2);
  final StatisticMessage statisticMessage = new StatisticMessage("method1", "L10", "F20", "12", "34");
  final Statistic statistic = new Statistic(new BigDecimal(1), new BigDecimal(2), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(3)), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(4)), new BigDecimal(5), new BigDecimal(6));

  myCtx.checking(new Expectations() {{
    oneOf(myServerExtensionHolder).registerExtension(with(ServiceMessageTranslator.class), with(DotTraceStatisticTranslator.class.getName()), with(any(ServiceMessageTranslator.class)));

    oneOf(myRunningBuild).getBuildType();
    will(returnValue(myBuildType));

    oneOf(myBuildType).getHistory();
    will(returnValue(builds));

    oneOf(myHistory).getElements(builds);
    will(returnValue(historyElements));

    oneOf(myStatisticProvider).tryCreateStatistic(statisticMessage, historyElements);
    will(returnValue(statistic));

    oneOf(myMetricComparer).isMeasuredValueWithinThresholds(new BigDecimal(5), new BigDecimal(1), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(3)));
    will(returnValue(false));

    oneOf(myMetricComparer).tryGetThresholdValue(new BigDecimal(5), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(3)));
    will(returnValue(new BigDecimal(10)));

    oneOf(myMetricComparer).isMeasuredValueWithinThresholds(new BigDecimal(6), new BigDecimal(2), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(4)));
    will(returnValue(false));

    oneOf(myMetricComparer).tryGetThresholdValue(new BigDecimal(6), new ThresholdValue(ThresholdValueType.LAST, new BigDecimal(4)));
    will(returnValue(new BigDecimal(10)));

    oneOf(myStatisticKeyFactory).createTotalTimeKey("method1");
    will(returnValue("TotalTimeKey"));

    oneOf(myStatisticKeyFactory).createOwnTimeKey("method1");
    will(returnValue("OwnTimeKey"));

    oneOf(myRunningBuild).getBuildId();
    will(returnValue(33L));

    oneOf(myBuildDataStorage).publishValue("TotalTimeKey", 33L, new BigDecimal(1));
    oneOf(myBuildDataStorage).publishValue("OwnTimeKey", 33L, new BigDecimal(2));
  }});

  // When
  final ServiceMessageTranslator instance = createInstance();
  final List<BuildMessage1> messages = instance.translate(myRunningBuild, buildMessage1, statisticMessage);

  // Then
  myCtx.assertIsSatisfied();
  then(messages.size()).isEqualTo(3);
  then(messages.get(0)).isEqualTo(buildMessage1);

  final BuildMessage1 message1 = messages.get(1);
  then(message1.getSourceId()).isEqualTo(buildMessage1.getSourceId());
  then(message1.getTypeId()).isEqualTo(buildMessage1.getTypeId());
  then(message1.getStatus()).isEqualTo(Status.FAILURE);
  then(message1.getTimestamp()).isEqualTo(buildMessage1.getTimestamp());
  then(message1.getValue()).isNotNull();
  then(message1.getValue()).isInstanceOf(String.class);

  final BuildMessage1 message2 = messages.get(2);
  then(message2.getSourceId()).isEqualTo(buildMessage1.getSourceId());
  then(message2.getTypeId()).isEqualTo(buildMessage1.getTypeId());
  then(message2.getStatus()).isEqualTo(Status.FAILURE);
  then(message2.getTimestamp()).isEqualTo(buildMessage1.getTimestamp());
  then(message2.getValue()).isNotNull();
  then(message2.getValue()).isInstanceOf(String.class);
}
 
开发者ID:JetBrains,项目名称:teamcity-dottrace,代码行数:74,代码来源:DotTraceStatisticTranslatorTest.java

示例13: getStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Override
public Status getStatus() {
    return null;
}
 
开发者ID:matt-richardson,项目名称:teamcity-octopus-build-trigger-plugin,代码行数:5,代码来源:FakeSBuildType.java

示例14: getBuildStatus

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Override
public Status getBuildStatus() {
    return null;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:5,代码来源:ReportsMain.java

示例15: getTests

import jetbrains.buildServer.messages.Status; //导入依赖的package包/类
@Override
public List<STestRun> getTests(@Nullable Status status, @NotNull Order order) {
    return Collections.emptyList();
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-tck,代码行数:5,代码来源:ReportsMain.java


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