2015-02-04 12:35:43 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
package org.gcube.vremanagement.executor;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import org.acme.HelloWorldPluginDeclaration;
|
|
|
|
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
|
|
|
import org.gcube.common.resources.gcore.ServiceEndpoint.AccessPoint;
|
|
|
|
import org.gcube.common.resources.gcore.ServiceEndpoint.Profile;
|
|
|
|
import org.gcube.common.resources.gcore.ServiceEndpoint.Property;
|
|
|
|
import org.gcube.common.resources.gcore.utils.Group;
|
2015-02-11 17:19:45 +01:00
|
|
|
import org.gcube.vremanagement.executor.api.SmartExecutor;
|
2015-02-04 12:35:43 +01:00
|
|
|
import org.junit.Assert;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class ExecutorImplTest {
|
|
|
|
|
2015-02-27 15:51:08 +01:00
|
|
|
//@Test
|
2015-02-04 12:35:43 +01:00
|
|
|
public void createServiceEndpointTest() {
|
2015-02-27 15:51:08 +01:00
|
|
|
/* TODO Redesign this test
|
2015-02-11 17:19:45 +01:00
|
|
|
ServiceEndpoint serviceEndpoint = SmartExecutorInitalizator.createServiceEndpoint();
|
2015-02-04 12:35:43 +01:00
|
|
|
|
|
|
|
Profile profile = serviceEndpoint.profile();
|
2015-02-11 17:19:45 +01:00
|
|
|
Assert.assertEquals(SmartExecutor.WEB_SERVICE_SERVICE_NAME, profile.category());
|
|
|
|
Assert.assertEquals(SmartExecutor.class.getSimpleName(), profile.name());
|
2015-02-04 12:35:43 +01:00
|
|
|
Group<AccessPoint> accessPoints = profile.accessPoints();
|
|
|
|
Assert.assertEquals(1, accessPoints.size());
|
|
|
|
HelloWorldPluginDeclaration hwpd = new HelloWorldPluginDeclaration();
|
|
|
|
Map<String, String> supportedCapabilities = hwpd.getSupportedCapabilities();
|
|
|
|
for(AccessPoint accessPoint : accessPoints){
|
|
|
|
Assert.assertEquals(hwpd.getName(),accessPoint.name());
|
|
|
|
Group<Property> properties = accessPoint.properties();
|
|
|
|
Assert.assertEquals(supportedCapabilities.size(), properties.size());
|
|
|
|
for(Property property : properties){
|
|
|
|
String propertyName = property.name();
|
|
|
|
Assert.assertTrue(supportedCapabilities.containsKey(propertyName));
|
|
|
|
Assert.assertEquals(supportedCapabilities.get(propertyName), property.value());
|
|
|
|
}
|
|
|
|
}
|
2015-02-27 15:51:08 +01:00
|
|
|
*/
|
2015-02-04 12:35:43 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-02-06 17:01:31 +01:00
|
|
|
@Test
|
|
|
|
public void myJavaTest(){
|
|
|
|
// Use this function to implements snippet of code to test before
|
|
|
|
// inserting in the service code.
|
|
|
|
}
|
|
|
|
|
2015-02-04 12:35:43 +01:00
|
|
|
}
|