[ 
http://jira.magnolia-cms.com/browse/MAGNOLIA-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=25591#action_25591
 ] 

Ryan Gardner commented on MAGNOLIA-2969:
----------------------------------------

In the latest, it's using a Jackrabbit ISO8061 util class to do the date 
exporting. I did try using Magnolia's DateUtils, but it requires a valid Locale 
it seems to work so I switched back to this ISO8061 class because it works and 
doesn't require a Locale. DateUtils could probably have a new method added that 
would do the same function (heck, and because of the license of the Jackrabbit, 
you could probably just copypasta their util class into it and put a note in 
your source saying that's where it's from)

This version makes some of the content filter selection in the related patch a 
bit irrelevant since it will always export the metadata nodes if they are there 
(the developer can just delete them if he doesn't want them in his test 
properties).

I've already used this a few times to generate test data from both the config 
and data repositories and it works nicely.  

> Enhance magnolia propertiesImportExporter to handle Dates, and to export to a 
> properties file
> ---------------------------------------------------------------------------------------------
>
>                 Key: MAGNOLIA-2969
>                 URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2969
>             Project: Magnolia
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 4.2.1
>            Reporter: Ryan Gardner
>            Assignee: Grégory Joseph
>         Attachments: enhancePropertyExporting2.patch, 
> propertiesExporting3.patch
>
>
> In my opinion, one of the biggest hassles in creating a unit test for 
> something that is driven by data in a repository is creating the properties 
> file to drive the test. 
> There was a mostly-implemented properties exporter in core but it didn't 
> support writing out the data in the same format that it reads it in (namely, 
> it didn't write the @uuid information or the @type information that it 
> supports when importing from a properties file)
> This patch enhances the importer / exporter to the point where you can dump 
> out content to a Properties or to a string representation of the properties. 
> In addition, the Date nodes weren't dumped properly before. I added in some 
> basic support for dumping and retrieving the Calendar objects from the 
> properties file. 
> I think that this, combined with another patch I'm about to submit that adds 
> a "dump to properties format" to the JCR Queries page in Admin Interface 
> should greatly reduce the pain for creating unit tests that operate using 
> data from a repository.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <dev-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to