IFile newFile = secondProject.getFile(FILE1);
newFile.create(
new ByteArrayInputStream("Hello, world".getBytes(secondProject
.getDefaultCharset())), false, null);
CreatePatchWizard createPatchWizard = openCreatePatchWizard();
LocationPage locationPage = createPatchWizard.getLocationPage();
locationPage.selectWorkspace("/" + PROJ1 + "/" + PATCH_FILE);
OptionsPage optionsPage = locationPage.nextToOptionsPage();
optionsPage.setFormat(CoreText.DiffHeaderFormat_Workspace);
createPatchWizard.finish();
bot.waitUntil(Conditions.shellCloses(createPatchWizard.getShell()));
IFile patch = ResourcesPlugin.getWorkspace().getRoot()
.getProject(PROJ1).getFile(PATCH_FILE);
byte[] bytes = IO.readFully(patch.getLocation().toFile());
String patchContent = new String(bytes, patch.getCharset());