urn_perun_resource_attribute_def_def_sshkeysTargetUser extends ResourceAttributesModuleAbstract implements ResourceAttributesModuleImplApi { @Override public void checkAttributeSemantics(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws WrongReferenceAttributeValueException { if (attribute.getValue() == null) { throw new WrongReferenceAttributeValueException(attribute, null, resource, null, "Name of the user can't be empty"); } }  @Override void checkAttributeSyntax(PerunSessionImpl perunSession, Resource resource, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl perunSession, Resource resource, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongReferenceAttributeValueException.class) public void testCheckAttributeSemanticsWithNullValue() throws Exception { System.out.println("testCheckAttributeSemanticsWithNullValue()"); Attribute attributeToCheck = new Attribute(); classInstance.checkAttributeSemantics(session, resource, attributeToCheck); }
@Test public void testCheckAttributeSemantics() throws Exception { System.out.println("testCheckAttributeSemantics()"); Attribute attributeToCheck = new Attribute(); attributeToCheck.setValue("Jan_Nepomucky"); classInstance.checkAttributeSemantics(session, resource, attributeToCheck); attributeToCheck.setValue(".John_Dale."); classInstance.checkAttributeSemantics(session, resource, attributeToCheck); attributeToCheck.setValue("_Adele-Frank"); classInstance.checkAttributeSemantics(session, resource, attributeToCheck); }