Search in sources :

Example 16 with Criteria

use of org.eclipse.winery.repository.targetallocation.Criteria in project winery by eclipse.

the class MinExternalConnectionsTest method performanceTest.

@Test
public void performanceTest() throws Exception {
    ServiceTemplateId id = new ServiceTemplateId("http://www.winery.opentosca.org/test/targetallocation/servicetemplates", "MinExternalConnectionsTest2", false);
    TopologyWrapper topology = new TopologyWrapper(repository.getElement(id).getTopologyTemplate());
    Criteria minExternalConnections = new MinExternalConnections(null, Integer.MAX_VALUE);
    List<TopologyWrapper> topologies = minExternalConnections.allocate(topology);
    for (TopologyWrapper allocated : topologies) {
        assertEquals(22, allocated.getNodeTemplates().size());
    }
}
Also used : TopologyWrapper(org.eclipse.winery.repository.targetallocation.util.TopologyWrapper) Criteria(org.eclipse.winery.repository.targetallocation.Criteria) ServiceTemplateId(org.eclipse.winery.model.ids.definitions.ServiceTemplateId) Test(org.junit.jupiter.api.Test)

Aggregations

Criteria (org.eclipse.winery.repository.targetallocation.Criteria)16 Test (org.junit.jupiter.api.Test)16 TopologyWrapper (org.eclipse.winery.repository.targetallocation.util.TopologyWrapper)13 ServiceTemplateId (org.eclipse.winery.model.ids.definitions.ServiceTemplateId)11 TTopologyTemplate (org.eclipse.winery.model.tosca.TTopologyTemplate)11 ArrayList (java.util.ArrayList)6 TNodeTemplate (org.eclipse.winery.model.tosca.TNodeTemplate)6 JsonNode (com.fasterxml.jackson.databind.JsonNode)5 FulfillPolicies (org.eclipse.winery.repository.targetallocation.criteria.fulfillpolicies.FulfillPolicies)5 MinExternalConnections (org.eclipse.winery.repository.targetallocation.criteria.minexternalconnections.MinExternalConnections)1 Executable (org.junit.jupiter.api.function.Executable)1