Package org.opengis.metadata.citation

Examples of org.opengis.metadata.citation.Citation


                "    <gco:CharacterString>A title</gco:CharacterString>\n" +
                "  </gmd:title>\n" +
                "  <gmd:series gco:nilReason=\"other:myReason\"/>\n" +
                "</gmd:CI_Citation>";

        final Citation citation = (Citation) XML.unmarshal(expected);
        assertEquals("title", "A title", citation.getTitle().toString());

        final Series series = citation.getSeries();
        assertInstanceOf("Should have instantiated a proxy.", NilObject.class, series);

        final NilReason reason = ((NilObject) series).getNilReason();
        assertEquals("NilReason.explanation", "myReason", reason.getOtherExplanation());
        assertNull("NilReason.URI", reason.getURI());
View Full Code Here


                "    <gco:CharacterString>A title</gco:CharacterString>\n" +
                "  </gmd:title>\n" +
                "  <gmd:series gco:nilReason=\"http://www.myreason.org\"/>\n" +
                "</gmd:CI_Citation>";

        final Citation citation = (Citation) XML.unmarshal(expected);
        assertEquals("title", "A title", citation.getTitle().toString());

        final Series series = citation.getSeries();
        assertInstanceOf("Should have instantiated a proxy.", NilObject.class, series);

        final NilReason reason = ((NilObject) series).getNilReason();
        assertNull("NilReason.explanation", reason.getOtherExplanation());
        assertEquals("NilReason.URI", "http://www.myreason.org", String.valueOf(reason.getURI()));
View Full Code Here

     *
     * @throws JAXBException Should never happen.
     */
    @Test
    public void testIdentification() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(IDENTIFIED_XML);
        assertEquals("title", "My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertFalse("Unexpected proxy", Proxy.isProxyClass(series.getClass()));
        assertInstanceOf("Expected IdentifiedObject", IdentifiedObject.class, series);
        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
        assertEquals("series", "My aggregate dataset",  series.getName().toString());
        assertNull  ("href", map.get(IdentifierSpace.HREF));
View Full Code Here

     *
     * @throws JAXBException Should never happen.
     */
    @Test
    public void testReference() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML_WITH_BODY);
        assertEquals("Citation.title""My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
        assertFalse     ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
        assertEquals    ("Citation.series.name", "My aggregate dataset", series.getName().toString());
        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
        assertNull  ("href",             map.get(IdentifierSpace.HREF));
View Full Code Here

     * @throws JAXBException Should never happen.
     */
    @Test
    @DependsOnMethod("testReference")
    public void testReferenceInEmptyObject() throws JAXBException {
        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML);
        assertEquals("Citation.title""My data", citation.getTitle().toString());
        /*
         * Programmatic verification of the Series properties,
         * which is the main object of interest in this test.
         */
        final Series series = citation.getSeries();
        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
        assertNull      ("Citation.series.name", series.getName());
        assertTrue      ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
        assertInstanceOf("Citation.series", NilObject.class, series);
        assertEquals    ("Series[{gco:uuid=“" + UUID_VALUE + "”}]", series.toString());
View Full Code Here

     *               or {@code null} if none.
     */
    public static <T extends Identifier> void replace(final Collection<T> identifiers, final Collection<T> oldIds) {
        if (oldIds != null && identifiers != null) {
            for (final T old : oldIds) {
                final Citation authority = old.getAuthority();
                for (final Iterator<T> it=identifiers.iterator(); it.hasNext();) {
                    final T id = it.next();
                    if (id == null || id.getAuthority() == authority) {
                        it.remove();
                    }
View Full Code Here

     * Returns a pseudo-WKT representation for debugging purpose.
     */
    @Override
    public String toString() {
        final String code, codespace;
        final Citation authority;
        final ReferenceIdentifier id = referenceSystemIdentifier;
        if (id != null) {
            code      = id.getCode();
            codespace = id.getCodeSpace();
            authority = id.getAuthority();
View Full Code Here

            final Iterator<? extends Identifier> it = identifiers;
            if (it != null) {
                while (it.hasNext()) {
                    final Identifier identifier = it.next();
                    if (identifier != null) {
                        final Citation authority = identifier.getAuthority();
                        final Boolean state = put(authority, Boolean.FALSE);
                        if (state == null) {
                            if (identifier instanceof IdentifierMapEntry) {
                                next = (IdentifierMapEntry) identifier;
                            } else {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        factory = new EPSGCRSAuthorityFactory();
    }
    public void testAuthority(){
        Citation authority = factory.getAuthority();

        assertNotNull( authority );
        assertEquals( "European Petroleum Survey Group", authority.getTitle().toString() );
        assertTrue( Citations.identifierMatches(authority, "EPSG" ) );
    }
View Full Code Here

        assertEquals( "European Petroleum Survey Group", authority.getTitle().toString() );
        assertTrue( Citations.identifierMatches(authority, "EPSG" ) );
    }

    public void testVendor(){
        Citation vendor = factory.getVendor();
        assertNotNull( vendor );
        assertEquals( "Geotools", vendor.getTitle().toString() );
    }
View Full Code Here

TOP

Related Classes of org.opengis.metadata.citation.Citation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.