class ComponentBundlerUtil {

    public static Map<String, TileSet> parseActionTileSets (File file)
        throws IOException, SAXException
    {
        return parseActionTileSets(new BufferedInputStream(new FileInputStream(file)));
    }

}

class ComponentBundlerUtilTest {

    protected static final String ACTION_DATA;

    @Test
    public void testParseActionTileSets ()
        throws Exception
    {

        Map<String, TileSet> map = ComponentBundlerUtil.parseActionTileSets(
            new ByteArrayInputStream(ACTION_DATA.getBytes()));

        SwissArmyTileSet defset = (SwissArmyTileSet)map.get("default");
        assertNotNull(defset);
        assertEquals("default", defset.getName());
        assertEquals(1, defset.getTileCount());
        assertArrayEquals(new int[] { 1 }, defset.getTileCounts());
        assertEquals(new Rectangle(0, 0, 540, 640), defset.computeTileBounds(0, new Rectangle()));

        SwissArmyTileSet statset = (SwissArmyTileSet)map.get("static");
        assertNotNull(statset);
        assertEquals("static", statset.getName());
        assertEquals(1, statset.getTileCount());
        assertArrayEquals(new int[] { 1 }, statset.getTileCounts());
        assertEquals(new Rectangle(0, 0, 312, 240), statset.computeTileBounds(0, new Rectangle()));
    }

}