Package com.ecyrd.jspwiki.content

Source Code of com.ecyrd.jspwiki.content.ExporterTest

package com.ecyrd.jspwiki.content;

import java.io.ByteArrayOutputStream;
import java.util.Properties;

import junit.framework.TestCase;

import com.ecyrd.jspwiki.TestEngine;
import com.ecyrd.jspwiki.WikiEngine;
import com.ecyrd.jspwiki.providers.ProviderException;

public class ExporterTest extends TestCase
{
    private TestEngine m_engine;
   
    protected void setUp() throws Exception
    {
        super.setUp();
       
        Properties props = new Properties();
       
        props.load( TestEngine.findTestProperties() );

        props.setProperty( WikiEngine.PROP_MATCHPLURALS, "true" );
       
        TestEngine.emptyWorkDir();
        m_engine = new TestEngine(props)
    }

    protected void tearDown() throws ProviderException
    {
        m_engine.deletePage("FooBar");
    }
   
    // FIXME: Not yet completed.
    public void testExport1() throws Exception
    {
        m_engine.saveText( "FooBar", "test" );

        m_engine.addAttachment( "FooBar", "test.jpg", "1234567890".getBytes() );
       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
       
        Exporter x = new Exporter(out,false);
       
        x.export(m_engine);
       
        String res = out.toString( "UTF-8" );
       
        System.out.println("Result is");
        System.out.println(res);
    }
}
TOP

Related Classes of com.ecyrd.jspwiki.content.ExporterTest

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.