use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method addServiceToServicesPackageWhenServiceNotExists.
@Test(expected = ServiceNotExistsException.class)
public void addServiceToServicesPackageWhenServiceNotExists() throws Exception {
System.out.println(CLASS_NAME + "addServiceToServicesPackageWhenServiceNotExists");
ServicesPackage servicesPackage = new ServicesPackage();
servicesPackage.setName("ServicesManagerTestSP");
servicesPackage.setDescription("TestingPackage");
perun.getServicesManager().createServicesPackage(sess, servicesPackage);
perun.getServicesManager().addServiceToServicesPackage(sess, servicesPackage, new Service());
// shouldn't find services package
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method removeServiceFromServicesPackageWhenPackageNotExists.
@Test(expected = ServicesPackageNotExistsException.class)
public void removeServiceFromServicesPackageWhenPackageNotExists() throws Exception {
System.out.println(CLASS_NAME + "removeServiceFromServicesPackageWhenPackageNotExists");
service = setUpService();
assertNotNull("unable to create service in DB", service);
perun.getServicesManager().removeServiceFromServicesPackage(sess, new ServicesPackage(), service);
// shouldn't find services package
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method setUpServicesPackage.
private ServicesPackage setUpServicesPackage(Service service) throws Exception {
ServicesPackage servicesPackage = new ServicesPackage();
servicesPackage.setName("ResourcesManagertTestSP");
servicesPackage.setDescription("testingServicePackage");
servicesPackage = perun.getServicesManager().createServicesPackage(sess, servicesPackage);
perun.getServicesManager().addServiceToServicesPackage(sess, servicesPackage, service);
return servicesPackage;
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method deleteServicesPackageWhenPackageNotExist.
@Test(expected = ServicesPackageNotExistsException.class)
public void deleteServicesPackageWhenPackageNotExist() throws Exception {
System.out.println(CLASS_NAME + "deleteServicesPackageWhenPackageNotExist");
perun.getServicesManager().deleteServicesPackage(sess, new ServicesPackage());
// shouldn't find services package in DB
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method addServiceToServicesPackage.
@Test
public void addServiceToServicesPackage() throws Exception {
System.out.println(CLASS_NAME + "addServiceToServicesPackage");
service = setUpService();
assertNotNull("unable to create service in DB", service);
ServicesPackage servicesPackage = new ServicesPackage();
servicesPackage.setName("ServicesManagerTestSP");
servicesPackage.setDescription("TestingPackage");
perun.getServicesManager().createServicesPackage(sess, servicesPackage);
perun.getServicesManager().addServiceToServicesPackage(sess, servicesPackage, service);
List<Service> services = perun.getServicesManager().getServicesFromServicesPackage(sess, servicesPackage);
assertTrue("there should be at leas 1 service in package", services.size() >= 1);
assertTrue("our service should be between package services", services.contains(service));
}
Aggregations