From 08799582e7174a33f8e58d07e48649f5b388af90 Mon Sep 17 00:00:00 2001 From: lgoubet Date: Thu, 4 Jul 2019 14:42:59 +0200 Subject: Adapt tests to EGit change of behavior Change-Id: I0929fdbc28904bdc59c594b1f0935b4ec580ddab --- .../ide/ui/tests/unit/ResourceUtilPathTest.java | 30 +++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/unit/ResourceUtilPathTest.java b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/unit/ResourceUtilPathTest.java index 50ddb34b5..d56ac3ea2 100644 --- a/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/unit/ResourceUtilPathTest.java +++ b/plugins/org.eclipse.emf.compare.ide.ui.tests.git/src/org/eclipse/emf/compare/ide/ui/tests/unit/ResourceUtilPathTest.java @@ -41,7 +41,10 @@ public class ResourceUtilPathTest extends AbstractURITest { // But it doesn't start with it (repository name is the first segment) assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); // And it contains the commit's id at the end - assertTrue(storagePath.endsWith(origin.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + origin.getId().abbreviate(7) + " - full id was " + origin.getId(), + storagePath.endsWith(origin.getId().abbreviate(7).name())); // while we want an actually useable path String fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); @@ -53,7 +56,10 @@ public class ResourceUtilPathTest extends AbstractURITest { storagePath = storage.getFullPath().toOSString(); assertTrue(storagePath.contains(workspaceRelativePath)); assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); - assertTrue(storagePath.endsWith(branchTip.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + branchTip.getId().abbreviate(7) + " - full id was " + branchTip.getId(), + storagePath.endsWith(branchTip.getId().abbreviate(7).name())); fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); assertEquals(workspaceRelativePath, fixedPath); @@ -64,7 +70,10 @@ public class ResourceUtilPathTest extends AbstractURITest { storagePath = storage.getFullPath().toOSString(); assertTrue(storagePath.contains(workspaceRelativePath)); assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); - assertTrue(storagePath.endsWith(masterTip.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + masterTip.getId().abbreviate(7) + " - full id was " + masterTip.getId(), + storagePath.endsWith(masterTip.getId().abbreviate(7).name())); fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); assertEquals(workspaceRelativePath, fixedPath); @@ -93,7 +102,10 @@ public class ResourceUtilPathTest extends AbstractURITest { // But it doesn't start with it (repository name is the first segment) assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); // And it contains the commit's id at the end - assertTrue(storagePath.endsWith(origin.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + origin.getId().abbreviate(7) + " - full id was " + origin.getId(), + storagePath.endsWith(origin.getId().abbreviate(7).name())); // while we want an actually useable path String fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); @@ -105,7 +117,10 @@ public class ResourceUtilPathTest extends AbstractURITest { storagePath = storage.getFullPath().toOSString(); assertTrue(storagePath.contains(workspaceRelativePath)); assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); - assertTrue(storagePath.endsWith(branchTip.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + branchTip.getId().abbreviate(7) + " - full id was " + branchTip.getId(), + storagePath.endsWith(branchTip.getId().abbreviate(7).name())); fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); assertEquals(workspaceRelativePath, fixedPath); @@ -116,7 +131,10 @@ public class ResourceUtilPathTest extends AbstractURITest { storagePath = storage.getFullPath().toOSString(); assertTrue(storagePath.contains(workspaceRelativePath)); assertFalse(storagePath.startsWith(iFile1.getFullPath().toOSString())); - assertTrue(storagePath.endsWith(masterTip.getId().abbreviate(6).name())); + assertTrue( + storagePath + " does not end with the expected abbreviated commit id: " + + masterTip.getId().abbreviate(7) + " - full id was " + masterTip.getId(), + storagePath.endsWith(masterTip.getId().abbreviate(7).name())); fixedPath = ResourceUtil.getFixedPath(storage).toOSString(); assertEquals(workspaceRelativePath, fixedPath); -- cgit v1.2.3