|
Lines 272-275
public class SaveableCompareEditorInputTest extends TeamTest {
Link Here
|
| 272 |
* handled, see javadoc to SaveableCompareEditorInput. |
272 |
* handled, see javadoc to SaveableCompareEditorInput. |
| 273 |
*/ |
273 |
*/ |
| 274 |
} |
274 |
} |
|
|
275 |
|
| 276 |
public void testDirtyFlagOnLocalResourceTypedElementAndEmptyRight() |
| 277 |
throws CoreException, InvocationTargetException, |
| 278 |
InterruptedException, IllegalArgumentException, SecurityException, |
| 279 |
IllegalAccessException, NoSuchFieldException, |
| 280 |
NoSuchMethodException, IOException { |
| 281 |
|
| 282 |
// Create left element by SaveableCompareEditorInput to be properly |
| 283 |
// saved, see javadoc to SaveableCompareEditorInput |
| 284 |
LocalResourceTypedElement el1 = (LocalResourceTypedElement) SaveableCompareEditorInput |
| 285 |
.createFileElement(file1); |
| 286 |
ITypedElement el2 = null; |
| 287 |
|
| 288 |
CompareConfiguration conf = new CompareConfiguration(); |
| 289 |
conf.setLeftEditable(true); |
| 290 |
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput( |
| 291 |
el1, el2, conf); |
| 292 |
|
| 293 |
compareEditorInput.prepareCompareInput(null); |
| 294 |
|
| 295 |
verifyDirtyStateChanges(compareEditorInput); |
| 296 |
|
| 297 |
// check whether file was saved |
| 298 |
|
| 299 |
assertTrue(compareContent(new ByteArrayInputStream( |
| 300 |
(fileContents1 + appendFileContents).getBytes()), |
| 301 |
file1.getContents())); |
| 302 |
} |
| 303 |
|
| 304 |
public void testDirtyFlagOnCustomTypedElementAndEmptyRight() |
| 305 |
throws CoreException, InvocationTargetException, |
| 306 |
InterruptedException, IllegalArgumentException, SecurityException, |
| 307 |
IllegalAccessException, NoSuchFieldException, |
| 308 |
NoSuchMethodException, IOException { |
| 309 |
|
| 310 |
ITypedElement el1 = new TestFileElement(file1); |
| 311 |
ITypedElement el2 = null; |
| 312 |
|
| 313 |
CompareConfiguration conf = new CompareConfiguration(); |
| 314 |
conf.setLeftEditable(true); |
| 315 |
TestSaveableEditorInput compareEditorInput = new TestSaveableEditorInput( |
| 316 |
el1, el2, conf); |
| 317 |
|
| 318 |
compareEditorInput.prepareCompareInput(null); |
| 319 |
|
| 320 |
verifyDirtyStateChanges(compareEditorInput); |
| 321 |
|
| 322 |
/* |
| 323 |
* not checking if changes were saved because in this case saving is not |
| 324 |
* handled, see javadoc to SaveableCompareEditorInput. |
| 325 |
*/ |
| 326 |
} |
| 275 |
} |
327 |
} |