Search in sources :

Example 21 with Service

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

the class ServicesManagerEntryIntegrationTest method createServiceWhenServiceExists.

@Test(expected = ServiceExistsException.class)
public void createServiceWhenServiceExists() throws Exception {
    System.out.println(CLASS_NAME + "createService");
    Service service = new Service();
    service.setName("ServicesManagerTestService");
    service = perun.getServicesManager().createService(sess, service);
    service = perun.getServicesManager().createService(sess, service);
// shouldn't create same service twice
}
Also used : Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 22 with Service

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

the class ServicesManagerEntryIntegrationTest method deleteServiceWhenServiceNotExists.

@Test(expected = ServiceNotExistsException.class)
public void deleteServiceWhenServiceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "deleteServiceWhenServiceNotExists");
    perun.getServicesManager().deleteService(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)

Example 23 with Service

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

the class ServicesManagerEntryIntegrationTest method updateService.

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

Example 24 with Service

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

the class ServicesManagerEntryIntegrationTest method removeRequiredAttributeWhenServiceNotExists.

@Test(expected = ServiceNotExistsException.class)
public void removeRequiredAttributeWhenServiceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "removeRequiredAttributeWhenServiceNotExists");
    attribute = setUpAttribute();
    perun.getServicesManager().removeRequiredAttribute(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 25 with Service

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

the class ModulesUtilsEntryIntegrationTest method setUpService.

private Service setUpService() throws Exception {
    Service service = new Service();
    service.setName("AttributesManagerTestService");
    perun.getServicesManager().createService(sess, service);
    return service;
}
Also used : Service(cz.metacentrum.perun.core.api.Service)

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