use of org.eclipse.wst.xml.core.internal.formatter.XMLFormattingPreferences in project webtools.sourceediting by eclipse.
the class TestPartitionFormatterXML method testPreservePCDATAFormat.
public void testPreservePCDATAFormat() throws UnsupportedEncodingException, IOException, CoreException {
// BUG84688
XMLFormattingPreferences prefs = new XMLFormattingPreferences();
prefs.setPCDataWhitespaceStrategy(XMLFormattingPreferences.PRESERVE);
prefs.setClearAllBlankLines(true);
formatAndAssertEquals("testfiles/xml/xml-preservepcdata.xml", "testfiles/xml/xml-preservepcdata-yes-fmt.xml", prefs);
// results are different than old formatter
prefs.setPCDataWhitespaceStrategy(XMLFormattingPreferences.COLLAPSE);
formatAndAssertEquals("testfiles/xml/xml-preservepcdata.xml", "testfiles/xml/xml-preservepcdata-no-newfmt.xml", prefs);
}
use of org.eclipse.wst.xml.core.internal.formatter.XMLFormattingPreferences in project webtools.sourceediting by eclipse.
the class TestPartitionFormatterXML method testFormatCommentsJoinLinesDisabled.
public void testFormatCommentsJoinLinesDisabled() throws UnsupportedEncodingException, IOException, CoreException {
XMLFormattingPreferences prefs = new XMLFormattingPreferences();
prefs.setJoinCommentLines(false);
formatAndAssertEquals("testfiles/xml/xml-join-lines-disabled.xml", "testfiles/xml/xml-join-lines-disabled-fmt.xml", prefs);
}
use of org.eclipse.wst.xml.core.internal.formatter.XMLFormattingPreferences in project webtools.sourceediting by eclipse.
the class TestPartitionFormatterXML method testEmptyContentNodeFormat.
public void testEmptyContentNodeFormat() throws UnsupportedEncodingException, IOException, CoreException {
// BUG174243
XMLFormattingPreferences prefs = new XMLFormattingPreferences();
prefs.setIndentMultipleAttributes(true);
formatAndAssertEquals("testfiles/xml/usetagswithemptycontent.xml", "testfiles/xml/usetagswithemptycontent-fmt.xml", prefs);
}
use of org.eclipse.wst.xml.core.internal.formatter.XMLFormattingPreferences in project webtools.sourceediting by eclipse.
the class TestPartitionFormatterXML method testSplitAttributesFormat.
public void testSplitAttributesFormat() throws UnsupportedEncodingException, IOException, CoreException {
// BUG113584
XMLFormattingPreferences prefs = new XMLFormattingPreferences();
// the below tests are slighty different from old formatter test
prefs.setIndentMultipleAttributes(true);
prefs.setAlignFinalBracket(false);
formatAndAssertEquals("testfiles/xml/multiattributes2.xml", "testfiles/xml/multiattributes2-yessplit-noalign-newfmt.xml", prefs);
prefs.setIndentMultipleAttributes(false);
prefs.setAlignFinalBracket(false);
formatAndAssertEquals("testfiles/xml/multiattributes2.xml", "testfiles/xml/multiattributes2-nosplit-noalign-newfmt.xml", prefs);
}
use of org.eclipse.wst.xml.core.internal.formatter.XMLFormattingPreferences in project webtools.sourceediting by eclipse.
the class TestPartitionFormatterXML method testPreserveFormat.
public void testPreserveFormat() throws UnsupportedEncodingException, IOException, CoreException {
// results are different than old formatter
// Bug [228495] - Result should have blank lines cleared
XMLFormattingPreferences prefs = new XMLFormattingPreferences();
prefs.setClearAllBlankLines(true);
formatAndAssertEquals("testfiles/xml/xml-space-preserve-standalone.xml", "testfiles/xml/xml-space-preserve-standalone-newfmt.xml", prefs);
}
Aggregations