Package com.sonyericsson.hudson.plugins.metadata.model

Examples of com.sonyericsson.hudson.plugins.metadata.model.MetadataParent


     */
    public static String prettyPrint(MetadataValue value, String tabs) {
        StringBuffer str = new StringBuffer(tabs);
        str.append(value.getName()).append("\n");
        if (value instanceof MetadataParent) {
            MetadataParent node = (MetadataParent)value;
            prettyPrint(node.getChildren(), tabs + "\t");
        }
        return str.toString();
    }
View Full Code Here


     *
     * @param metadata the Metadata to find a MetadataContainer for.
     * @return the first MetadataContainer ancestor.
     */
    public static MetadataContainer getContainer(Metadata metadata) {
        MetadataParent currentParent = metadata.getParent();
        while (!(currentParent instanceof MetadataContainer)) {
            if (currentParent instanceof Metadata) {
                currentParent = ((Metadata)currentParent).getParent();
            } else {
                return null;
View Full Code Here

        when(hudson.getNode("theNode")).thenReturn(node);
        DescribableList describableList = mock(DescribableList.class);
        when(node.getNodeProperties()).thenReturn(describableList);
        MetadataNodeProperty property = mock(MetadataNodeProperty.class);
        when(describableList.get(MetadataNodeProperty.class)).thenReturn(property);
        MetadataParent container = CliUtils.getContainer("theNode", null, null, false);
        assertNotNull(container);
        assertSame(property, container);
    }
View Full Code Here

        Node node = mock(Node.class);
        when(hudson.getNode("theNode")).thenReturn(node);
        DescribableList describableList = mock(DescribableList.class);
        when(node.getNodeProperties()).thenReturn(describableList);
        when(describableList.get(MetadataNodeProperty.class)).thenReturn(null);
        MetadataParent container = CliUtils.getContainer("theNode", null, null, true);
        assertNotNull(container);

        verify(describableList).add(same(container));
        assertSame(node, Whitebox.getInternalState(container, "node"));
    }
View Full Code Here

        when(hudson.getItem("theJob")).thenReturn(project);
        FreeStyleBuild build = mock(FreeStyleBuild.class);
        when(project.getBuildByNumber(1)).thenReturn(build);
        when(build.getAction(MetadataBuildAction.class)).thenReturn(null);

        MetadataParent container = CliUtils.getContainer(null, "theJob", 1, true);
        assertNotNull(container);
        verify(build).addAction(isA(MetadataBuildAction.class));
    }
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.metadata.model.MetadataParent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.