本文整理汇总了Java中hudson.util.DescribableList.get方法的典型用法代码示例。如果您正苦于以下问题:Java DescribableList.get方法的具体用法?Java DescribableList.get怎么用?Java DescribableList.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.util.DescribableList
的用法示例。
在下文中一共展示了DescribableList.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: localRootPathToNodeMountPoint
import hudson.util.DescribableList; //导入方法依赖的package包/类
@LocalData
@Test
public void localRootPathToNodeMountPoint() throws Exception {
// The node configuration version 1.0.0 contains a localRootPath field.
// This tests that future versions load this field as nodeMountPoint,
// in other words it tests NodeDisk.readResolve()
Computer computer = jr.getInstance().getComputer("node1");
Node node = computer.getNode();
DescribableList<NodeProperty<?>,NodePropertyDescriptor> props = node.getNodeProperties();
ExternalWorkspaceProperty exwsProp = props.get(ExternalWorkspaceProperty.class);
List<NodeDiskPool> diskPools = exwsProp.getNodeDiskPools();
assertThat(diskPools.size(), is(1));
NodeDiskPool diskPool = diskPools.get(0);
assertThat(diskPool.getDiskPoolRefId(), is ("dp1"));
List<NodeDisk> disks = diskPool.getNodeDisks();
assertThat(disks.size(), is(1));
NodeDisk disk = disks.get(0);
assertThat(disk.getDiskRefId(), is("d1"));
assertThat(disk.getNodeMountPoint(), is("/tmp/dp1/d1"));
}
示例2: findItemWithBuildWrapper
import hudson.util.DescribableList; //导入方法依赖的package包/类
private static <T extends BuildWrapper> BuildWrapperItem<T> findItemWithBuildWrapper(final AbstractItem buildItem, Class<T> buildWrapperClass) {
if (buildItem == null) {
return null;
}
if (buildItem instanceof BuildableItemWithBuildWrappers) {
BuildableItemWithBuildWrappers buildWrapper = (BuildableItemWithBuildWrappers) buildItem;
DescribableList<BuildWrapper, Descriptor<BuildWrapper>> buildWrappersList = buildWrapper.getBuildWrappersList();
if (buildWrappersList != null && !buildWrappersList.isEmpty()) {
return new BuildWrapperItem<T>(buildWrappersList.get(buildWrapperClass), buildItem);
}
}
if (buildItem.getParent() instanceof AbstractItem) {
return findItemWithBuildWrapper((AbstractItem) buildItem.getParent(), buildWrapperClass);
}
return null;
}
示例3: verifyPublishers
import hudson.util.DescribableList; //导入方法依赖的package包/类
private void verifyPublishers(DescribableList<Publisher, Descriptor<Publisher>> publishers) {
assertThat("Should add publisher", publishers, hasSize(2));
assertThat("Should add status publisher", publishers.get(0), instanceOf(GitHubPRBuildStatusPublisher.class));
assertThat("Should add 2 packages",
((GitHubPRBuildStatusPublisher) publishers.get(0)).getStatusMsg().getContent(),
equalTo(JOB_DSL_PUBLISHER_TEXT_CONTENT));
assertThat("Has comment publisher", publishers.get(1), instanceOf(GitHubPRCommentPublisher.class));
GitHubPRCommentPublisher commentPublisher = (GitHubPRCommentPublisher) publishers.get(1);
assertThat("Comment matches", commentPublisher.getComment().getContent(), equalTo("comment"));
assertThat("Only failed builds", commentPublisher.getStatusVerifier().getBuildStatus(), equalTo(Result.FAILURE));
assertThat("Publish marked as failure", commentPublisher.getErrorHandler().getBuildStatus(), equalTo(Result.FAILURE));
}