urn_perun_group_resource_attribute_def_def_projectDirPermissions extends GroupResourceAttributesModuleAbstract implements GroupResourceAttributesModuleImplApi { @Override public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws WrongAttributeValueException { Integer permissions = attribute.valueAsInteger(); if (permissions == null) return; Matcher match = pattern.matcher(permissions.toString()); if (!match.matches()) { throw new WrongAttributeValueException(attribute, group, resource, "Bad format of attribute projectDirPermissions (expected something like '750')."); } }  @Override void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongAttributeValueException.class) public void testWrongValue() throws Exception { System.out.println("testWrongValue()"); attributeToCheck.setValue(999); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); }
@Test public void testCorrectSyntax() throws Exception { System.out.println("testCorrectSyntax()"); attributeToCheck.setValue(420); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); }