Search in sources :

Example 41 with Service

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

the class ServicesManagerEntryIntegrationTest method getServiceById.

@Test
public void getServiceById() throws Exception {
    System.out.println(CLASS_NAME + "getServiceById");
    service = setUpService();
    assertNotNull("unable to create service", service);
    Service returnedService = perun.getServicesManager().getServiceById(sess, service.getId());
    assertEquals("cannot get service by ID", returnedService, service);
}
Also used : Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 42 with Service

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

the class ServicesManagerEntryIntegrationTest method addRequiredAttributeWhenServiceNotExists.

@Test(expected = ServiceNotExistsException.class)
public void addRequiredAttributeWhenServiceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "addRequiredAttributeWhenServiceNotExists");
    attribute = setUpAttribute();
    perun.getServicesManager().addRequiredAttribute(sess, new Service(), attribute);
// shouldn't find service
}
Also used : Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 43 with Service

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

the class ServicesManagerEntryIntegrationTest method createService.

// SetUp moved to every method to speed up.
@Test
public void createService() throws Exception {
    System.out.println(CLASS_NAME + "createService");
    Service service = new Service();
    service.setName("ServicesManagerTestService");
    service = perun.getServicesManager().createService(sess, service);
    assertNotNull("unable to create Service", service);
}
Also used : Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 44 with Service

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

the class ServicesManagerEntryIntegrationTest method addDestinationWhenServiceNotExists.

@Test(expected = ServiceNotExistsException.class)
public void addDestinationWhenServiceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "addDestinationWhenServiceNotExists");
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManager().addDestination(sess, new Service(), facility, destination);
// shouldn't find service
}
Also used : Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 45 with Service

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

the class ServicesManagerEntryIntegrationTest method removeAllRequiredAttributesWhenServiceNotExists.

@Test(expected = ServiceNotExistsException.class)
public void removeAllRequiredAttributesWhenServiceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "removeAllRequiredAttributesWhenServiceNotExists");
    perun.getServicesManager().removeAllRequiredAttributes(sess, new Service());
// shouldn't find service
}
Also used : Service(cz.metacentrum.perun.core.api.Service) 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