• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WithoutJenkins类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testImageUrl

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Issue({"JENKINS-48674"})
@WithoutJenkins
@Test
public void testImageUrl() throws MalformedURLException {
    assertEquals(new URL("https://get.docker.com/builds/Linux/x86_64/docker-1.10.0"), DockerToolInstaller.getDockerImageUrl("linux/x86_64", "1.10.0"));
    assertEquals(new URL("https://get.docker.com/builds/Windows/x86_64/docker-1.10.0"), DockerToolInstaller.getDockerImageUrl("win/x86_64","1.10.0"));
    assertEquals(new URL("https://get.docker.com/builds/Darwin/x86_64/docker-1.10.0"), DockerToolInstaller.getDockerImageUrl("mac/x86_64","1.10.0"));
    assertEquals(new URL("https://get.docker.com/builds/Linux/x86_64/docker-17.05.0-ce"), DockerToolInstaller.getDockerImageUrl("linux/x86_64", "17.05.0-ce"));
    assertEquals(new URL("https://get.docker.com/builds/Windows/x86_64/docker-17.05.0-ce"), DockerToolInstaller.getDockerImageUrl("win/x86_64","17.05.0-ce"));
    assertEquals(new URL("https://get.docker.com/builds/Darwin/x86_64/docker-17.05.0-ce"), DockerToolInstaller.getDockerImageUrl("mac/x86_64","17.05.0-ce"));
    assertEquals(new URL("https://get.docker.com/builds/Linux/x86_64/docker-latest"), DockerToolInstaller.getDockerImageUrl("linux/x86_64", "latest"));
    assertEquals(new URL("https://get.docker.com/builds/Windows/x86_64/docker-latest"), DockerToolInstaller.getDockerImageUrl("win/x86_64","latest"));
    assertEquals(new URL("https://get.docker.com/builds/Darwin/x86_64/docker-latest"), DockerToolInstaller.getDockerImageUrl("mac/x86_64","latest"));
    assertEquals(new URL("https://download.docker.com/linux/static/edge/x86_64/docker-17.09.0-ce"), DockerToolInstaller.getDockerImageUrl("linux/x86_64", "17.09.0-ce"));
    assertEquals(new URL("https://download.docker.com/win/static/edge/x86_64/docker-17.09.0-ce"), DockerToolInstaller.getDockerImageUrl("win/x86_64","17.09.0-ce"));
    assertEquals(new URL("https://download.docker.com/mac/static/edge/x86_64/docker-17.09.0-ce"), DockerToolInstaller.getDockerImageUrl("mac/x86_64","17.09.0-ce"));
}
 
开发者ID:jenkinsci,项目名称:docker-commons-plugin,代码行数:18,代码来源:DockerToolInstallerTest.java


示例2: testSplit

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testSplit() throws Exception {
  assertArrayEquals(DownloadStep.split("a"), new String[] {"a"});
  assertArrayEquals(DownloadStep.split("asdjfkl2358/9/[email protected]#[email protected]%^$#^#"),
      new String[] {"asdjfkl2358/9/[email protected]#[email protected]%^$#^#"});

  assertArrayEquals(DownloadStep.split("a*"), new String[] {"a", ""});
  assertArrayEquals(DownloadStep.split("*"), new String[] {"", ""});

  assertArrayEquals(DownloadStep.split("pre-*-post"),
      new String[] {"pre-", "-post"});

  // Not yet supported
  checkSplitException("**");
  checkSplitException("a**");
  checkSplitException("a*b*c");
  checkSplitException("a/*b/*c");
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:20,代码来源:DownloadStepTest.java


示例3: testGetters

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testGetters() {
  final boolean sharedPublicly = false;
  final boolean forFailedJobs = true;
  final boolean showInline = true;
  final String pathPrefix = null;
  FakeUpload underTest = new FakeUpload(BUCKET_URI,
      sharedPublicly, forFailedJobs, showInline, pathPrefix,
      new MockUploadModule(executor),
      FAKE_DETAILS,
      null /* uploads */);

  assertEquals(BUCKET_URI, underTest.getBucket());
  assertEquals(sharedPublicly, underTest.isSharedPublicly());
  assertEquals(forFailedJobs, underTest.isForFailedJobs());
  assertEquals(showInline, underTest.isShowInline());
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:19,代码来源:AbstractUploadTest.java


示例4: doCheckBucketTest

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void doCheckBucketTest() throws IOException {
  DescriptorImpl descriptor = new DescriptorImpl();

  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckBucketNameWithVars("gs://asdf").kind);
  // Successfully resolved
  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckBucketNameWithVars("gs://asdf$BUILD_NUMBER").kind);
  // UN-successfully resolved
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckBucketNameWithVars("gs://$foo").kind);
  // Escaped $BUILD_NUMBER
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckBucketNameWithVars("gs://$$BUILD_NUMBER").kind);
  // Empty
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckBucketNameWithVars("").kind);
  // Not a gs:// URI
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckBucketNameWithVars("foo").kind);
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:24,代码来源:AbstractUploadTest.java


