CommonAuthorityFactoryTest changes for revisions 26211:26212

This change does not apply to SIS since we did not ported any of the AuthorityDecorator.

Command line:

svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r26211:26212 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/test/java/org/geotools/referencing/factory/wms/CRSTest.java
Revision 26211Revision 26212
import java.util.Collection;
import java.util.logging.Level;

// JUnit dependencies
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

// OpenGIS dependencies
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.GeographicCRS;
import org.opengis.referencing.crs.CRSAuthorityFactory;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

// Geotools dependencies
import org.geotools.referencing.CRS;
import org.geotools.resources.Arguments;
import org.geotools.referencing.ReferencingFactoryFinder;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.referencing.factory.IdentifiedObjectFinder;
import org.geotools.referencing.factory.AbstractAuthorityFactory;
import org.geotools.referencing.factory.ThreadedAuthorityFactory;


/**
 * Tests {@link WebCRSFactory}.
 *
import java.util.Collection;
import java.util.logging.Level;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.geotools.referencing.CRS;
import org.geotools.referencing.ReferencingFactoryFinder;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.geotools.referencing.factory.AbstractAuthorityFactory;
import org.geotools.referencing.factory.CachedCRSAuthorityDecorator;
import org.geotools.referencing.factory.IdentifiedObjectFinder;
import org.geotools.resources.Arguments;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CRSAuthorityFactory;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeographicCRS;

/**
 * Tests {@link WebCRSFactory}.
 *
/**
 * The factory to test.
 */
private AbstractAuthorityFactory factory;

/**
 * Run the suite from the command line.
/**
 * The factory to test.
 */
private WebCRSFactory factory;

/**
 * Run the suite from the command line.
 * The objects found are expected to be cached.
 */
public void testBufferedFind() throws FactoryException {
    final AbstractAuthorityFactory factory = new Buffered(this.factory);
    final GeographicCRS CRS84 = factory.createGeographicCRS("CRS:84");
    final IdentifiedObjectFinder finder = factory.getIdentifiedObjectFinder(CoordinateReferenceSystem.class);
 * The objects found are expected to be cached.
 */
public void testBufferedFind() throws FactoryException {
    final AbstractAuthorityFactory factory = new CachedCRSAuthorityDecorator(this.factory);
    final GeographicCRS CRS84 = factory.createGeographicCRS("CRS:84");
    final IdentifiedObjectFinder finder = factory.getIdentifiedObjectFinder(CoordinateReferenceSystem.class);
        assertEquals("CRS:84", finder.findIdentifier(DefaultGeographicCRS.WGS84));
    }

    /**
     * For {@link #testBufferedFind}.
     */
    private static final class Buffered extends ThreadedAuthorityFactory implements CRSAuthorityFactory {
        Buffered(final AbstractAuthorityFactory factory) {
            super(factory);
        }
    }
}
    assertEquals("CRS:84", finder.findIdentifier(DefaultGeographicCRS.WGS84));
}

    }