Search in sources :

Example 1 with RichDestination

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

the class ServicesManagerEntryIntegrationTest method getAllDestinationsWithFacility.

@Test
public void getAllDestinationsWithFacility() throws Exception {
    System.out.println(CLASS_NAME + "getAllDestinationsWithFacility");
    service = setUpService();
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManagerBl().addDestination(sess, service, facility, destination);
    List<Destination> destinations = perun.getServicesManagerBl().getDestinations(sess, facility);
    assertTrue("there shoudl be one detination", !destinations.isEmpty());
    Destination dest = destinations.get(0);
    assertTrue("there is the right destination in the richDestination", dest.getDestination().equals(destination.getDestination()));
}
Also used : Destination(cz.metacentrum.perun.core.api.Destination) RichDestination(cz.metacentrum.perun.core.api.RichDestination) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 2 with RichDestination

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

the class ServicesManagerEntryIntegrationTest method getAllRichDestinationsWithService.

@Test
public void getAllRichDestinationsWithService() throws Exception {
    System.out.println(CLASS_NAME + "getAllRichDestinationsWithService");
    service = setUpService();
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManagerBl().addDestination(sess, service, facility, destination);
    List<RichDestination> richDestinations = perun.getServicesManager().getAllRichDestinations(sess, service);
    RichDestination richDestination = richDestinations.get(0);
    assertTrue("there shoudl be one detination", !richDestinations.isEmpty());
    assertTrue("there is the right facility in the richDestination", richDestination.getFacility().equals(facility));
    assertTrue("there is the right service in the richDestination", richDestination.getService().equals(service));
    assertTrue("there is the right destination in the richDestination", richDestination.getDestination().equals(destination.getDestination()));
}
Also used : RichDestination(cz.metacentrum.perun.core.api.RichDestination) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 3 with RichDestination

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

the class ServicesManagerEntryIntegrationTest method addDestinationForMoreThanOneService.

@Test
public void addDestinationForMoreThanOneService() throws Exception {
    System.out.println(CLASS_NAME + "addDestinationForMoreThanOneService");
    List<Service> services = setUpServices();
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManager().addDestination(sess, services, facility, destination);
    List<RichDestination> destinations = perun.getServicesManager().getRichDestinations(sess, facility, services.get(0));
    destinations.addAll(perun.getServicesManager().getRichDestinations(sess, facility, services.get(1)));
    assertTrue("service should have 1 destination", destinations.size() == 2);
    for (RichDestination rd : destinations) {
        assertTrue("destination in richDestination need to be our destination", rd.getDestination().equals(destination.getDestination()));
        assertTrue("type of destination need to be our type of destination", rd.getType().equals(destination.getType()));
        assertTrue("richDestination has service from our list of services", services.contains(rd.getService()));
    }
}
Also used : RichDestination(cz.metacentrum.perun.core.api.RichDestination) Service(cz.metacentrum.perun.core.api.Service) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 4 with RichDestination

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

the class ServicesManagerEntryIntegrationTest method getRichDestinations.

@Test
public void getRichDestinations() throws Exception {
    System.out.println(CLASS_NAME + "getRichDestinations");
    service = setUpService();
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManagerBl().addDestination(sess, service, facility, destination);
    List<RichDestination> richDestinations = perun.getServicesManager().getRichDestinations(sess, facility, service);
    RichDestination richDestination = richDestinations.get(0);
    assertTrue("there shoudl be one detination", !richDestinations.isEmpty());
    assertTrue("there is the right facility in the richDestination", richDestination.getFacility().equals(facility));
    assertTrue("there is the right service in the richDestination", richDestination.getService().equals(service));
    assertTrue("there is the right destination in the richDestination", richDestination.getDestination().equals(destination.getDestination()));
}
Also used : RichDestination(cz.metacentrum.perun.core.api.RichDestination) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 5 with RichDestination

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

the class ServicesManagerEntryIntegrationTest method getAllRichDestinationsWithFacility.

@Test
public void getAllRichDestinationsWithFacility() throws Exception {
    System.out.println(CLASS_NAME + "getAllRichDestinationsWithFacility");
    service = setUpService();
    facility = setUpFacility();
    destination = setUpDestination();
    perun.getServicesManagerBl().addDestination(sess, service, facility, destination);
    List<RichDestination> richDestinations = perun.getServicesManager().getAllRichDestinations(sess, facility);
    RichDestination richDestination = richDestinations.get(0);
    assertTrue("there shoudl be one detination", !richDestinations.isEmpty());
    assertTrue("there is the right facility in the richDestination", richDestination.getFacility().equals(facility));
    assertTrue("there is the right service in the richDestination", richDestination.getService().equals(service));
    assertTrue("there is the right destination in the richDestination", richDestination.getDestination().equals(destination.getDestination()));
}
Also used : RichDestination(cz.metacentrum.perun.core.api.RichDestination) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)5 RichDestination (cz.metacentrum.perun.core.api.RichDestination)5 Test (org.junit.Test)5 Destination (cz.metacentrum.perun.core.api.Destination)1 Service (cz.metacentrum.perun.core.api.Service)1