borowiak / pwa-technologies

Automatically exported from code.google.com/p/pwa-technologies
0 stars 0 forks source link

Hardcoded file references on test of spellchecker #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The test pt.arquivo.spellchecker.tests.TestSpellChecker has hardcoded 
references to data files that aren't available in the project resources.

{{{
<code language="java">
private String 
termsFileDataset1Train="/home/nutchwax/workspace/ArquivoWebSpellchecker/data/err
os_pt.txt.JOAO.train";
private String 
termsFileDataset1Test="/home/nutchwax/workspace/ArquivoWebSpellchecker/data/erro
s_pt.txt.JOAO.test";
...
}}}

The resources hardcoded should be added the a standard resource folder: 
{spellchecker.project.home}/src/test/resources/

And the test rewrote to load the resource in a location-independent fashion as 
such:
{{{
<code language="java">
InputStream in = getClass().getResourceAsStream("/example-data-file.txt");
}}}

Original issue reported on code.google.com by devel.da...@vcruz.net on 14 Feb 2012 at 11:29

GoogleCodeExporter commented 9 years ago

Original comment by devel.da...@vcruz.net on 15 Feb 2012 at 11:57