Add regression test (still deactivated) to verify cf-manifest validates

This commit is contained in:
Kris De Volder
2017-07-14 13:39:22 -07:00
parent 5e4ca61c5a
commit aef2a5538e
3 changed files with 1755 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ package org.springframework.ide.vscode.concourse;
import static org.springframework.ide.vscode.languageserver.testharness.Editor.PLAIN_COMPLETION;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.ide.vscode.bosh.BoshLanguageServer;
import org.springframework.ide.vscode.commons.util.text.LanguageId;
@@ -113,6 +114,12 @@ public class BoshEditorTest {
editor.assertHoverContains("variables", "Describes variables");
editor.assertHoverContains("tags", "Specifies key value pairs to be sent to the CPI for VM tagging");
}
@Ignore //For now... because not passing yet.
@Test public void reconcileCfManifest() throws Exception {
Editor editor = harness.newEditorFromClasspath("/workspace/cf-deployment-manifest.yml");
editor.assertProblems(/*NONE*/);
}
@Test public void toplevelPropertyCompletions() throws Exception {
Editor editor = harness.newEditor(
@@ -373,6 +380,10 @@ public class BoshEditorTest {
editor.assertHoverContains("properties", "Specifies instance group properties");
editor.assertHoverContains("env", "Specifies advanced BOSH Agent configuration");
}
@Test public void complexManifestValidation() throws Exception {
}
@Test public void instanceGroups_job_hovers() throws Exception {
Editor editor = harness.newEditor(

View File

@@ -14,8 +14,11 @@ package org.springframework.ide.vscode.languageserver.testharness;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.ArrayList;
@@ -80,6 +83,7 @@ import org.springframework.ide.vscode.commons.languageserver.util.LanguageServer
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
import org.springframework.ide.vscode.commons.util.Assert;
import org.springframework.ide.vscode.commons.util.ExceptionUtil;
import org.springframework.ide.vscode.commons.util.IOUtil;
import org.springframework.ide.vscode.commons.util.text.LanguageId;
import org.springframework.ide.vscode.commons.util.text.TextDocument;
@@ -569,4 +573,16 @@ public class LanguageServerHarness {
}
};
}
/**
* Create a new editor and populate contents from a file found on the (test) classpath.
*/
public Editor newEditorFromClasspath(String resourcePath) throws Exception {
try (InputStream is = LanguageServerHarness.class.getResourceAsStream(resourcePath)) {
if (is==null) {
fail("Couldn't find the resource: "+resourcePath);
}
return newEditor(IOUtil.toString(is));
}
}
}