@@ -0,0 +1,1524 @@
+/*%0D%0A * Copyright 2005 The JA-SIG Collaborative. All rights reserved. See license%0D%0A * distributed with this file and available online at%0D%0A * http://www.uportal.org/license.html%0D%0A */%0D%0Apackage org.jasig.cas.services.web.support;%0D%0A%0D%0Aimport java.util.HashMap;%0D%0Aimport java.util.Map;%0D%0A%0D%0Aimport org.jasig.cas.services.Attribute;%0D%0Aimport org.jasig.cas.services.MapBackedAttributeRepository;%0D%0A%0D%0Aimport junit.framework.TestCase;%0D%0A%0D%0A/**%0D%0A * %0D%0A * @author Scott Battaglia%0D%0A * @version $Revision: 1.1 $ $Date: 2005/08/19 18:27:17 $%0D%0A * @since 3.1%0D%0A *%0D%0A */%0D%0Apublic class AttributePropertyEditorTests extends TestCase %7B%0D%0A%0D%0A    private MapBackedAttributeRepository attributeRepository;%0D%0A    %0D%0A    private AttributePropertyEditor editor;%0D%0A    %0D%0A    private Attribute attr = new Attribute(%22test%22, %22test%22);%0D%0A%0D%0A    protected void setUp() throws Exception %7B%0D%0A        this.attributeRepository = new MapBackedAttributeRepository();%0D%0A        %0D%0A        final Map%3CString, Attribute%3E attributes = new HashMap%3CString, Attribute%3E();%0D%0A        %0D%0A        attributes.put(%22test%22, this.attr);%0D%0A        %0D%0A        this.attributeRepository.setAttributes(attributes);%0D%0A        %0D%0A        this.editor = new AttributePropertyEditor(this.attributeRepository);%0D%0A    %7D%0D%0A    %0D%0A    public void testAttributeNotExists() %7B%0D%0A        this.editor.setAsText(%22test2%22);%0D%0A        assertNull(this.editor.getValue());%0D%0A    %7D%0D%0A%0D%0A    public void testAttributeExists() %7B%0D%0A        this.editor.setAsText(%22test%22);%0D%0A        assertEquals(this.attr, this.editor.getValue());%0D%0A    %7D%0D%0A    %0D%0A%7D%0D%0A

test case