@@ -0,0 +1,2156 @@
+package org.flymine.xml.lite;%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 junit.framework.TestCase;%0A%0Aimport java.io.InputStream;%0Aimport java.text.DateFormat;%0Aimport java.text.SimpleDateFormat;%0A%0Aimport org.flymine.model.testmodel.*;%0A%0Apublic class LiteParserTest extends TestCase%0A%7B%0A%0A    public LiteParserTest(String arg) %7B%0A        super(arg);%0A    %7D%0A%0A    public void testParse1() throws Exception%7B%0A        InputStream is = getClass().getClassLoader().getResourceAsStream(%22test/LiteParserTest.xml%22);%0A        Employee obj1 = (Employee) LiteParser.parse(is);%0A%0A        Employee e1 = new Employee();%0A        e1.setName(%22Employee1%22);%0A%0A        assertEquals(e1.getName(), obj1.getName());%0A        assertEquals(new Integer(5678), obj1.getDepartment().getId());%0A    %7D%0A%0A    public void testParseTypes() throws Exception%7B%0A        InputStream is = getClass().getClassLoader().getResourceAsStream(%22test/LiteParserTestTypes.xml%22);%0A        Types obj1 = (Types) LiteParser.parse(is);%0A%0A        assertEquals(%22Types1%22, obj1.getName());%0A        assertTrue(1.2f == obj1.getFloatType());%0A        assertTrue(1.3d == obj1.getDoubleType());%0A        assertEquals(2, obj1.getIntType());%0A        assertTrue(obj1.getBooleanType());%0A        assertEquals(new Float(2.2f), obj1.getFloatObjType());%0A        assertEquals(new Double(2.3d), obj1.getDoubleObjType());%0A        assertEquals(new Integer(4), obj1.getIntObjType());%0A        assertEquals(Boolean.TRUE, obj1.getBooleanObjType());%0A        DateFormat df = new SimpleDateFormat(%22EEE MMM dd HH:mm:ss z yyyy%22);%0A        assertEquals(df.parse(%22Sat Aug 09 12:22:00 GMT 2003%22), obj1.getDateObjType());%0A        assertEquals(%22A String%22, obj1.getStringObjType());%0A%0A    %7D%0A%0A    public void testParseNull() throws Exception%7B%0A        try %7B%0A            LiteParser.parse(null);%0A            fail(%22Expected: NullPointerException%22);%0A        %7D catch (NullPointerException e) %7B%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Test class for LiteParser