Package org.apache.sis.metadata.iso.identification

Examples of org.apache.sis.metadata.iso.identification.DefaultDataIdentification


        keywords.setKeywords(Arrays.asList(
                new SimpleInternationalString("Apple"),
                new SimpleInternationalString("Orange"),
                new SimpleInternationalString("Kiwi")));

        final DefaultDataIdentification identification = new DefaultDataIdentification();
        identification.setDescriptiveKeywords(Collections.singleton(keywords));
        identification.setTopicCategories(Arrays.asList(
                TopicCategory.HEALTH,
                TopicCategory.valueOf("OCEANS"), // Existing category
                TopicCategory.valueOf("test"))); // Custom category

        final String text = format.format(identification.asTreeTable());
        assertMultilinesEquals(
            "Data identification\n" +
            "  ├─Topic category (1 of 3)…… Health\n" +
            "  ├─Topic category (2 of 3)…… Oceans\n" +
            "  ├─Topic category (3 of 3)…… Test\n" +
View Full Code Here


     * @throws JAXBException If an error occurred while marshaling the XML.
     */
    @Test
    public void testExtraCodes() throws JAXBException {
        final Marshaller marshaller = pool.acquireMarshaller();
        final DefaultDataIdentification id = new DefaultDataIdentification();
        id.setTopicCategories(Arrays.asList(
                TopicCategory.valueOf("oceans"), // New code
                TopicCategory.valueOf("OCEANS"), // Existing code with UML id="oceans"
                TopicCategory.valueOf("test"))); // New code

        final String xml = marshal(marshaller, id);
View Full Code Here

     */
    @Test
    public void testLinkOnly() throws JAXBException, URISyntaxException {
        final XLink xlink = new XLink();
        xlink.setHRef(new URI("http://test.net"));
        final DefaultDataIdentification identification = new DefaultDataIdentification();
        identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
        final DefaultMetadata metadata = new DefaultMetadata();
        metadata.setIdentificationInfo(Collections.singleton(identification));

        assertXmlEquals(LINK_ONLY_XML, XML.marshal(metadata), "xmlns:*");
        verify(true, unmarshal(DefaultMetadata.class, LINK_ONLY_XML));
View Full Code Here

     */
    @Test
    public void testWithElement() throws JAXBException, URISyntaxException {
        final XLink xlink = new XLink();
        xlink.setHRef(new URI("http://test.net"));
        final DefaultDataIdentification identification = new DefaultDataIdentification();
        identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
        identification.setAbstract(new SimpleInternationalString("This is a test."));
        final DefaultMetadata metadata = new DefaultMetadata();
        metadata.setIdentificationInfo(Collections.singleton(identification));

        assertXmlEquals(LINK_WITH_ELEMENT_XML, XML.marshal(metadata), "xmlns:*");
        final DefaultMetadata unmarshal = unmarshal(DefaultMetadata.class, LINK_WITH_ELEMENT_XML);
View Full Code Here

        keywords.setKeywords(Arrays.asList(
                new SimpleInternationalString("Apple"),
                new SimpleInternationalString("Orange"),
                new SimpleInternationalString("Kiwi")));

        final DefaultDataIdentification identification = new DefaultDataIdentification();
        identification.setDescriptiveKeywords(Collections.singleton(keywords));
        identification.setTopicCategories(Arrays.asList(
                TopicCategory.HEALTH,
                TopicCategory.valueOf("OCEANS"), // Existing category
                TopicCategory.valueOf("test"))); // Custom category

        final String text = format.format(identification.asTreeTable());
        assertMultilinesEquals(
            "Data identification\n" +
            "  ├─Descriptive keywords\n" +
            "  │   ├─Keyword (1 of 3)…………… Apple\n" +
            "  │   ├─Keyword (2 of 3)…………… Orange\n" +
View Full Code Here

    /**
     * Creates the metadata objects to be used for the test.
     */
    public PrunerTest() {
        metadata       = new DefaultMetadata();
        identification = new DefaultDataIdentification();
        extent         = new DefaultExtent();
        bbox           = new DefaultGeographicBoundingBox();
        extent.getGeographicElements().add(bbox);
        identification.getExtents().add(extent);
        metadata.getIdentificationInfo().add(identification);
View Full Code Here

     *
     * @throws JAXBException If an error occurred while marshaling the XML.
     */
    @Test
    public void testExtraCodes() throws JAXBException {
        final DefaultDataIdentification id = new DefaultDataIdentification();
        id.setTopicCategories(Arrays.asList(
                TopicCategory.valueOf("oceans"), // New code
                TopicCategory.valueOf("OCEANS"), // Existing code with UML id="oceans"
                TopicCategory.valueOf("test"))); // New code

        final String xml = marshal(id);
View Full Code Here

TOP

Related Classes of org.apache.sis.metadata.iso.identification.DefaultDataIdentification

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.