Search in sources :

Example 11 with Resource

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

the class AttributesManagerEntryIntegrationTest method setUserAttributesForMemberResourceWhenResourceNotExists.

@Test(expected = ResourceNotExistsException.class)
public void setUserAttributesForMemberResourceWhenResourceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "setUserAttributesForMemberResourceWhenResourceNotExists");
    vo = setUpVo();
    member = setUpMember();
    attributes = setUpUserAttribute();
    attributesManager.setAttributes(sess, new Resource(), member, attributes, true);
// shouldn't find resource
}
Also used : Resource(cz.metacentrum.perun.core.api.Resource) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 12 with Resource

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

the class AttributesManagerEntryIntegrationTest method getResourceRequiredMemberAttributesWhenResourceNotExists.

@Test(expected = ResourceNotExistsException.class)
public void getResourceRequiredMemberAttributesWhenResourceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "getResourceRequiredMemberAttributesWhenResourceNotExists");
    vo = setUpVo();
    member = setUpMember();
    attributesManager.getResourceRequiredAttributes(sess, new Resource(), member);
// shouldn't find resource
}
Also used : Resource(cz.metacentrum.perun.core.api.Resource) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 13 with Resource

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

the class AttributesManagerEntryIntegrationTest method setMemberResourceAttributesWhenResourceNotExists.

@Test(expected = ResourceNotExistsException.class)
public void setMemberResourceAttributesWhenResourceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "setResourceMemberAttributesWhenResourceNotExists");
    vo = setUpVo();
    member = setUpMember();
    attributes = setUpMemberResourceAttribute();
    attributesManager.setAttributes(sess, new Resource(), member, attributes);
// shouldn't find resource
}
Also used : Resource(cz.metacentrum.perun.core.api.Resource) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 14 with Resource

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

the class AttributesManagerEntryIntegrationTest method getResourceRequiredGroupAttributesWhenResourceNotExists.

@Test(expected = ResourceNotExistsException.class)
public void getResourceRequiredGroupAttributesWhenResourceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "getResourceRequiredGroupAttributesWhenResourceNotExists");
    vo = setUpVo();
    group = setUpGroup();
    attributesManager.getResourceRequiredAttributes(sess, new Resource(), group);
// shouldn't find resource
}
Also used : Resource(cz.metacentrum.perun.core.api.Resource) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Example 15 with Resource

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

the class AttributesManagerEntryIntegrationTest method getResourceRequiredUserAttributesWhenResourceNotExists.

@Test(expected = ResourceNotExistsException.class)
public void getResourceRequiredUserAttributesWhenResourceNotExists() throws Exception {
    System.out.println(CLASS_NAME + "getResourceRequiredUserAttributesWhenResourceNotExists");
    vo = setUpVo();
    member = setUpMember();
    User user = perun.getUsersManager().getUserByMember(sess, member);
    attributesManager.getResourceRequiredAttributes(sess, new Resource(), user);
// shouldn't find resource
}
Also used : User(cz.metacentrum.perun.core.api.User) Resource(cz.metacentrum.perun.core.api.Resource) AbstractPerunIntegrationTest(cz.metacentrum.perun.core.AbstractPerunIntegrationTest) Test(org.junit.Test)

Aggregations

Resource (cz.metacentrum.perun.core.api.Resource)176 Test (org.junit.Test)110 Attribute (cz.metacentrum.perun.core.api.Attribute)82 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)79 Facility (cz.metacentrum.perun.core.api.Facility)56 User (cz.metacentrum.perun.core.api.User)55 Group (cz.metacentrum.perun.core.api.Group)49 ArrayList (java.util.ArrayList)41 Vo (cz.metacentrum.perun.core.api.Vo)31 Member (cz.metacentrum.perun.core.api.Member)29 PerunSession (cz.metacentrum.perun.core.api.PerunSession)29 AttributeNotExistsException (cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException)26 RichResource (cz.metacentrum.perun.core.api.RichResource)25 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)20 RichUser (cz.metacentrum.perun.core.api.RichUser)18 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)18 ContactGroup (cz.metacentrum.perun.core.api.ContactGroup)17 RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)17 BanOnFacility (cz.metacentrum.perun.core.api.BanOnFacility)15 WrongReferenceAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException)14