Package org.apache.marmotta.commons.sesame.facading.locale.model

Examples of org.apache.marmotta.commons.sesame.facading.locale.model.LocaleFacade


        try {
            connection.begin();
            final Facading facading = FacadingFactory.createFacading(connection);

            final URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/locale");
            final LocaleFacade f = facading.createFacade(uri, LocaleFacade.class);

            f.setLabel(lbl);
            assertEquals(lbl, f.getLabel());
            assertNull(f.getLabel(none));

            f.setLabel(lbl_de, de);
            f.setLabel(lbl_en, en);
            assertEquals(lbl_de, f.getLabel(de));
            assertEquals(lbl_en, f.getLabel(en));
            assertNull(f.getLabel(none));

            f.setLabel(null);
            assertNull(f.getLabel());
            assertNull(f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertNull(f.getLabel(none));

            f.setLabel(lbl_de, de);
            f.setLabel(lbl_en, en);
            f.setLabel(lbl_fr, fr);
            f.setLabel(lbl_none, none);
            assertEquals(lbl_de, f.getLabel(de));
            assertEquals(lbl_en, f.getLabel(en));
            assertEquals(lbl_fr, f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            assertThat(f.getLabel(), anyOf(is(lbl_de), is(lbl_en), is(lbl_fr), is(lbl_none)));

            f.deleteLabel(en);
            assertEquals(lbl_de, f.getLabel(de));
            assertNull(f.getLabel(en));
            assertEquals(lbl_fr, f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            f.setLabel(null, fr);
            assertEquals(lbl_de, f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            f.setLabel(lbl);
            assertEquals(lbl, f.getLabel());
            assertNull(f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertNull(f.getLabel(none));

            connection.commit();
        } finally {
            connection.close();
        }
View Full Code Here


        final RepositoryConnection connection = repositoryRDF.getConnection();
        try {
            final Facading facading = FacadingFactory.createFacading(connection);

            final URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/locale");
            final LocaleFacade f = facading.createFacade(uri, LocaleFacade.class);

            f.setLabel(lbl);
            assertEquals(lbl, f.getLabel());
            assertNull(f.getLabel(none));

            f.setLabel(lbl_de, de);
            f.setLabel(lbl_en, en);
            assertEquals(lbl_de, f.getLabel(de));
            assertEquals(lbl_en, f.getLabel(en));
            assertNull(f.getLabel(none));

            f.setLabel(null);
            assertNull(f.getLabel());
            assertNull(f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertNull(f.getLabel(none));

            f.setLabel(lbl_de, de);
            f.setLabel(lbl_en, en);
            f.setLabel(lbl_fr, fr);
            f.setLabel(lbl_none, none);
            assertEquals(lbl_de, f.getLabel(de));
            assertEquals(lbl_en, f.getLabel(en));
            assertEquals(lbl_fr, f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            assertThat(f.getLabel(), anyOf(is(lbl_de), is(lbl_en), is(lbl_fr), is(lbl_none)));

            f.deleteLabel(en);
            assertEquals(lbl_de, f.getLabel(de));
            assertNull(f.getLabel(en));
            assertEquals(lbl_fr, f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            f.setLabel(null, fr);
            assertEquals(lbl_de, f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertEquals(lbl_none, f.getLabel(none));

            f.setLabel(lbl);
            assertEquals(lbl, f.getLabel());
            assertNull(f.getLabel(de));
            assertNull(f.getLabel(en));
            assertNull(f.getLabel(fr));
            assertNull(f.getLabel(none));

        } finally {
            connection.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.commons.sesame.facading.locale.model.LocaleFacade

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.