use of org.eclipse.egit.core.test.TestProject in project egit by eclipse.
the class CreatePatchOperationTest method testComputeWorkspacePathRepoAboveProject.
@Test
public void testComputeWorkspacePathRepoAboveProject() throws Exception {
testRepository.disconnect(project.getProject());
// new setup
project = new TestProject(true, "repo/bundles/Project-1", true, null);
File repo = new File(project.getProject().getLocationURI().getPath()).getParentFile().getParentFile();
gitDir = new File(repo, Constants.DOT_GIT);
testRepository = new TestRepository(gitDir);
testRepository.connect(project.getProject());
IPath oldPath = CreatePatchOperation.computeWorkspacePath(new Path("bundles/Project-1/test-file"), project.getProject());
IPath newPath = CreatePatchOperation.computeWorkspacePath(new Path("bundles/Project-1/test-file"), project.getProject());
assertPatch("test-file", oldPath.toString());
assertPatch("test-file", newPath.toString());
}
use of org.eclipse.egit.core.test.TestProject in project egit by eclipse.
the class IgnoreOperationTest method testWithNestedProjects.
@Test
public void testWithNestedProjects() throws Exception {
TestProject nested = new TestProject(true, "Project-1/Project-2");
try {
// Use Project-1 to create folder, Project-2 to get file to try to
// confuse any caches in workspace root (location -> IResource).
project.createFolder("Project-2/please");
IFile ignoreme = nested.createFile("please/ignoreme", new byte[0]);
IgnoreOperation operation = executeIgnore(ignoreme.getLocation());
String content = nested.getFileContent("please/.gitignore");
assertEquals("/ignoreme\n", content);
assertFalse(operation.isGitignoreOutsideWSChanged());
} finally {
nested.dispose();
}
}
Aggregations