All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.base.GenericHTMLOutputModule Maven / Gradle / Ivy

There is a newer version: 2.0.7
Show newest version
package com.mockrunner.base;

import com.mockrunner.mock.web.WebMockObjectFactory;

/**
 * Generic implementation of {@link HTMLOutputModule}.
 * Can be used to to test HTML output in modules that
 * do not extend {@link HTMLOutputModule}.
 */
public class GenericHTMLOutputModule extends HTMLOutputModule
{
    private WebMockObjectFactory factory;
    
    public GenericHTMLOutputModule(WebMockObjectFactory factory)
    {
        super(factory);
        this.factory = factory;
    }
    
    public String getOutput()
    {
        try
        {
            factory.getMockResponse().getWriter().flush();    
        }
        catch(Exception ignored)
        {
        
        }
        return factory.getMockResponse().getOutputStreamContent();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy