Search in sources :

Example 66 with Service

use of cz.metacentrum.perun.core.api.Service in project perun by CESNET.

the class FacilitiesManagerEntryIntegrationTest method getFacilitiesByDestination.

@Test
public void getFacilitiesByDestination() throws Exception {
    System.out.println(CLASS_NAME + "getFacilitiesByDestination");
    Service serv = new Service();
    serv.setName("TestovaciSluzba");
    perun.getServicesManager().createService(sess, serv);
    Destination dest = new Destination();
    dest.setType("service-specific");
    dest.setDestination("TestovaciDestinace");
    perun.getServicesManager().addDestination(sess, serv, facility, dest);
    List<Facility> facilities = perun.getFacilitiesManager().getFacilitiesByDestination(sess, "TestovaciDestinace");
    assertTrue("At least one facility with destinatnion " + dest.getDestination() + " should exists", facilities.size() > 0);
    assertTrue("Created facility with destinantion " + dest.getDestination() + " should exist between others", facilities.contains(facility));
}
Also used : Destination(cz.metacentrum.perun.core.api.Destination) Service(cz.metacentrum.perun.core.api.Service) BanOnFacility(cz.metacentrum.perun.core.api.BanOnFacility) Facility(cz.metacentrum.perun.core.api.Facility) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

Service (cz.metacentrum.perun.core.api.Service)66 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)44 Test (org.junit.Test)44 ArrayList (java.util.ArrayList)11 Facility (cz.metacentrum.perun.core.api.Facility)10 Destination (cz.metacentrum.perun.core.api.Destination)9 Member (cz.metacentrum.perun.core.api.Member)8 ExecService (cz.metacentrum.perun.taskslib.model.ExecService)8 User (cz.metacentrum.perun.core.api.User)6 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)6 Attribute (cz.metacentrum.perun.core.api.Attribute)5 BanOnFacility (cz.metacentrum.perun.core.api.BanOnFacility)5 Group (cz.metacentrum.perun.core.api.Group)5 Host (cz.metacentrum.perun.core.api.Host)5 Resource (cz.metacentrum.perun.core.api.Resource)5 RichDestination (cz.metacentrum.perun.core.api.RichDestination)5 RichUser (cz.metacentrum.perun.core.api.RichUser)5 AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)4 PerunClient (cz.metacentrum.perun.core.api.PerunClient)4 PerunPrincipal (cz.metacentrum.perun.core.api.PerunPrincipal)4