Search in sources :

Example 6 with SerializableEObjectDescription

use of org.eclipse.xtext.resource.persistence.SerializableEObjectDescription in project xtext-core by eclipse.

the class SerializableResourceDescriptionTest method assertDescriptionsEqual.

public void assertDescriptionsEqual(final SerializableResourceDescription before, final SerializableResourceDescription after) {
    Assert.assertEquals(before.getURI(), after.getURI());
    Assert.assertEquals(before.getImportedNames(), after.getImportedNames());
    Assert.assertEquals(before.getReferences().size(), after.getReferences().size());
    int _size = before.getReferences().size();
    ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
    for (final int i : _doubleDotLessThan) {
        {
            final SerializableReferenceDescription beforeRef = before.getReferences().get(i);
            final SerializableReferenceDescription afterRef = after.getReferences().get(i);
            Assert.assertEquals(beforeRef.getContainerEObjectURI(), afterRef.getContainerEObjectURI());
            Assert.assertEquals(beforeRef.getSourceEObjectUri(), afterRef.getSourceEObjectUri());
            Assert.assertEquals(beforeRef.getTargetEObjectUri(), afterRef.getTargetEObjectUri());
            Assert.assertEquals(beforeRef.getEReference(), afterRef.getEReference());
            Assert.assertEquals(beforeRef.getIndexInList(), afterRef.getIndexInList());
        }
    }
    Assert.assertEquals(before.getDescriptions().size(), after.getDescriptions().size());
    int _size_1 = before.getDescriptions().size();
    ExclusiveRange _doubleDotLessThan_1 = new ExclusiveRange(0, _size_1, true);
    for (final int i_1 : _doubleDotLessThan_1) {
        {
            final SerializableEObjectDescription beforeDesc = before.getDescriptions().get(i_1);
            final SerializableEObjectDescription afterDesc = after.getDescriptions().get(i_1);
            Assert.assertEquals(beforeDesc.getEClass(), afterDesc.getEClass());
            Assert.assertEquals(beforeDesc.getName(), afterDesc.getName());
            Assert.assertEquals(beforeDesc.qualifiedName, afterDesc.qualifiedName);
            Assert.assertEquals(beforeDesc.userData, afterDesc.userData);
            Assert.assertEquals(beforeDesc.getEObjectURI(), afterDesc.getEObjectURI());
        }
    }
}
Also used : SerializableEObjectDescription(org.eclipse.xtext.resource.persistence.SerializableEObjectDescription) SerializableReferenceDescription(org.eclipse.xtext.resource.persistence.SerializableReferenceDescription) ExclusiveRange(org.eclipse.xtext.xbase.lib.ExclusiveRange)

Aggregations

SerializableEObjectDescription (org.eclipse.xtext.resource.persistence.SerializableEObjectDescription)6 SerializableReferenceDescription (org.eclipse.xtext.resource.persistence.SerializableReferenceDescription)5 QualifiedName (org.eclipse.xtext.naming.QualifiedName)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 ObjectInputStream (java.io.ObjectInputStream)2 ObjectOutputStream (java.io.ObjectOutputStream)2 URI (org.eclipse.emf.common.util.URI)2 SerializableResourceDescription (org.eclipse.xtext.resource.persistence.SerializableResourceDescription)2 ExclusiveRange (org.eclipse.xtext.xbase.lib.ExclusiveRange)2 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 SerializableEObjectDescriptionProvider (org.eclipse.xtext.resource.persistence.SerializableEObjectDescriptionProvider)1