Search in sources :

Example 66 with Editor

use of org.springframework.ide.vscode.languageserver.testharness.Editor 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)

Example 67 with Editor

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

the class ConcourseEditorTest method githubCompletionsOwners.

@Test
public void githubCompletionsOwners() throws Exception {
    when(github.getOwners()).thenReturn(ImmutableList.of("kdvolder", "spring-projects", "spring-guides"));
    Editor editor = harness.newEditor("resources:\n" + "- name: my-repo\n" + "  type: git\n" + "  source:\n" + "    uri: <*>");
    editor.assertContextualCompletions("git@github.com:<*>", "git@github.com:kdvolder/<*>", "git@github.com:spring-guides/<*>", "git@github.com:spring-projects/<*>");
    editor.assertContextualCompletions("git@github.com:vol<*>", "git@github.com:kdvolder/<*>");
    editor.assertContextualCompletions("https://github.com/<*>", "https://github.com/kdvolder/<*>", "https://github.com/spring-guides/<*>", "https://github.com/spring-projects/<*>");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 68 with Editor

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

the class ConcourseEditorTest method testReconcileCatchesParseError.

@Test
public void testReconcileCatchesParseError() throws Exception {
    Editor editor = harness.newEditor("somemap: val\n" + "- sequence");
    editor.assertProblems("-|expected <block end>");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 69 with Editor

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

the class ConcourseEditorTest method putStepHovers.

@Test
public void putStepHovers() throws Exception {
    Editor editor = harness.newEditor("jobs:\n" + "- name: some-job\n" + "  plan:\n" + "  - put: something\n" + "    resource: something\n" + "    params:\n" + "      some_param: some_value\n" + "    get_params:\n" + "      skip_download: true\n");
    editor.assertHoverContains("resource", "The resource to update");
    editor.assertHoverContains("params", "A map of arbitrary configuration");
    editor.assertHoverContains("get_params", "A map of arbitrary configuration to forward to the resource that will be utilized during the implicit `get` step");
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Example 70 with Editor

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

the class ConcourseEditorTest method bug_150337510.

@Test
public void bug_150337510() throws Exception {
    // See: https://www.pivotaltracker.com/story/show/150337510
    Editor editor = harness.newEditor("resources:\n" + "- name: test\n" + "  type: s3\n" + "  source:\n" + "    bucket: blah\n" + "    regexp: blah/blah*.tar.gz\n" + "jobs:\n" + "- name: build-it\n" + "  plan:\n" + "  - task: build-it\n" + "    file: tasks/build-it.yml\n" + "  on_success:\n" + "    put: test\n" + "- name: create-website\n" + "  plan:\n" + "  - get: test\n" + "    passed:\n" + "    - build-it");
    editor.assertProblems();
}
Also used : Editor(org.springframework.ide.vscode.languageserver.testharness.Editor) Test(org.junit.Test)

Aggregations

Editor (org.springframework.ide.vscode.languageserver.testharness.Editor)402 Test (org.junit.Test)385 AbstractPropsEditorTest (org.springframework.ide.vscode.boot.editor.harness.AbstractPropsEditorTest)81 LiveBeansModel (org.springframework.ide.vscode.commons.boot.app.cli.livebean.LiveBeansModel)29 File (java.io.File)27 IJavaProject (org.springframework.ide.vscode.commons.java.IJavaProject)24 Diagnostic (org.eclipse.lsp4j.Diagnostic)22 Ignore (org.junit.Ignore)15 CompletionItem (org.eclipse.lsp4j.CompletionItem)13 IOException (java.io.IOException)9 CFDomain (org.springframework.ide.vscode.commons.cloudfoundry.client.CFDomain)6 ClientRequests (org.springframework.ide.vscode.commons.cloudfoundry.client.ClientRequests)6 CodeAction (org.springframework.ide.vscode.languageserver.testharness.CodeAction)5 ReleaseData (org.springframework.ide.vscode.bosh.models.ReleaseData)4 CFServiceInstance (org.springframework.ide.vscode.commons.cloudfoundry.client.CFServiceInstance)4 DynamicModelProvider (org.springframework.ide.vscode.bosh.models.DynamicModelProvider)3 NoTargetsException (org.springframework.ide.vscode.commons.cloudfoundry.client.cftarget.NoTargetsException)3 InputStream (java.io.InputStream)2 TimeoutException (java.util.concurrent.TimeoutException)2 StemcellData (org.springframework.ide.vscode.bosh.models.StemcellData)2