示例5: testLegacyArgs

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testLegacyArgs() {
  ClassicUpload legacyVersion = new ClassicUpload(null /* bucket */,
      new MockUploadModule(executor), null /* glob */, bucket, glob);
  legacyVersion.setSharedPublicly(sharedPublicly);
  legacyVersion.setForFailedJobs(forFailedJobs);
  legacyVersion.setShowInline(showInline);
  legacyVersion.setPathPrefix(pathPrefix);

  assertEquals(underTest.getBucket(), legacyVersion.getBucket());
  assertEquals(underTest.isSharedPublicly(),
      legacyVersion.isSharedPublicly());
  assertEquals(underTest.isForFailedJobs(), legacyVersion.isForFailedJobs());
  assertEquals(underTest.getPattern(), legacyVersion.getPattern());
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:17,代码来源:ClassicUploadTest.java


示例6: doCheckGlobTest

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void doCheckGlobTest() throws IOException {
  DescriptorImpl descriptor = new DescriptorImpl();

  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckPattern("asdf").kind);
  // Some good sample globs we should accept
  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckPattern("target/*.war").kind);
  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckPattern("**/target/foo.*").kind);
  // Successfully resolved
  assertEquals(FormValidation.Kind.OK,
      descriptor.doCheckPattern("asdf$BUILD_NUMBER").kind);
  // UN-successfully resolved
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckPattern("$foo").kind);
  // Escaped $BUILD_NUMBER
  assertEquals(FormValidation.Kind.ERROR,
      descriptor.doCheckPattern("$$BUILD_NUMBER").kind);
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:23,代码来源:ClassicUploadTest.java


示例7: testJobPluginTextInJob

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testJobPluginTextInJob() {
    final String jsonText = "{ \"here\": \"i am\"}";

    PackerPublisher plugin = new PackerPublisher(name,
            jsonProjectTemplate, jsonText, PLUGIN_HOME,
            localParams, emptyFileEntries, false, null);

    assertEquals(PLUGIN_HOME, plugin.getPackerHome());
    // text in job initialization
    plugin.setTemplateMode(TemplateMode.TEXT.toMode());
    assertEquals(localParams, plugin.getParams());

    assertFalse(plugin.isFileTemplate());
    assertFalse(plugin.isGlobalTemplate());

    assertTrue(plugin.isTextTemplate());
    assertEquals(jsonText, plugin.getJsonTemplateText());
}
 
开发者ID:jenkinsci,项目名称:packer-plugin,代码行数:21,代码来源:PackerJenkinsPluginTest.java


示例8: testJobPluginFileInJob

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testJobPluginFileInJob() {
    final String jsonFile = "somefile.json";

    PackerPublisher plugin = new PackerPublisher(name,
            jsonFile, "{ \"here\": \"i am\"}", PLUGIN_HOME,
            localParams, emptyFileEntries, false, null);

    assertEquals(PLUGIN_HOME, plugin.getPackerHome());
    // text in job initialization
    plugin.setTemplateMode(TemplateMode.FILE.toMode());
    assertEquals(localParams, plugin.getParams());

    assertFalse(plugin.isTextTemplate());
    assertFalse(plugin.isGlobalTemplate());

    assertTrue(plugin.isFileTemplate());
    assertEquals(jsonFile, plugin.getJsonTemplate());
}
 
开发者ID:jenkinsci,项目名称:packer-plugin,代码行数:21,代码来源:PackerJenkinsPluginTest.java


示例9: fromGitSCMFilter

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void fromGitSCMFilter() {
  AbstractGitSCMSource git = EasyMock.createMock(AbstractGitSCMSource.class);
  EasyMock.expect(git.getIncludes())
    .andReturn("").times(1)
    .andReturn("").times(1)      
    .andReturn("*/master */feature-branch").times(1)      
    .andReturn("*/master").anyTimes();
  EasyMock.replay(git);
  
  assertTrue(git.getIncludes().isEmpty());    
  assertEquals("", BitbucketBuildFilter.filterFromGitSCMSource(git, ""));
  assertEquals("d:master d:feature-branch", BitbucketBuildFilter.filterFromGitSCMSource(git, ""));
  assertEquals("d:master", BitbucketBuildFilter.filterFromGitSCMSource(git, ""));
}
 
