Search in sources :

Example 1 with SynchronizationPoint

use of org.springframework.ide.vscode.languageserver.testharness.SynchronizationPoint in project sts4 by spring-projects.

the class ConcourseEditorTest method reconcilerRaceCondition.

@Test
public void reconcilerRaceCondition() throws Exception {
    SynchronizationPoint reconcilerThreadStart = harness.reconcilerThreadStart();
    Editor editor = harness.newEditor("garbage");
    // Blocks until the reconciler thread is reached.
    reconcilerThreadStart.reached();
    try {
        String editorContents = editor.getRawText();
        for (int i = 0; i < 4; i++) {
            editorContents = "\n" + editorContents;
            editor.setText(editorContents);
        }
    } finally {
        reconcilerThreadStart.unblock();
    }
    editor.assertRawText("\n" + "\n" + "\n" + "\n" + "garbage");
    editor.assertProblems("garbage|Expecting a 'Map'");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) SynchronizationPoint(org.springframework.ide.vscode.languageserver.testharness.SynchronizationPoint) SynchronizationPoint(org.springframework.ide.vscode.languageserver.testharness.SynchronizationPoint) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Editor (org.springframework.ide.vscode.languageserver.testharness.Editor)1 SynchronizationPoint (org.springframework.ide.vscode.languageserver.testharness.SynchronizationPoint)1