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

Examples of com.sonyericsson.hudson.plugins.metadata.model.definitions.DateMetadataDefinition


     */
    public void testDateConversion() throws Exception {
        Calendar calendar = Calendar.getInstance();
        TimeDetails details = new TimeDetails(
                calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE), calendar.get(Calendar.SECOND));
        DateMetadataDefinition def = new DateMetadataDefinition("date", "",
                calendar.get(Calendar.YEAR),
                calendar.get(Calendar.MONTH),
                calendar.get(Calendar.DAY_OF_MONTH),
                details,
                false);
        List<AbstractMetadataDefinition> list = new LinkedList<AbstractMetadataDefinition>();
        list.add(def);
        PluginImpl.getInstance().setDefinitions(list);
        FreeStyleProject freeStyleProject = createFreeStyleProject();
        configRoundtrip(freeStyleProject);
        MetadataJobProperty property = freeStyleProject.getProperty(MetadataJobProperty.class);
        assertNotNull("No MetadataJobProperty", property);
        DateMetadataValue dateValue = (DateMetadataValue)TreeStructureUtil.getLeaf(property, "date");
        assertNotNull(dateValue);
        assertEquals(def.getHour(), dateValue.getHour());
        assertEquals(def.getMinute(), dateValue.getMinute());
        assertEquals(def.getSecond(), dateValue.getSecond());
        assertEquals(def.getDay(), dateValue.getDay());
        assertEquals(def.getMonth(), dateValue.getMonth());
        assertEquals(def.getYear(), dateValue.getYear());
    }
View Full Code Here

TOP

Related Classes of com.sonyericsson.hudson.plugins.metadata.model.definitions.DateMetadataDefinition

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.