urn_perun_group_resource_attribute_def_def_drupalGroupType extends GroupResourceAttributesModuleAbstract implements GroupResourceAttributesModuleImplApi { @Override public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws WrongAttributeValueException { if(attribute.getValue() == null) return; String attributeValue = attribute.valueAsString(); if(!(attributeValue.equals("public") || attributeValue.equals("private"))) { throw new WrongAttributeValueException(attribute, resource, group, "Type of drupal group is not in correct form. It can be either 'public' or 'private'."); } }  @Override void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute); @Override Attribute fillAttribute(PerunSessionImpl session, Group group, Resource resource, AttributeDefinition attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongAttributeValueException.class) public void testWrongValue() throws Exception { System.out.println("testWrongValue()"); attributeToCheck.setValue("bad_value"); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); }
@Test public void testCorrectSyntax() throws Exception { System.out.println("testCorrectSyntax()"); attributeToCheck.setValue("public"); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); attributeToCheck.setValue("private"); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); }