urn_perun_group_resource_attribute_def_def_projectName extends GroupResourceAttributesModuleAbstract implements GroupResourceAttributesModuleImplApi { @Override public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws WrongAttributeValueException { String name = attribute.valueAsString(); if (name == null) return; Matcher match = pattern.matcher(name); if (!match.matches()) { throw new WrongAttributeValueException(attribute, group, resource, "Bad format of attribute projectName (expected something like 'project_name-24')."); } }  @Override void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute); @Override List<String> getDependencies(); @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("correct_value"); classInstance.checkAttributeSyntax(sess, group, resource, attributeToCheck); }