Fixed query api
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry-client@169101 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1e159513fa
commit
108cc157ac
|
@ -308,6 +308,8 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
|
|||
StringWriter stringWriter = new StringWriter();
|
||||
stringWriter.append(PATH_SEPARATOR);
|
||||
stringWriter.append(AccessPath.ACCESS_PATH_PART);
|
||||
stringWriter.append(PATH_SEPARATOR);
|
||||
stringWriter.append(AccessPath.QUERY_PATH_PART);
|
||||
|
||||
Map<String,String> parameters = new HashMap<>();
|
||||
parameters.put(AccessPath.QUERY_PARAM, query);
|
||||
|
|
|
@ -70,63 +70,67 @@ public class ResourceRegistryClientTest extends ScopedTest {
|
|||
resourceRegistryClient.getSchema(Aux.class, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
/* The following tests are commented because we need to create the instances for tests. this is done in
|
||||
* resource registry publisher, which uses client APis to test the publishing as weel as this client.
|
||||
*/
|
||||
|
||||
// @Test
|
||||
public void testExists() throws ResourceRegistryException {
|
||||
UUID uuid = UUID.fromString("bdaccb35-7f27-45a6-8ca9-11d467cb9233");
|
||||
resourceRegistryClient.exists(EService.NAME, uuid);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testExistsByClass() throws ResourceRegistryException {
|
||||
UUID uuid = UUID.fromString("bdaccb35-7f27-45a6-8ca9-11d467cb9233");
|
||||
resourceRegistryClient.exists(EService.class, uuid);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetInstance() throws ResourceRegistryException {
|
||||
UUID uuid = UUID.fromString("bdaccb35-7f27-45a6-8ca9-11d467cb9233");
|
||||
String eService = resourceRegistryClient.getInstance(EService.NAME, uuid);
|
||||
logger.trace("{}", eService);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetInstanceByClass() throws ResourceRegistryException {
|
||||
UUID uuid = UUID.fromString("bdaccb35-7f27-45a6-8ca9-11d467cb9233");
|
||||
EService eService = resourceRegistryClient.getInstance(EService.class, uuid);
|
||||
logger.trace("{}", eService);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetInstances() throws ResourceRegistryException {
|
||||
String eServices = resourceRegistryClient.getInstances(EService.NAME, true);
|
||||
logger.trace("{}", eServices);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetInstancesByClass() throws ResourceRegistryException {
|
||||
List<EService> eServices = resourceRegistryClient.getInstances(EService.class, true);
|
||||
logger.trace("{}", eServices);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetRelatedResourcesByClasses() throws ResourceRegistryException {
|
||||
List<EService> eServices = resourceRegistryClient.getRelatedResources(EService.class, IsRelatedTo.class,
|
||||
Resource.class, Direction.out, true);
|
||||
logger.trace("{}", eServices);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetRelatedResourcesFromReferenceResourceByClasses() throws ResourceRegistryException {
|
||||
UUID uuid = UUID.fromString("b0d15e45-62af-4221-b785-7d014f10e631");
|
||||
HostingNode hostingNode = new HostingNodeImpl();
|
||||
Header header = new HeaderImpl(uuid);
|
||||
hostingNode.setHeader(header);
|
||||
List<EService> eServices = resourceRegistryClient.getRelatedResourcesFromReferenceResource(EService.class,
|
||||
IsRelatedTo.class, Resource.class, hostingNode, Direction.out, true);
|
||||
IsRelatedTo.class, HostingNode.class, hostingNode, Direction.out, true);
|
||||
logger.trace("{}", eServices);
|
||||
}
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetFilteredResourcesByClasses() throws ResourceRegistryException, JsonProcessingException {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("group", "VREManagement");
|
||||
|
@ -139,7 +143,7 @@ public class ResourceRegistryClientTest extends ScopedTest {
|
|||
}
|
||||
|
||||
|
||||
@Test
|
||||
// @Test
|
||||
public void testGetResourcesFromReferenceFacet() throws ResourceRegistryException, JsonProcessingException {
|
||||
SoftwareFacet softwareFacet = new SoftwareFacetImpl();
|
||||
UUID uuid = UUID.fromString("cbdf3e61-524c-4800-91a6-3ff3e06fbee3");
|
||||
|
|
Loading…
Reference in New Issue