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));
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method getServicesPackageByName.
@Test
public void getServicesPackageByName() throws Exception {
System.out.println(CLASS_NAME + "getServicesPackageByName");
service = setUpService();
servicesPackage = setUpServicesPackage(service);
ServicesPackage retServPack = perun.getServicesManager().getServicesPackageByName(sess, servicesPackage.getName());
assertNotNull("unable to get services package by name", retServPack);
assertEquals("returned services package is not same as stored", servicesPackage, retServPack);
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method addServiceToServicesPackageWhenPackageNotExists.
@Test(expected = ServicesPackageNotExistsException.class)
public void addServiceToServicesPackageWhenPackageNotExists() throws Exception {
System.out.println(CLASS_NAME + "addServiceToServicesPackageWhenPackageNotExists");
service = setUpService();
assertNotNull("unable to create service in DB", service);
perun.getServicesManager().addServiceToServicesPackage(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 createServicesPackageWhenServicePackageExists.
@Test(expected = ServicesPackageExistsException.class)
public void createServicesPackageWhenServicePackageExists() throws Exception {
System.out.println(CLASS_NAME + "createServicesPackageWhenServicePackageExists");
service = setUpService();
servicesPackage = setUpServicesPackage(service);
assertNotNull("unable to create services package", servicesPackage);
ServicesPackage returnedPackage = perun.getServicesManager().getServicesPackageById(sess, servicesPackage.getId());
perun.getServicesManager().createServicesPackage(sess, returnedPackage);
// shouldn't add service package twice
}
use of cz.metacentrum.perun.core.api.ServicesPackage in project perun by CESNET.
the class ServicesManagerEntryIntegrationTest method createServicesPackage.
@Test
public void createServicesPackage() throws Exception {
System.out.println(CLASS_NAME + "createServicesPackage");
service = setUpService();
servicesPackage = setUpServicesPackage(service);
assertNotNull("unable to create services package", servicesPackage);
ServicesPackage returnedPackage = perun.getServicesManager().getServicesPackageById(sess, servicesPackage.getId());
assertEquals("returned services package should be the same we added", returnedPackage, servicesPackage);
}
Aggregations