Package org.apache.stanbol.ontologymanager.registry.impl

Examples of org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl


        // We use a single Dictionary for storing all configurations.
        final Dictionary<String,Object> config = new Hashtable<String,Object>();
        config.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] {"/ontologies", "/ontologies/registry"});
        OfflineConfiguration offline = new OfflineConfigurationImpl(config);
        // The registry manager can be updated via calls to createModel()
        regman = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(new SimpleTcProvider(),
                offline, new Parser()), config);
    }
View Full Code Here


     */
    @Test
    public void testCachingCentralised() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.CENTRALISED);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);
        assertSame(CachingPolicy.CENTRALISED, regman.getCachingPolicy());
        // All registries must have the same cache.
        Iterator<Library> it = regman.getLibraries().iterator();
View Full Code Here

     */
    @Test
    public void testCachingDistributed() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.DISTRIBUTED);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);
        assertSame(CachingPolicy.DISTRIBUTED, regman.getCachingPolicy());
        // Each registry must have its own distinct cache.
        Iterator<Library> it = regman.getLibraries().iterator();
View Full Code Here

    @Test
    public void testLoadingEager() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.DISTRIBUTED);
        configuration.put(RegistryManager.LAZY_LOADING, false);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);

        // Now pick a library.
        Registry reg;
View Full Code Here

    @Test
    public void testLoadingLazy() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.CENTRALISED);
        configuration.put(RegistryManager.LAZY_LOADING, true);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);

        // Now pick a library.
        Registry reg;
View Full Code Here

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);

        // The resulting manager must exist and have exactly one registry.
        assertNotNull(regMgr);
        Set<Registry> registries = regMgr.getRegistries();
View Full Code Here

        IRI localTestRegistry = IRI.create(getClass().getResource(registryResourcePath));
        Dictionary<String,Object> regmanConf = new Hashtable<String,Object>();
        regmanConf.put(RegistryManager.REGISTRY_LOCATIONS, new String[] {localTestRegistry.toString()});
        // Instantiating the registry manager will also load the registry data.
        regMgr = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(tcManager, offline, parser),
                regmanConf);
        assertNotNull(regMgr);

        // Now use this registry manager to instantiate an input source.
        OntologyInputSource<OWLOntology> src = new LibrarySource(Locations.LIBRARY_TEST1, regMgr,
View Full Code Here

        // We use a single Dictionary for storing all configurations.
        final Dictionary<String,Object> config = new Hashtable<String,Object>();
        config.put(OfflineConfiguration.ONTOLOGY_PATHS, new String[] {"/ontologies", "/ontologies/registry"});
        OfflineConfiguration offline = new OfflineConfigurationImpl(config);
        // The registry manager can be updated via calls to createModel()
        regman = new RegistryManagerImpl(offline, new ClerezzaOntologyProvider(new SimpleTcProvider(),
                offline, new Parser()), config);
    }
View Full Code Here

     */
    @Test
    public void testCachingCentralised() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.CENTRALISED);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);
        assertSame(CachingPolicy.CENTRALISED, regman.getCachingPolicy());
        // All registries must have the same cache.
        Iterator<Library> it = regman.getLibraries().iterator();
View Full Code Here

     */
    @Test
    public void testCachingDistributed() throws Exception {
        // Change the caching policy and setup a new registry manager.
        configuration.put(RegistryManager.CACHING_POLICY, CachingPolicy.DISTRIBUTED);
        regman = new RegistryManagerImpl(offline, provider, configuration);
        // Check that the configuration was set.
        assertNotNull(regman);
        assertSame(CachingPolicy.DISTRIBUTED, regman.getCachingPolicy());
        // Each registry must have its own distinct cache.
        Iterator<Library> it = regman.getLibraries().iterator();
View Full Code Here

TOP

Related Classes of org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl

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.