@@ -0,0 +1,2083 @@
+package org.flymine.util;%0A%0A/*%0A * Copyright (C) 2002-2003 FlyMine%0A *%0A * This code may be freely distributed and modified under the%0A * terms of the GNU Lesser General Public Licence.  This should%0A * be distributed with the code.  See the LICENSE file for more%0A * information or http://www.gnu.org/copyleft/lesser.html.%0A *%0A */%0A%0Aimport java.util.List;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.flymine.model.testmodel.*;%0A%0Apublic class DynamicBeanTest extends TestCase%0A%7B%0A    public DynamicBeanTest(String arg) %7B%0A        super(arg);%0A    %7D%0A%0A    public void testCreateObjectInterfaceAsClass() %7B%0A        try %7B%0A            DynamicBean.create(List.class, null);%0A            fail(%22Expected: IllegalArgumentException%22);%0A        %7D catch (IllegalArgumentException e) %7B%0A        %7D%0A    %7D%0A%0A    public void testCreateObjectClassNoInterfaces() %7B%0A        Object obj = DynamicBean.create(Employee.class, null);%0A        assertTrue(obj instanceof Employee);%0A%0A        Employee e = (Employee) obj;%0A        e.setName(%22Employee1%22);%0A%0A        Department d = new Department();%0A        e.setDepartment(d);%0A%0A        assertEquals(%22Employee1%22, e.getName());%0A        assertTrue(e.getDepartment() == d);%0A    %7D%0A%0A    public void testCreateObjectNoClassOneInterface() %7B%0A        Object obj = DynamicBean.create(null, new Class%5B%5D %7B Employable.class %7D);%0A        assertTrue(obj instanceof Employable);%0A%0A        Employable e = (Employable) obj;%0A        e.setName(%22Employee1%22);%0A        assertEquals(%22Employee1%22, e.getName());%0A%0A    %7D%0A%0A    public void testCreateObjectNoClassTwoInterfaces() %7B%0A        Object obj = DynamicBean.create(null, new Class%5B%5D %7B Employable.class, ImportantPerson.class %7D);%0A        assertTrue(obj instanceof Employable);%0A        assertTrue(obj instanceof ImportantPerson);%0A    %7D%0A%0A    public void testCreateObjectClassTwoInterfaces() %7B%0A        Object obj = DynamicBean.create(Department.class, new Class%5B%5D %7B Employable.class, ImportantPerson.class %7D);%0A        assertTrue(obj instanceof Department);%0A        assertTrue(obj instanceof Employable);%0A        assertTrue(obj instanceof ImportantPerson);%0A    %7D%0A%7D%0A

Test class for DynamicBean