51 lines
1.5 KiB
Java
51 lines
1.5 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.vremanagement.executor.client;
|
|
|
|
import java.util.List;
|
|
|
|
import org.gcube.testutility.ScopedTest;
|
|
//import org.gcube.dataanalysis.executor.plugin.GenericWorkerPluginDeclaration;
|
|
import org.gcube.vremanagement.executor.client.plugins.ExecutorPlugin;
|
|
import org.gcube.vremanagement.executor.client.plugins.query.SmartExecutorPluginQuery;
|
|
import org.gcube.vremanagement.executor.client.plugins.query.filter.ListEndpointDiscoveryFilter;
|
|
import org.junit.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*
|
|
*/
|
|
public class SmartGenericWorkerDiscoveryQuery extends ScopedTest {
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(SmartGenericWorkerDiscoveryQuery.class);
|
|
|
|
|
|
@Test
|
|
public void testGenericWorkerDiscoveryQuery() throws Exception {
|
|
|
|
//GenericWorkerPluginDeclaration gwpd = new GenericWorkerPluginDeclaration();
|
|
|
|
ExecutorPlugin executorPlugin = new ExecutorPlugin();
|
|
SmartExecutorPluginQuery query = new SmartExecutorPluginQuery(executorPlugin);
|
|
|
|
/*
|
|
add key_value filter here
|
|
* Tuple<String, String>[] tuples = new Tuple[n];
|
|
*
|
|
* runQuery.addConditions(pluginName, tuples);
|
|
*/
|
|
|
|
//query.addConditions(gwpd.getName());
|
|
|
|
/* Used to add extra filter to ServiceEndpoint discovery */
|
|
query.setServiceEndpointQueryFilter(null);
|
|
List<String> nodes = query.discoverEndpoints(new ListEndpointDiscoveryFilter());
|
|
logger.debug("Found the following nodes: {}", nodes);
|
|
|
|
}
|
|
|
|
}
|