use of org.eclipse.xtext.resource.impl.DefaultReferenceDescription in project xtext-eclipse by eclipse.
the class DefaultReferenceFinderTest method testLocalRefs.
@Test
public void testLocalRefs() throws Exception {
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
findAllRefs(elementA, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
findRefs(elementA, resource, localResourceAccess);
acceptor.assertFinished();
}
use of org.eclipse.xtext.resource.impl.DefaultReferenceDescription in project xtext-eclipse by eclipse.
the class DefaultReferenceFinderTest method testExcludeLocalRefs.
@Test
public void testExcludeLocalRefs() throws Exception {
Resource refResource = loadResource("ref.refactoringtestlanguage", "D { ref A }");
EObject elementD = refResource.getContents().get(0).eContents().get(0);
findRefs(elementA, resource, null);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findAllRefs(elementA, null);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findRefs(elementA, refResource, null);
acceptor.assertFinished();
}
use of org.eclipse.xtext.resource.impl.DefaultReferenceDescription in project xtext-eclipse by eclipse.
the class DefaultReferenceFinderTest method testExternalRefs.
@Test
public void testExternalRefs() throws Exception {
Resource refResource = loadResource("ref.refactoringtestlanguage", "D { ref C }");
EObject elementD = refResource.getContents().get(0).eContents().get(0);
findRefs(elementC, resource, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementC, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findAllRefs(elementC, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementC, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findRefs(elementC, refResource, localResourceAccess);
acceptor.assertFinished();
}
use of org.eclipse.xtext.resource.impl.DefaultReferenceDescription in project xtext-eclipse by eclipse.
the class DefaultReferenceFinderTest method testLocalAndExternalRefs.
@Test
public void testLocalAndExternalRefs() throws Exception {
Resource refResource = loadResource("ref.refactoringtestlanguage", "D { ref A }");
EObject elementD = refResource.getContents().get(0).eContents().get(0);
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
findRefs(elementA, resource, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findAllRefs(elementA, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findRefs(elementA, refResource, localResourceAccess);
acceptor.assertFinished();
}
use of org.eclipse.xtext.resource.impl.DefaultReferenceDescription in project xtext-eclipse by eclipse.
the class DelegatingReferenceFinderTest method testLocalAndExternalRefs.
@Test
public void testLocalAndExternalRefs() throws Exception {
Resource refResource = loadResource("ref.refactoringtestlanguage", "D { ref A }");
EObject elementD = refResource.getContents().get(0).eContents().get(0);
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
findRefs(elementA, resource, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementB, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementB)));
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findAllRefs(elementA, localResourceAccess);
acceptor.assertFinished();
acceptor.expect(new DefaultReferenceDescription(elementD, elementA, RefactoringPackage.Literals.ELEMENT__REFERENCED, 0, EcoreUtil2.getPlatformResourceOrNormalizedURI(elementD)));
findRefs(elementA, refResource, localResourceAccess);
acceptor.assertFinished();
}
Aggregations