开发者ID:nishio-dens,项目名称:bitbucket-pullrequest-builder-plugin,代码行数:17,代码来源:BitbucketBuildFilterTest.java


示例10: testForRemote

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testForRemote() throws Exception {
  FakeGoogleCredentials credentials = new FakeGoogleCredentials(PROJECT_ID,
      fakeCredential);

  fakeCredential.setAccessToken(ACCESS_TOKEN);
  fakeCredential.setExpiresInSeconds(EXPIRATION_SECONDS);

  GoogleOAuth2ScopeRequirement requirement =
      new GoogleOAuth2ScopeRequirement() {
        @Override
        public Collection<String> getScopes() {
          return ImmutableList.of();
        }
      };
  GoogleRobotCredentials remotable = credentials.forRemote(requirement);

  assertEquals(USERNAME, remotable.getUsername());
  assertEquals(ACCESS_TOKEN, Secret.toString(
      remotable.getAccessToken(requirement)));
  assertSame(remotable, remotable.forRemote(requirement));
}
 
开发者ID:jenkinsci,项目名称:google-oauth-plugin,代码行数:24,代码来源:GoogleRobotCredentialsTest.java


示例11: accessTokenTest

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void accessTokenTest() throws Exception {
  final Module module = new Module();

  GoogleRobotMetadataCredentials newCreds =
      new GoogleRobotMetadataCredentials(PROJECT_ID, module);

  Credential cred = newCreds.getGoogleCredential(
      new TestGoogleOAuth2DomainRequirement(FAKE_SCOPE));

  module.stubRequest(METADATA_ENDPOINT, STATUS_CODE_OK,
      "{\"access_token\":\"" + ACCESS_TOKEN + "\","
      + "\"expires_in\":1234,"
      + "\"token_type\":\"Bearer\"}");

  try {
    assertTrue(cred.refreshToken());
    assertEquals(ACCESS_TOKEN, cred.getAccessToken());
  } finally {
    module.verifyRequest(METADATA_ENDPOINT);
  }
}
 
开发者ID:jenkinsci,项目名称:google-oauth-plugin,代码行数:24,代码来源:GoogleRobotMetadataCredentialsTest.java


