001package org.kuali.ole.docstore.common.document;
002
003import org.apache.commons.io.FileUtils;
004import org.apache.log4j.Logger;
005import org.junit.Test;
006import org.kuali.ole.docstore.common.util.ParseXml;
007
008import java.io.File;
009
010/**
011 * Created with IntelliJ IDEA.
012 * User: chenchulakshmig
013 * Date: 2/27/14
014 * Time: 4:20 PM
015 * To change this template use File | Settings | File Templates.
016 */
017public class Licenses_UT {
018    private static final Logger LOG = Logger.getLogger(Licenses_UT.class);
019
020    @Test
021    public void deserializeAndSerialize() {
022        String input = "";
023        File file = null;
024        try {
025            file = new File(getClass().getResource("/documents/Licenses1.xml").toURI());
026            input = FileUtils.readFileToString(file);
027        } catch (Exception e) {
028            LOG.error("Exception :", e);
029        }
030        Licenses licenses = new Licenses();
031        licenses = (Licenses) Licenses.deserialize(input);
032        String serializeXml = licenses.serialize(licenses);
033        serializeXml = ParseXml.formatXml(serializeXml);
034        System.out.print(serializeXml);
035    }
036}