52 lines
1.5 KiB
Java
52 lines
1.5 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.informationsystem.resourceregistry.client.proxy;
|
|
|
|
import java.util.List;
|
|
|
|
import org.gcube.informationsystem.model.entity.facet.ContactFacet;
|
|
import org.gcube.informationsystem.model.entity.resource.HostingNode;
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.query.InvalidQueryException;
|
|
import org.gcube.informationsystem.resourceregistry.api.exceptions.schema.SchemaNotFoundException;
|
|
import org.gcube.informationsystem.types.TypeBinder.TypeDefinition;
|
|
import org.junit.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*
|
|
*/
|
|
public class ResourceRegistryClientTest extends ScopedTest {
|
|
|
|
private static Logger logger = LoggerFactory
|
|
.getLogger(ResourceRegistryClientTest.class);
|
|
|
|
protected ResourceRegistryClient resourceRegistryClient;
|
|
|
|
public ResourceRegistryClientTest(){
|
|
resourceRegistryClient = ResourceRegistryClientFactory.create();
|
|
}
|
|
|
|
@Test
|
|
public void testQuery() throws InvalidQueryException{
|
|
String res = resourceRegistryClient.query("SELECT FROM V", 0, null);
|
|
logger.trace(res);
|
|
}
|
|
|
|
|
|
@Test
|
|
public void testGetFacetSchema() throws SchemaNotFoundException {
|
|
List<TypeDefinition> typeDefinitions = resourceRegistryClient.getSchema(ContactFacet.class, true);
|
|
logger.trace("{}", typeDefinitions);
|
|
}
|
|
|
|
@Test
|
|
public void testGetResourceSchema() throws SchemaNotFoundException {
|
|
List<TypeDefinition> typeDefinitions = resourceRegistryClient.getSchema(HostingNode.class, true);
|
|
logger.trace("{}", typeDefinitions);
|
|
}
|
|
|
|
}
|