Commented test that uses copy/paste with system buffer because it may fail spontaneously under Linux (You're seeing this message because of the workaround to JRE issue: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4818143 IDEA would hang otherwise. The system clipboard might be not working correctly. It is recommended to restart IDEA)

This commit is contained in:
Denis Zhdanov
2010-12-07 19:21:53 +03:00
parent 668af9242a
commit a52d5a375c
@@ -523,35 +523,35 @@ public class SoftWrapApplianceOnDocumentModificationTest extends AbstractEditorP
assertEquals(expectedVisualLine, caretModel.getVisualPosition().line);
}
public void testPastingInsideSelection() throws IOException {
String text =
"this is line number 0\n" +
"this is line number 1\n" +
"this is line number 2\n" +
"this is line number 3\n" +
"this is line number 4\n" +
"this is line number 5\n" +
"this is line number 6\n" +
"this is the last line";
init(100, text);
int lineToSelect = 4;
myEditor.getCaretModel().moveToOffset(text.indexOf("number " + lineToSelect));
Document document = myEditor.getDocument();
int startOffset = document.getLineStartOffset(lineToSelect);
int endOffset = document.getLineEndOffset(lineToSelect);
myEditor.getSelectionModel().setSelection(startOffset, endOffset);
VisualPosition positionBefore = myEditor.offsetToVisualPosition(document.getLineStartOffset(lineToSelect + 1));
List<SoftWrap> softWrapsBefore = new ArrayList<SoftWrap>(getSoftWrapModel().getRegisteredSoftWraps());
copy();
paste();
assertEquals(positionBefore, myEditor.offsetToVisualPosition(document.getLineStartOffset(lineToSelect + 1)));
assertEquals(softWrapsBefore, getSoftWrapModel().getRegisteredSoftWraps());
}
//public void testPastingInsideSelection() throws IOException {
// String text =
// "this is line number 0\n" +
// "this is line number 1\n" +
// "this is line number 2\n" +
// "this is line number 3\n" +
// "this is line number 4\n" +
// "this is line number 5\n" +
// "this is line number 6\n" +
// "this is the last line";
//
// init(100, text);
// int lineToSelect = 4;
// myEditor.getCaretModel().moveToOffset(text.indexOf("number " + lineToSelect));
// Document document = myEditor.getDocument();
//
// int startOffset = document.getLineStartOffset(lineToSelect);
// int endOffset = document.getLineEndOffset(lineToSelect);
// myEditor.getSelectionModel().setSelection(startOffset, endOffset);
//
// VisualPosition positionBefore = myEditor.offsetToVisualPosition(document.getLineStartOffset(lineToSelect + 1));
// List<SoftWrap> softWrapsBefore = new ArrayList<SoftWrap>(getSoftWrapModel().getRegisteredSoftWraps());
//
// copy();
// paste();
//
// assertEquals(positionBefore, myEditor.offsetToVisualPosition(document.getLineStartOffset(lineToSelect + 1)));
// assertEquals(softWrapsBefore, getSoftWrapModel().getRegisteredSoftWraps());
//}
public void testRemoveHugeLogicalLineThatLaysBeforeSoftWrappedLines() throws IOException {
String text =