fixed FormatterTest.testLinewrapDatatypeRuleRef1 (see bug 347782)

This commit is contained in:
Moritz Eysholdt 2012-03-06 14:56:06 +01:00
parent 915e9dead8
commit 644bb665d2
2 changed files with 4 additions and 2 deletions

View file

@ -108,6 +108,8 @@ public class CrossReferenceSerializer implements ICrossReferenceSerializer {
String text = linkingHelper.getCrossRefNodeAsString(node, true);
QualifiedName qn = qualifiedNameConverter.toQualifiedName(text);
URI targetURI = EcoreUtil.getURI(target);
if (target.eResource() != null && target.eResource().getResourceSet() != null)
targetURI = target.eResource().getResourceSet().getURIConverter().normalize(targetURI);
for (IEObjectDescription desc : scope.getElements(qn))
if (desc.getEObjectURI().equals(targetURI))
return tokenUtil.serializeNode(node);

View file

@ -246,12 +246,12 @@ public class FormatterTest extends AbstractXtextTests {
assertFormattedNM(expected, model, 0, model.length());
}
@Ignore@Test public void testLinewrapDatatypeRuleRef1() throws Exception {
@Test public void testLinewrapDatatypeRuleRef1() throws Exception {
final String model = "test linewrap fqn ab .cd .ef; fqnref ab. cd. ef;";
final String expected = "test linewrap\nfqn\nab.cd.ef;\nfqnref\nab.cd.ef;";
// assertFormattedPTC(expected, model);
assertFormattedNM(expected, model, 0, model.length());
// assertEqualTokenStreams(model);
assertEqualTokenStreams(model);
}
@Test public void testLinewrapDatatypeRuleRef2() throws Exception {