package org.geotools.data.store;

import org.geotools.feature.FeatureType;
import org.geotools.feature.FeatureTypes;

public class ReTypingFeatureCollectionTest extends
        FeatureCollectionWrapperTestSupport {

    public void testSchema() throws Exception {
        // see http://jira.codehaus.org/browse/GEOT-1616
        FeatureType original = delegate.getSchema();
        String newName = original.getTypeName() + "xxx";
        FeatureType renamed = FeatureTypes.newFeatureType(original
                .getAttributeTypes(), newName, original
                .getNamespace(), original.isAbstract(),
                original.getAncestors(), original.getDefaultGeometry());
        
        ReTypingFeatureCollection rtc = new ReTypingFeatureCollection(delegate, renamed);
        assertEquals(renamed, rtc.getSchema());
    }
}
