use of org.iobserve.model.test.storage.two.Link in project iobserve-analysis by research-iobserve.
the class EvalProxyDBTest method checkProxies.
private void checkProxies(final String label, final Two retrievedModelTwo) {
System.out.println("Step " + label);
for (final Link l : retrievedModelTwo.getLinks()) {
final Other ref = l.getReference();
System.out.println("Link " + ref.getName() + " " + ref.eIsProxy() + " -- " + ((BasicEObjectImpl) ref).eProxyURI());
}
}
use of org.iobserve.model.test.storage.two.Link in project iobserve-analysis by research-iobserve.
the class TestModelData method createLink.
/**
* Create a link to an other object.
*
* @param other
* the other object
* @return returns the link
*/
public static Link createLink(final Other other) {
final Link link = TwoFactory.eINSTANCE.createLink();
link.setReference(other);
return link;
}
use of org.iobserve.model.test.storage.two.Link in project iobserve-analysis by research-iobserve.
the class ECoreNeo4JTest method createWithReferenceThenUpdate.
@Test
public void createWithReferenceThenUpdate() throws Exception {
final Neo4JModelResource<Root> oneResource = ModelProviderTestUtils.prepareResource("createWithReferenceThenUpdate-one", this.prefix, OnePackage.eINSTANCE);
final Neo4JModelResource<Two> twoResource = ModelProviderTestUtils.prepareResource("createWithReferenceThenUpdate-two", this.prefix, TwoPackage.eINSTANCE);
oneResource.storeModelPartition(this.modelOne);
twoResource.storeModelPartition(this.modelTwo);
this.modelTwo.getLinks().add(TestModelData.createLink(TestModelData.SECOND_OTHER));
twoResource.updatePartition(this.modelTwo);
final Two two = twoResource.getModelRootNode(Two.class, TwoPackage.Literals.TWO);
Assert.assertThat("Different number of links", two.getLinks().size(), Is.is(this.modelTwo.getLinks().size()));
for (int i = 0; i < two.getLinks().size(); i++) {
final Link newLink = two.getLinks().get(i);
final Link oldLink = this.modelTwo.getLinks().get(i);
oneResource.resolve(newLink.getReference());
Assert.assertThat("Links differ", newLink.getReference().getName(), Is.is(oldLink.getReference().getName()));
}
}
use of org.iobserve.model.test.storage.two.Link in project iobserve-analysis by research-iobserve.
the class EvalProxyTest method checkProxies.
private void checkProxies(final String label, final Resource resource) {
System.out.println("Step " + label);
for (final EObject o : resource.getContents()) {
if (o instanceof Two) {
for (final EObject l : ((Two) o).getLinks()) {
if (l instanceof Link) {
final Other ref = ((Link) l).getReference();
System.out.println("Link " + ref.getName() + " " + ref.eIsProxy() + " -- " + ((BasicEObjectImpl) ref).eProxyURI());
}
}
}
}
}
Aggregations