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

Examples of com.sonyericsson.hudson.plugins.metadata.model.values.StringMetadataValue


        if (o instanceof String && !o.equals("")) {
            value = (String)o;
        } else if (choices.size() > 0) { //if for some reason nothing is chosen, take the first in the list.
            value = choices.get(0);
        }
        StringMetadataValue metadataValue =
                new StringMetadataValue(getName(), getDescription(), value, isExposedToEnvironment());
        return metadataValue;
    }
View Full Code Here


    public StringMetadataValue createValue(Object o) {
        String value = defaultValue;
        if (o instanceof String && !o.equals("")) {
            value = (String)o;
        }
        StringMetadataValue metadataValue =
                new StringMetadataValue(getName(), getDescription(), value, isExposedToEnvironment());
        return metadataValue;
    }
View Full Code Here

     */
    public void testSearchAndOperator() throws Exception {
        FreeStyleProject project = createFreeStyleProject("open");
        FreeStyleProject project2 = createFreeStyleProject("secure");
        List<MetadataValue> list = new LinkedList<MetadataValue>();
        StringMetadataValue name = new StringMetadataValue("name", "description", "somc");
        StringMetadataValue dept = new StringMetadataValue("dept", "description", "tool");
        list.add(name);
        list.add(dept);
        MetadataJobProperty property = project.getProperty(MetadataJobProperty.class);
        property.addChildren(list);
        list = new LinkedList<MetadataValue>();
        name = new StringMetadataValue("name", "description", "somc");
        list.add(name);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("name=somc && dept=tool");
        TopLevelItem tli1 = project;
View Full Code Here

     */
    public void testSearchOrOperator() throws Exception {
        FreeStyleProject project = createFreeStyleProject("open");
        FreeStyleProject project2 = createFreeStyleProject("secure");
        List<MetadataValue> list = new LinkedList<MetadataValue>();
        StringMetadataValue name = new StringMetadataValue("name", "description", "somc");
        StringMetadataValue dept = new StringMetadataValue("dept", "description", "tool");
        list.add(name);
        list.add(dept);
        MetadataJobProperty property = project.getProperty(MetadataJobProperty.class);
        property.addChildren(list);
        list = new LinkedList<MetadataValue>();
        name = new StringMetadataValue("name", "description", "somc");
        list.add(name);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("name=somc || dept=tool");
        TopLevelItem tli1 = project;
View Full Code Here

     */
    public void testSearchEqualOperator() throws Exception {
        FreeStyleProject project = createFreeStyleProject("open");
        FreeStyleProject project2 = createFreeStyleProject("secure");
        List<MetadataValue> list = new LinkedList<MetadataValue>();
        StringMetadataValue name = new StringMetadataValue("name", "description", "somc");
        StringMetadataValue dept = new StringMetadataValue("dept", "description", "tool");
        list.add(name);
        list.add(dept);
        MetadataJobProperty property = project.getProperty(MetadataJobProperty.class);
        property.addChildren(list);
        list = new LinkedList<MetadataValue>();
        name = new StringMetadataValue("name", "description", "somc");
        list.add(name);
        MetadataJobProperty property2 = project2.getProperty(MetadataJobProperty.class);
        property2.addChildren(list);
        MetadataQuerySearch mqs = MetadataQuerySearch.parseQuery("dept=tool");
        TopLevelItem tli1 = project;
View Full Code Here

        TreeNodeMetadataValue buildNode = TreeStructureUtil.createPath(build.getResult().toString(), "",
                "build", "result");
        AbstractMetadataValue mdv = new NumberMetadataValue("ms", build.getDuration());
        mdv.setGenerated(true);
        TreeStructureUtil.addValue(buildNode, mdv, "duration");
        mdv = new StringMetadataValue("display", build.getDurationString());
        mdv.setGenerated(true);
        TreeStructureUtil.addValue(buildNode, mdv, "duration");
        TreeStructureUtil.addValue(buildNode, build.getBuiltOnStr(), null, "builtOn");
        TreeStructureUtil.addValue(buildNode, build.getTimestamp(), null, true, false, "scheduled");
        List<MetadataValue> values = new LinkedList<MetadataValue>();
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testDoUpdate() throws Exception {
        String value = (new StringMetadataValue("owner", "bobby")).toJson().toString();
        boolean exposed = true;
        JSONObject expectedJson = new JSONObject();
        expectedJson.put("type", "ok");
        expectedJson.put("errorCode", 0);
        expectedJson.put("message", "OK");
View Full Code Here

     *
     * @throws Exception if so.
     */
    @Test
    public void testDoUpdateWithReplace() throws Exception {
        StringMetadataValue value = new StringMetadataValue("owner", "bobby");
        String replace = (new StringMetadataValue("owner", "Tomas")).toJson().toString();


        JSONObject expectedJson = new JSONObject();
        expectedJson.put("type", "ok");
        expectedJson.put("errorCode", 0);
View Full Code Here

     * @throws Exception if so.
     */
    @Test
    public void testDoGet() throws Exception {

        StringMetadataValue metadataValue = new StringMetadataValue("owner", "bobby");
        TreeNodeMetadataValue node = new TreeNodeMetadataValue("container",
                Collections.<MetadataValue>singletonList(metadataValue));

        JSONObject jsonObject = node.toJson();

View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.metadata.model.values.StringMetadataValue

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.