/** Tests the constructor. */ @Test public void testConstructor() { final Citation citation = Citations.EPSG; PropertyAccessor accessor; assertNull( "No dummy interface expected.", PropertyAccessor.getType(citation.getClass(), "org.opengis.dummy")); accessor = createPropertyAccessor(citation); assertTrue("Count of 'get' methods.", accessor.count() >= 13); }
/** * Returns the metadata interface implemented by the specified implementation. Only one metadata * interface can be implemented. * * @param metadata The metadata implementation to wraps. * @return The single interface, or {@code null} if none where found. */ private Class<?> getType(final Class<?> implementation) { return PropertyAccessor.getType(implementation, interfacePackage); }
/** Creates a property accessor for the given citation. */ private static PropertyAccessor createPropertyAccessor(final Citation citation) { final Class<?> implementation = citation.getClass(); final Class<?> type = PropertyAccessor.getType(implementation, "org.opengis.metadata"); assertNotNull(type); return new PropertyAccessor(implementation, type); }