mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+29
-29
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user