smart-executor/src/test/java/org/gcube/vremanagement/executor/ExecutorImplTest.java

57 lines
1.9 KiB
Java
Raw Normal View History

/**
*
*/
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;
import org.gcube.vremanagement.executor.api.SmartExecutor;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/
*
*/
public class ExecutorImplTest {
//@Test
public void createServiceEndpointTest() {
/* TODO Redesign this test
ServiceEndpoint serviceEndpoint = SmartExecutorInitalizator.createServiceEndpoint();
Profile profile = serviceEndpoint.profile();
Assert.assertEquals(SmartExecutor.WEB_SERVICE_SERVICE_NAME, profile.category());
Assert.assertEquals(SmartExecutor.class.getSimpleName(), profile.name());
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());
}
}
*/
}
@Test
public void myJavaTest(){
// Use this function to implements snippet of code to test before
// inserting in the service code.
}
}