use of com.liferay.ide.service.core.model.Relationship in project liferay-ide by liferay.
the class ServiceXmlTests method testEntityReferenceService.
@Test
public void testEntityReferenceService() throws Exception {
ServiceBuilder sb = ServiceBuilder6xx.TYPE.instantiate(new RootXmlResource(new XmlResourceStore(this.getClass().getResourceAsStream("files/entity-reference-test.xml"))));
Entity foo = sb.getEntities().get(0);
Entity bar = sb.getEntities().get(1);
ElementList<Relationship> relationships = sb.getRelationships();
assertEquals(1, relationships.size());
Entity to = sb.getRelationships().get(0).getToEntity().target();
Entity from = sb.getRelationships().get(0).getFromEntity().target();
assertEquals(to, foo);
assertEquals(from, bar);
}
Aggregations