Package org.apache.marmotta.client.clients

Examples of org.apache.marmotta.client.clients.ConfigurationClient


        marmotta.shutdown();
    }

    @Test
    public void testListConfigurationKeys() throws MarmottaClientException, IOException {
        ConfigurationClient client = new ConfigurationClient(config);
       
        Set<String> keys = client.listConfigurationKeys();
        Assert.assertNotNull(keys);
        Assert.assertThat(keys, Matchers.hasItem("kiwi.host"));
    }
View Full Code Here


        Assert.assertThat(keys, Matchers.hasItem("kiwi.host"));
    }

    @Test
    public void testListConfigurations() throws MarmottaClientException, IOException {
        ConfigurationClient client = new ConfigurationClient(config);

        Set<Configuration> cfgs1 = client.listConfigurations(null);
        Assert.assertNotNull(cfgs1);
        Assert.assertTrue(cfgs1.size() > 0);


        Set<Configuration> cfgs2 = client.listConfigurations("kiwi");
        Assert.assertNotNull(cfgs2);
        Assert.assertTrue(cfgs2.size() > 0);

        Set<Configuration> cfgs3 = client.listConfigurations("brzlbrnft");
        Assert.assertNotNull(cfgs3);
        Assert.assertTrue(cfgs3.size() == 0);
    }
View Full Code Here

        Assert.assertTrue(cfgs3.size() == 0);
    }

    @Test
    public void testGetConfiguration() throws MarmottaClientException, IOException {
        ConfigurationClient client = new ConfigurationClient(config);

        Configuration c_version = client.getConfiguration("kiwi.version");
        Assert.assertNotNull(c_version);

        Configuration c_path = client.getConfiguration("kiwi.path");
        Assert.assertNotNull(c_path);
        Assert.assertEquals(marmotta.getContext(), c_path.getString());

        /*
         * is not managed by the webservice anymore
View Full Code Here

    }


    @Test
    public void testSetConfiguration() throws MarmottaClientException, IOException {
        ConfigurationClient client = new ConfigurationClient(config);

        // set a single-value string configuration
        client.setConfiguration("marmottaclient.test.single", "abc");
        Configuration c_single = client.getConfiguration("marmottaclient.test.single");
        Assert.assertNotNull(c_single);
        Assert.assertEquals("abc",c_single.getString());
        client.deleteConfiguration("marmottaclient.test.single");
        c_single = client.getConfiguration("marmottaclient.test.single");
        Assert.assertNull(c_single);

        // set a single-value boolean configuration
        client.setConfiguration("marmottaclient.test.bool",true);
        Configuration c_bool = client.getConfiguration("marmottaclient.test.bool");
        Assert.assertNotNull(c_bool);
        Assert.assertEquals("true",c_bool.getString());
        client.deleteConfiguration("marmottaclient.test.bool");
        c_bool = client.getConfiguration("marmottaclient.test.bool");
        Assert.assertNull(c_bool);


        // set a list value configuration
        client.setConfiguration("marmottaclient.test.list", Lists.newArrayList("abc","efg","hij"));
        Configuration c_list = client.getConfiguration("marmottaclient.test.list");
        Assert.assertNotNull(c_list);
        Assert.assertThat(c_list.getList(), Matchers.hasItem("efg"));
        client.deleteConfiguration("marmottaclient.test.list");
        c_list = client.getConfiguration("marmottaclient.test.list");
        Assert.assertNull(c_list);
    }
View Full Code Here

    /**
     * Return a client that allows to access and modify the server configuration.
     * @return
     */
    public ConfigurationClient getConfigurationClient() {
        return new ConfigurationClient(config);
    }
View Full Code Here

    /**
     * Return a client that allows to access and modify the server configuration.
     * @return
     */
    public ConfigurationClient getConfigurationClient() {
        return new ConfigurationClient(config);
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.client.clients.ConfigurationClient

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.