2016-09-14 18:09:03 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.informationsystem.resourceregistry.client.proxy;
|
|
|
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.InvalidQueryException;
|
2016-10-27 17:51:22 +02:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
2016-11-04 16:52:41 +01:00
|
|
|
import org.junit.BeforeClass;
|
2016-09-14 18:09:03 +02:00
|
|
|
import org.junit.Test;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
/**
|
2016-10-12 14:35:20 +02:00
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2016-09-14 18:09:03 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class ResourceRegistryClientTest {
|
|
|
|
|
|
|
|
private static Logger logger = LoggerFactory
|
|
|
|
.getLogger(ResourceRegistryClientTest.class);
|
|
|
|
|
2016-10-18 10:52:05 +02:00
|
|
|
protected ResourceRegistryClient resourceRegistryClient;
|
|
|
|
|
2016-11-04 16:52:41 +01:00
|
|
|
@BeforeClass
|
|
|
|
public static void beforeClass() throws Exception {
|
|
|
|
ScopedTest.beforeClass();
|
|
|
|
}
|
|
|
|
|
|
|
|
public ResourceRegistryClientTest(){
|
2016-10-18 10:52:05 +02:00
|
|
|
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
|
|
|
}
|
|
|
|
|
2016-09-14 18:09:03 +02:00
|
|
|
@Test
|
|
|
|
public void testQuery() throws InvalidQueryException{
|
2016-10-18 10:52:05 +02:00
|
|
|
String res = resourceRegistryClient.query("SELECT FROM V", 0, null);
|
2016-10-31 17:05:00 +01:00
|
|
|
logger.trace(res);
|
2016-09-14 18:09:03 +02:00
|
|
|
}
|
2016-10-18 10:52:05 +02:00
|
|
|
|
2016-10-27 17:51:22 +02:00
|
|
|
|
|
|
|
@Test
|
2016-10-28 12:26:36 +02:00
|
|
|
public void testGetFacetSchema() throws SchemaNotFoundException {
|
2016-10-27 17:51:22 +02:00
|
|
|
String res = resourceRegistryClient.getFacetSchema("ContactFacet");
|
2016-10-31 17:05:00 +01:00
|
|
|
logger.trace(res);
|
2016-10-27 17:51:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2016-10-28 12:26:36 +02:00
|
|
|
public void testGetResourceSchema() throws SchemaNotFoundException {
|
2016-10-27 17:51:22 +02:00
|
|
|
String res = resourceRegistryClient.getResourceSchema("HostingNode");
|
2016-10-31 17:05:00 +01:00
|
|
|
logger.trace(res);
|
2016-10-27 17:51:22 +02:00
|
|
|
}
|
|
|
|
|
2016-09-14 18:09:03 +02:00
|
|
|
}
|