Commit f5f5c03c authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added tests for utils

updated model
parent 4053fc74
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
package nl.uva.sne.drip.service; package nl.uva.sne.drip.service;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
...@@ -22,24 +24,31 @@ import org.springframework.stereotype.Service; ...@@ -22,24 +24,31 @@ import org.springframework.stereotype.Service;
* @author S. Koulouzis * @author S. Koulouzis
*/ */
@Service @Service
public class ProvisionerService { public class ProvisionerService {
@Value("${message.broker.queue.provisioner}") @Value("${message.broker.queue.provisioner}")
private String queueName; private String queueName;
@Value("${tosca.types.interface}") @Value("${tosca.types.interface}")
private String toscaTypesInterface; private String toscaTypesInterface;
@Autowired @Autowired
private ToscaTemplateService toscaTemplateService; private ToscaTemplateService toscaTemplateService;
public String provision(String id) throws IOException { public String provision(String id) throws IOException {
String ymlToscaTemplate = toscaTemplateService.findByID(id); String ymlToscaTemplate = toscaTemplateService.findByID(id);
ToscaTemplate toscaTemplate = toscaTemplateService.getYaml2ToscaTemplate(ymlToscaTemplate); ToscaTemplate toscaTemplate = toscaTemplateService.getYaml2ToscaTemplate(ymlToscaTemplate);
List<Map.Entry> vmTopologies = getVmTopologies(toscaTemplate);
for(Map.Entry topology: vmTopologies){
topology.
}
return null; return null;
} }
public List<Map.Entry> getVmTopologies(ToscaTemplate toscaTemplate) {
return TOSCAUtils.getNodesByType(toscaTemplate, "tosca.nodes.ARTICONF.VM.topology");
}
} }
...@@ -546,7 +546,7 @@ definitions: ...@@ -546,7 +546,7 @@ definitions:
node_templates: node_templates:
type: object type: object
additionalProperties: additionalProperties:
type: object $ref: '#/definitions/NodeTemplate'
relationship_templates: relationship_templates:
type: object type: object
additionalProperties: additionalProperties:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment