public void testLoadToolBar() throws Exception { String[] files = new String[] {"toolbar_1.xml", "toolbar_2.xml", "toolbar_3.xml"}; JAXBBarLoader jaxb = new JAXBBarLoader(); for (int i = 0; i < files.length; i++) { try { jaxb.loadToolbar(new FileInputStream(DIR_PATH + File.separator + files[i])); assertTrue(true); } catch (Exception e) { e.printStackTrace(); assertTrue(false); } } }
public void testSaveMenubar() throws Exception { ObjectFactory factory = new ObjectFactory(); Menubar bar = null; File f = null; JAXBBarLoader jaxb = new JAXBBarLoader(); bar = factory.createMenubar(); f = new File(DIR_PATH + File.separator + "gen" + File.separator + "menubar_1.xml"); try { jaxb.saveMenubar(bar, f); assertTrue(true); } catch (Exception e) { e.printStackTrace(); assertTrue(false); } }
public void testLoadMenubar() throws Exception { String[] files = new String[] {"menubar_1.xml", "menubar_2.xml"}; JAXBBarLoader jaxb = new JAXBBarLoader(); for (int i = 0; i < files.length; i++) { try { Menubar bar = jaxb.loadMenubar(new FileInputStream(DIR_PATH + File.separator + files[i])); assertTrue(true); if (i == 0) { I18NResources res = bar.getI18NResources(); assertEquals(1, res.getI18NResource().size()); } else if (i == 1) { I18NResources res = bar.getI18NResources(); assertEquals(2, res.getI18NResource().size()); } } catch (Exception e) { e.printStackTrace(); assertTrue(false); } } }