@SuppressWarnings("unchecked") @Test public void testAllOperationsOld() { XtendFacade facade = XtendFacade.create("org::eclipse::xtend::middleend::xtend::test::expressions"); facade.registerMetaModel(new JavaMetaModel()); Set<Operation> result = (Set<Operation>) facade.call("testAllOperations", Arrays.asList(_person)); assertEquals(18L, result.size()); }
@Test public void testGetOperationOld() { Person p = new Person(); p.setName("Arnold"); p.setFirstName("André"); XtendFacade facade = XtendFacade.create("org::eclipse::xtend::middleend::xtend::test::expressions"); facade.registerMetaModel(new JavaMetaModel()); Boolean result = null; try { result = (Boolean) facade.call("testGetOperationLess", Arrays.asList(p, _person)); assertNull(result); } catch (Exception e) { // TODO verify if this is a bug in old Xtend } }
@Test public void testAllPropertyNamesOld() { XtendFacade facade = XtendFacade.create("org::eclipse::xtend::middleend::xtend::test::expressions"); facade.registerMetaModel(new JavaMetaModel()); Set<String> result = null; try { result = (Set<String>) facade.call("testAllPropertyNames", Arrays.asList(_person)); assertTrue(result.contains("name")); assertTrue(result.contains("firstName")); assertTrue(result.contains("mother")); assertTrue(result.contains("metaType")); assertFalse(result.contains("XtendMetaType")); } catch (Exception e) { } }