urn_perun_group_attribute_def_def_googleGroupName_namespace extends GroupAttributesModuleAbstract implements GroupAttributesModuleImplApi { @Override public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Attribute attribute) throws WrongAttributeValueException { String groupName = null; if(attribute.getValue() != null) groupName = attribute.valueAsString(); if(groupName == null) { return; } Matcher matcher = pattern.matcher(groupName); if(!matcher.matches()) throw new WrongAttributeValueException(attribute, group, "GroupName attribute content invalid characters. Allowed are only letters, numbers and characters _ and -."); }  @Override void checkAttributeSyntax(PerunSessionImpl sess, Group group, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, Group group, Attribute attribute);  }
@Test(expected = WrongAttributeValueException.class) public void testWrongSyntax() throws Exception { System.out.println("testWrongSyntax()"); attributeToCheck.setValue("???"); classInstance.checkAttributeSyntax(sess, group, attributeToCheck); }
@Test public void testCorrectSyntax() throws Exception { System.out.println("testCorrectSyntax()"); attributeToCheck.setValue("my_example"); classInstance.checkAttributeSyntax(sess, group, attributeToCheck); }