-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57cfba0
commit 2f0ee11
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/catalog/XMLCatalogExtensionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/** | ||
* Copyright (c) 2018 Angelo ZERR | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Angelo Zerr <[email protected]> - initial API and implementation | ||
*/ | ||
package org.eclipse.lsp4xml.extensions.catalog; | ||
|
||
import static org.eclipse.lsp4xml.XMLAssert.c; | ||
|
48 changes: 48 additions & 0 deletions
48
...se.lsp4xml/src/test/java/org/eclipse/lsp4xml/extensions/contentmodel/XMLProblemsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Copyright (c) 2018 Angelo ZERR | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Angelo Zerr <[email protected]> - initial API and implementation | ||
*/ | ||
package org.eclipse.lsp4xml.extensions.contentmodel; | ||
|
||
import static org.eclipse.lsp4xml.XMLAssert.r; | ||
|
||
import org.eclipse.lsp4j.Diagnostic; | ||
import org.eclipse.lsp4j.DiagnosticSeverity; | ||
import org.eclipse.lsp4xml.XMLAssert; | ||
import org.eclipse.lsp4xml.commons.BadLocationException; | ||
import org.eclipse.lsp4xml.extensions.contentmodel.settings.ContentModelSettings; | ||
import org.eclipse.lsp4xml.extensions.contentmodel.settings.XMLProblems; | ||
import org.junit.Test; | ||
|
||
/** | ||
* XML problems like noGrammar. | ||
* | ||
*/ | ||
public class XMLProblemsTest { | ||
|
||
@Test | ||
public void noGrammarIgnore() throws BadLocationException { | ||
String xml = "<root /> "; | ||
XMLAssert.testDiagnosticsFor(xml); | ||
} | ||
|
||
@Test | ||
public void noGrammarHint() throws BadLocationException { | ||
String xml = "<root /> "; | ||
// Set noGrammar has 'hint' | ||
XMLAssert.testDiagnosticsFor(xml, null, ls -> { | ||
ContentModelSettings settings = new ContentModelSettings(); | ||
XMLProblems problems = new XMLProblems(); | ||
problems.setNoGrammar("hint"); | ||
settings.setProblems(problems); | ||
ls.doSave(new XMLAssert.SettingsSaveContext(settings)); | ||
}, null, false, new Diagnostic(r(0, 1, 0, 5), "No grammar constraints (DTD or XML Schema).", | ||
DiagnosticSeverity.Hint, "test.xml", "XML")); | ||
} | ||
} |