use of org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE in project tmdm-studio-se by Talend.
the class NewMenuAction method newBlankMenu.
private WSMenuE newBlankMenu(String key) {
WSMenuMenuEntriesDescriptionsE descriptions = MdmserverobjectFactory.eINSTANCE.createWSMenuMenuEntriesDescriptionsE();
descriptions.setLabel(key);
// $NON-NLS-1$
descriptions.setLanguage("en");
//
WSMenuEntryE entry = MdmserverobjectFactory.eINSTANCE.createWSMenuEntryE();
entry.getDescriptions().add(descriptions);
entry.setId(key);
//
WSMenuE menu = MdmserverobjectFactory.eINSTANCE.createWSMenuE();
menu.setName(key);
menu.getMenuEntries().add(entry);
//
return menu;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE in project tmdm-studio-se by Talend.
the class Bean2EObjUtilTest method testConvertFromBean2EObj.
/**
* Test method for {@link Bean2EObjUtil#convertFromBean2EObj(java.lang.Object)}.
*/
@Test
public void testConvertFromBean2EObj() {
WSMenu menu = new WSMenu();
initBean(menu);
Bean2EObjUtil util = Bean2EObjUtil.getInstance();
util.registerClassMap(WSMenu.class);
EObject eObject = util.convertFromBean2EObj(menu, null);
assertNotNull(eObject);
WSMenuE menuE = (WSMenuE) eObject;
//
assertEquals(menu.getName(), menuE.getName());
assertEquals(menu.getDescription(), menuE.getDescription());
//
List<WSMenuEntry> menuEntries = menu.getMenuEntries();
EList<WSMenuEntryE> menuEntriesE = menuE.getMenuEntries();
for (int i = 0; i < menuEntries.size(); i++) {
checkMenuEntry(menuEntries.get(i), menuEntriesE.get(i));
}
}
use of org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE in project tmdm-studio-se by Talend.
the class Bean2EObjUtilTest method testConvertFromEObj2Bean.
@Test
public void testConvertFromEObj2Bean() {
WSMenuE menuE = MdmserverobjectFactory.eINSTANCE.createWSMenuE();
initEObject(menuE);
//
Bean2EObjUtil util = Bean2EObjUtil.getInstance();
util.registerClassMap(WSMenu.class);
WSMenu menu = (WSMenu) util.convertFromEObj2Bean(menuE);
assertNotNull(menu);
//
assertEquals(menu.getName(), menuE.getName());
assertEquals(menu.getDescription(), menuE.getDescription());
List<WSMenuEntry> menuEntries = menu.getMenuEntries();
EList<WSMenuEntryE> menuEntriesE = menuE.getMenuEntries();
for (int i = 0; i < menuEntries.size(); i++) {
checkMenuEntry(menuEntries.get(i), menuEntriesE.get(i));
}
}
use of org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE in project tmdm-studio-se by Talend.
the class Bean2EObjUtilTest method initEObject.
private void initEObject(WSMenuE menuE) {
// $NON-NLS-1$
menuE.setDescription("this is a description");
// $NON-NLS-1$
menuE.setName("menuA");
menuE.setSystem(false);
menuE.getMenuEntries();
//
WSMenuEntryE wsMenuEntry = MdmserverobjectFactory.eINSTANCE.createWSMenuEntryE();
// $NON-NLS-1$
wsMenuEntry.setApplication("application A");
// $NON-NLS-1$
wsMenuEntry.setContext("contextA");
// $NON-NLS-1$
wsMenuEntry.setIcon("icon A");
// $NON-NLS-1$
wsMenuEntry.setId("id A");
menuE.getMenuEntries().add(wsMenuEntry);
//
wsMenuEntry = MdmserverobjectFactory.eINSTANCE.createWSMenuEntryE();
// $NON-NLS-1$
wsMenuEntry.setApplication("application B");
// $NON-NLS-1$
wsMenuEntry.setContext("contextB");
// $NON-NLS-1$
wsMenuEntry.setIcon("icon B");
// wsMenuEntry.setId("id B");
menuE.getMenuEntries().add(wsMenuEntry);
//
WSMenuMenuEntriesDescriptionsE ds = MdmserverobjectFactory.eINSTANCE.createWSMenuMenuEntriesDescriptionsE();
// $NON-NLS-1$
ds.setLabel("Label C");
// $NON-NLS-1$
ds.setLanguage("En");
wsMenuEntry.getDescriptions().add(ds);
}
Aggregations