use of org.jvnet.hudson.test.WithoutJenkins in project blueocean-plugin by jenkinsci.
the class OrganizationFolderTest method testOrgFolderPipeline.
@Test
@WithoutJenkins
public void testOrgFolderPipeline() throws IOException {
AvatarMetadataAction avatarMetadataAction = mock(AvatarMetadataAction.class);
when(orgFolder.getAction(AvatarMetadataAction.class)).thenReturn(avatarMetadataAction);
BlueOrganizationFolder organizationFolder = new OrganizationFolderPipelineImpl(organization, orgFolder, organization.getLink().rel("/pipelines/")) {
};
assertEquals(organizationFolder.getName(), organizationFolder.getName());
assertEquals(organizationFolder.getDisplayName(), organizationFolder.getDisplayName());
assertEquals(organization.getName(), organizationFolder.getOrganizationName());
assertNotNull(organizationFolder.getIcon());
MultiBranchProject multiBranchProject = PowerMockito.mock(MultiBranchProject.class);
when(orgFolder.getItem("repo1")).thenReturn(multiBranchProject);
PowerMockito.when(OrganizationFactory.getInstance().getContainingOrg((ItemGroup) multiBranchProject)).thenReturn(organization);
PowerMockito.when(multiBranchProject.getFullName()).thenReturn("p1");
PowerMockito.when(multiBranchProject.getName()).thenReturn("p1");
MultiBranchPipelineContainerImpl multiBranchPipelineContainer = new MultiBranchPipelineContainerImpl(organization, orgFolder, organizationFolder);
assertEquals(multiBranchProject.getName(), multiBranchPipelineContainer.get("repo1").getName());
when(orgFolder.getItems()).thenReturn(Collections.singletonList(multiBranchProject));
assertNotNull(organizationFolder.getPipelineFolderNames());
}
use of org.jvnet.hudson.test.WithoutJenkins in project phabricator-jenkins-plugin by uber.
the class CoberturaCoverageProviderTest method testConvertCobertura.
@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);
}
use of org.jvnet.hudson.test.WithoutJenkins in project blueocean-plugin by jenkinsci.
the class OrganizationFolderTest method testOrgFolderRun.
@Test
@WithoutJenkins
public void testOrgFolderRun() {
OrganizationFolderPipelineImpl organizationFolder = new OrganizationFolderPipelineImpl(mockOrganization(), orgFolder, new Link("/a/b/")) {
};
OrganizationFolderRunImpl organizationFolderRun = new OrganizationFolderRunImpl(organizationFolder, new Reachable() {
@Override
public Link getLink() {
return new Link("/a/b/");
}
});
assertEquals(orgFolder.getName(), organizationFolderRun.getPipeline());
assertEquals(organization.getName(), organizationFolderRun.getOrganization());
assertNotNull(organizationFolder.getRuns());
}
Aggregations