package org.ajax4jsf.portlet.application;

import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UIOutput;

import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;

public class ComponensLoaderTestCase extends AbstractAjax4JsfTestCase {
    
    ComponentsLoaderImpl loader;

    public ComponensLoaderTestCase(String name) {
	super(name);
    }

    public void setUp() throws Exception {
	super.setUp();
	loader = new ComponentsLoaderImpl();
    }

    public void tearDown() throws Exception {
	super.tearDown();
	loader = null;
    }

    public final void testCreateComponent() {
	UIComponent component = loader.createComponent(UIInput.class.getName());	
	assertSame(UIInput.class, component.getClass());
	UIComponent component1 = loader.createComponent(UIOutput.class.getName());	
	assertSame(UIOutput.class, component1.getClass());
    }

    public final void testTransform() {
	Object inputClass = loader.transform(UIInput.class.getName());
	assertSame(UIInput.class, inputClass);
    }

}
