I used MockLookup with FileEncodingQueryImpl and it fixed loading of
test documents.
Thanks for advice.
Tom
On 24.6.2020 9:07, Svata Dedic wrote:
Hi,
the IDE respects file.encoding property as the ultimate default, but
usually(!) a file resides in a Project which can decide on the
encoding (see e.g.
org.netbeans.modules.maven.queries.MavenFileEncodingQueryImpl) or the
DataObject (= file type) may have its own mechanism to detect encoding
(xml, html).
For testing purposes, I'd suggest to place a FileEncodingQueryImpl
into MockLookup in the tests, as here:
org.openide.text.DataEditorSupportEncodingTest
You could (I think) also hardcode the encoding for qa-functional/unit
tests as
test-{unit,qa-functional}-sys-prop.file.encoding=UTF-8
in the module's (?) project.properties
IMHO, the mock lookup approach is "more polite" ;)
-Svata
Dne 23. 06. 20 v 20:29 Tomáš Procházka napsal(a):
Hi,
some tests fail on Windows when test file contains accented characters.
All files in NetBeans repository have UTF-8 encoding, but my Windows
7 machine uses Windows-1252 encoding. Test files are then not read
with correct encoding and test fails.
For example file
https://github.com/apache/netbeans/blob/master/php/php.latte/test/unit/data/testfiles/indent/testIssue241118_01.latte
I found that default encoding for java can be changed with parameter
"-Dfile.encoding=UTF-8".
Is there any way how to force NetBeans build to use UTF-8 encoding?
Regards,
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists