-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let XMLScanner extend HTMLScanner to support type lookup on XML
- Loading branch information
1 parent
ca09a78
commit 1d7a172
Showing
5 changed files
with
43 additions
and
21 deletions.
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
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
12 changes: 12 additions & 0 deletions
12
text/src/main/java/org/jboss/forge/addon/text/highlight/scanner/XMLScanner.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,12 @@ | ||
package org.jboss.forge.addon.text.highlight.scanner; | ||
|
||
|
||
public class XMLScanner extends HTMLScanner { | ||
|
||
public static final Type TYPE = new Type("XML", "\\.(xml|cfc|cfm|tmproj|xaml)$"); | ||
|
||
@Override | ||
public Type getType() { | ||
return TYPE; | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
text/src/test/java/org/jboss/forge/addon/text/highlight/scanner/XMLScannerTestCase.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,28 @@ | ||
package org.jboss.forge.addon.text.highlight.scanner; | ||
|
||
import org.jboss.forge.addon.text.highlight.Syntax.Builder; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
public class XMLScannerTestCase extends AbstractScannerTestCase | ||
{ | ||
@Test | ||
public void shoulMatchXMLDTDExample() throws Exception | ||
{ | ||
assertMatchExample(Builder.create(), "xml", "dtd.in.xml"); | ||
} | ||
|
||
@Test | ||
@Ignore | ||
// Some issue with new_line in output, revisit | ||
public void shoulMatchXMLKateExample() throws Exception | ||
{ | ||
assertMatchExample(Builder.create(), "xml", "kate.in.xml"); | ||
} | ||
|
||
@Test | ||
public void shoulMatchXMLXAMLExample() throws Exception | ||
{ | ||
assertMatchExample(Builder.create(), "xml", "xaml.in.xml"); | ||
} | ||
} |