Package org.andromda.core.transformation

Source Code of org.andromda.core.transformation.XslTransformerTest

package org.andromda.core.transformation;

import java.io.InputStream;

import java.net.URL;

import junit.framework.TestCase;

import org.andromda.core.configuration.Transformation;


/**
* Tests the {@link org.andromda.core.transformation.XslTransformer}
*
* @author Chad Brandon
*/
public class XslTransformerTest
    extends TestCase
{
    public void testTransform()
    {
        Transformer transformer = new XslTransformer();
        assertNull(transformer.transform(
                null,
                new Transformation[0]));

        URL modelUrl = XslTransformerTest.class.getResource("model.xml");
        assertNotNull(modelUrl);
        URL transformation1Uri = XslTransformerTest.class.getResource("transformation1.xsl");
        assertNotNull(transformation1Uri);
        URL transformation2Uri = XslTransformerTest.class.getResource("transformation2.xsl");
        assertNotNull(transformation2Uri);
        Transformation transformation1 = new Transformation();
        transformation1.setUri(transformation1Uri.toString());
        Transformation transformation2 = new Transformation();
        transformation2.setUri(transformation2Uri.toString());
        Transformation[] transformations = new Transformation[] {transformation1, transformation2};
        InputStream stream = transformer.transform(modelUrl.toString(), transformations);
        assertNotNull(stream);
    }
}
TOP

Related Classes of org.andromda.core.transformation.XslTransformerTest

TOP
Copyright © 2018 www.massapi.com. 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.