示例12: testProjectAction_setBranchSameBranch

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testProjectAction_setBranchSameBranch() throws Exception {
  when(mockProject.getBranch()).thenReturn(mockBranch);
  when(mockBranch.getHead()).thenReturn(mockHead);
  when(mockBranch.getSourceId()).thenReturn(SOURCE_ID);

  assertSame(mockProject, underTest.setBranch(mockProject, mockBranch));

  verify(mockProject, times(1)).getBranch();
  verify(mockProject).setBranch(mockBranch);
  verifyNoMoreInteractions(mockProject);

  verifyNoMoreInteractions(mockBranch);

  verifyNoMoreInteractions(mockHead);
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:18,代码来源:YamlProjectFactoryTest.java


示例13: testProjectAction_setBranchExceptionSaving

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testProjectAction_setBranchExceptionSaving() throws Exception {
  // We cannot mock 'equals', so stub it out to false.
  Branch oldBranch = new Branch(SOURCE_ID, mockHead, null /* scm */,
      ImmutableList.<BranchProperty>of()) {
      @Override
      public boolean equals(Object o) {
        return false;
      }
    };

  when(mockProject.getBranch()).thenReturn(oldBranch);
  when(mockBranch.getHead()).thenReturn(mockHead);
  when(mockBranch.getSourceId()).thenReturn(SOURCE_ID);

  // TODO(mattmoor): any way to verify that this gets logged?
  doThrow(new IOException("bleh")).when(mockProject).save();

  // Make sure it doesn't die.
  assertSame(mockProject, underTest.setBranch(mockProject, mockBranch));
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:23,代码来源:YamlProjectFactoryTest.java


示例14: getDescriptionShouldSetSuperDescriptionIfNotSet

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void getDescriptionShouldSetSuperDescriptionIfNotSet() {
    DeliveryPipelineView view = mock(DeliveryPipelineView.class);
    doCallRealMethod().when(view).getDescription();
    doCallRealMethod().when(view).setDescription(anyString());

    String description = view.getDescription();
    verify(view, times(1)).setDescription(anyString());
    assertNull(description);

    String expectedDescription = "some description";
    view.setDescription(expectedDescription);
    assertNotNull(view.getDescription());
    assertThat(view.getDescription(), is(expectedDescription));
    verify(view, times(2)).setDescription(anyString());

    view.getDescription();
    verify(view, times(2)).setDescription(anyString());
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:21,代码来源:DeliveryPipelineViewTest.java


示例15: testEqualsHashCode

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
@SuppressWarnings("all")
public void testEqualsHashCode() {
    UserInfo userInfo1 = new UserInfo("name", null);
    assertTrue(userInfo1.equals(userInfo1));
    UserInfo userInfo2 = new UserInfo("name", "http://nowhere.com");
    assertTrue(userInfo2.equals(userInfo1));

    assertFalse(userInfo2.equals(null));
    assertFalse(userInfo2.equals("name"));


    UserInfo userInfo3 = new UserInfo("name1", "http://nowhere.com");
    assertEquals(userInfo1.hashCode(), userInfo2.hashCode());
    assertNotEquals(userInfo1.hashCode(), userInfo3.hashCode());
    assertNotEquals(userInfo1, userInfo3);
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:19,代码来源:UserInfoTest.java


示例16: testHashcodeEquals

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testHashcodeEquals() {
    TriggerCause trigger1 = new TriggerCause(TriggerCause.TYPE_MANUAL, "manual trigger");
    TriggerCause trigger2 = new TriggerCause(TriggerCause.TYPE_MANUAL, "manual trigger");
    TriggerCause trigger3 = new TriggerCause(TriggerCause.TYPE_MANUAL, "manual");
    TriggerCause trigger4 = new TriggerCause(TriggerCause.TYPE_SCM, "manual");
    assertEquals(trigger1, trigger1);
    assertEquals(trigger1, trigger2);
    assertEquals(trigger1.hashCode(), trigger2.hashCode());
    assertNotEquals(trigger1, trigger3);
    assertNotEquals(trigger3, trigger4);
    assertNotEquals(trigger3, null);
    assertNotEquals(trigger3, "");
    assertNotEquals(trigger1.hashCode(), trigger3.hashCode());
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:17,代码来源:TriggerCauseTest.java


示例17: getDescriptionShouldSetSuperDescriptionIfNotSet

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void getDescriptionShouldSetSuperDescriptionIfNotSet() {
    WorkflowPipelineView view = mock(WorkflowPipelineView.class);
    doCallRealMethod().when(view).getDescription();
    doCallRealMethod().when(view).setDescription(anyString());

    String description = view.getDescription();
    verify(view, times(1)).setDescription(anyString());
    assertNull(description);

    String expectedDescription = "some description";
    view.setDescription(expectedDescription);
    assertNotNull(view.getDescription());
    assertThat(view.getDescription(), is(expectedDescription));
    verify(view, times(2)).setDescription(anyString());

    view.getDescription();
    verify(view, times(2)).setDescription(anyString());
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:21,代码来源:WorkflowPipelineViewTest.java


示例18: getDetails_noJenkins

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void getDetails_noJenkins() {
  assertThat(BuildStepDetailsProvider.all()).isEmpty();
  assertNull(BuildStepDetailsProvider.resolveDetails(mock(Maven.class)));
  assertNull(BuildStepDetailsProvider.resolveName(mock(BuildStep.class)));
}
 
开发者ID:GoogleCloudPlatform,项目名称:jenkins-deployment-manager-plugin,代码行数:8,代码来源:BuildStepDetailsProviderTest.java


示例19: testConvertCobertura

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@WithoutJenkins
@Test
public void testConvertCobertura() {
    CoverageResult result = getMockResult();
    CodeCoverageMetrics metrics = CoberturaCoverageProvider.convertCobertura(result);
    assertEquals(75.0f, metrics.getLineCoveragePercent(), 0.0f);
    assertEquals(0.0f, metrics.getPackageCoveragePercent(), 0.0f);
}
 
开发者ID:uber,项目名称:phabricator-jenkins-plugin,代码行数:9,代码来源:CoberturaCoverageProviderTest.java


示例20: testGettersWithLegacy

import org.jvnet.hudson.test.WithoutJenkins; //导入依赖的package包/类
@Test
@WithoutJenkins
public void testGettersWithLegacy() {
  underTest = new ExpiringBucketLifecycleManager(null /* bucket */,
      new MockUploadModule(executor), null /* ttl */,
      BUCKET_URI, TTL);
  assertEquals(BUCKET_URI, underTest.getBucket());
  assertEquals(TTL, underTest.getTtl());
}
 
开发者ID:jenkinsci,项目名称:google-storage-plugin,代码行数:10,代码来源:ExpiringBucketLifecycleManagerTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Awareness类代码示例发布时间:2022-05-22
下一篇:
Java Binding类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap