Package org.apache.marmotta.ldclient.test.helper

Examples of org.apache.marmotta.ldclient.test.helper.TestLDClient$Check


    public void testDBPedia() throws Exception {

        ClientConfiguration config = new ClientConfiguration();
        config.addEndpoint(new StanbolEndpoint("DBPedia (Stanbol Cache)","http://dev.iks-project.eu:8080/entityhub/site/dbpedia/","^http://dbpedia\\.org/resource/.*"));

        LDClientService ldclient = new TestLDClient(new LDClient(config));

        Assume.assumeTrue(ldclient.ping("http://dev.iks-project.eu:8080/"));

        String uriBerlin = "http://dbpedia.org/resource/Berlin";
        ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);

        RepositoryConnection conBerlin = respBerlin.getTriples().getConnection();
        conBerlin.begin();
        Assert.assertTrue(conBerlin.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("dbpedia-berlin.sparql");
        BooleanQuery testLabel = conBerlin.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());

        conBerlin.commit();
        conBerlin.close();

        ldclient.shutdown();

    }
View Full Code Here


    private static Logger log = LoggerFactory.getLogger(TestVimeoProvider.class);

    @Before
    public void setupClient() {
        ldclient = new TestLDClient(new LDClient());
    }
View Full Code Here

    }
   
    private void genericTestImplementation(Endpoint endpoint, String resource) throws Exception {     
        ClientConfiguration config = new ClientConfiguration();
        config.addEndpoint(endpoint);
        LDClientService ldclient = new TestLDClient(new LDClient(config));
        ClientResponse response = ldclient.retrieveResource(resource);
        RepositoryConnection connection = response.getTriples().getConnection();
        connection.begin();
        Assert.assertTrue(connection.size() > 0);
        connection.commit();
        connection.close();
View Full Code Here

    public void testDBPedia() throws Exception {

        ClientConfiguration config = new ClientConfiguration();
        config.addEndpoint(new SPARQLEndpoint("DBPedia (SPARQL)","http://dbpedia.org/sparql","^http://dbpedia\\.org/resource/.*"));

        LDClientService ldclient = new TestLDClient(new LDClient(config));

        String uriBerlin = "http://dbpedia.org/resource/Berlin";
        ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);

        RepositoryConnection conBerlin = respBerlin.getTriples().getConnection();
        conBerlin.begin();
        Assert.assertTrue(conBerlin.size() > 0);

        // run a SPARQL test to see if the returned data is correct
        InputStream sparql = this.getClass().getResourceAsStream("dbpedia-berlin.sparql");
        BooleanQuery testLabel = conBerlin.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
        Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());

        conBerlin.commit();
        conBerlin.close();

        ldclient.shutdown();

    }
View Full Code Here

   
    private LDClientService ldclient;

    @Before
    public void setupClient() {
        ldclient = new TestLDClient(new LDClient());
    }
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(TestMediawikiProvider.class);
   
    @Before
    public void setupClient() {
        ldclient = new TestLDClient(new LDClient());
    }
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(TestYoutubeProvider.class);

    @Before
    public void setupClient() {
        ldclient = new TestLDClient(new LDClient());
    }
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(FacebookProviderTest.class);

    @Before
    public void setupClient() {
        ldclient = new TestLDClient(new LDClient());
    }
View Full Code Here

    }
   
    private void genericTestImplementation(Endpoint endpoint, String resource) throws Exception {     
        ClientConfiguration config = new ClientConfiguration();
        config.addEndpoint(endpoint);
        LDClientService ldclient = new TestLDClient(new LDClient(config));
        ClientResponse response = ldclient.retrieveResource(resource);
        RepositoryConnection connection = ModelCommons.asRepository(response.getData()).getConnection();
        connection.begin();
        Assert.assertTrue(connection.size() > 0);
        connection.commit();
        connection.close();
View Full Code Here

    private TestLDClient client;

    @Before
    public void setUp() {
        TestLDClient testLDClient = new TestLDClient(new LDClient());
        client = testLDClient;
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.ldclient.test.helper.TestLDClient$Check

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.