lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-lucene/src/test/org/apache/lucene/analysis/ru TestRussianAnalyzer.java
Date Mon, 20 Oct 2003 18:07:57 GMT
ehatcher    2003/10/20 11:07:57

  Modified:    src/test/org/apache/lucene/analysis/ru
                        TestRussianAnalyzer.java
  Log:
  modify to use VM property for base data directory, so IDEs can run tests without Ant
  
  Revision  Changes    Path
  1.5       +9 -24     jakarta-lucene/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java
  
  Index: TestRussianAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/analysis/ru/TestRussianAnalyzer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestRussianAnalyzer.java	30 Sep 2003 03:09:15 -0000	1.4
  +++ TestRussianAnalyzer.java	20 Oct 2003 18:07:57 -0000	1.5
  @@ -82,26 +82,11 @@
   
       private Reader sample1251;
   
  -    public TestRussianAnalyzer(String name)
  -    {
  -        super(name);
  -    }
  +    private File dataDir;
   
  -    /**
  -     * @see TestCase#setUp()
  -     */
       protected void setUp() throws Exception
       {
  -        super.setUp();
  -
  -    }
  -
  -    /**
  -     * @see TestCase#tearDown()
  -     */
  -    protected void tearDown() throws Exception
  -    {
  -        super.tearDown();
  +      dataDir = new File(System.getProperty("dataDir"));
       }
   
       public void testUnicode() throws IOException
  @@ -109,12 +94,12 @@
           RussianAnalyzer ra = new RussianAnalyzer(RussianCharsets.UnicodeRussian);
           inWords =
               new InputStreamReader(
  -                new FileInputStream("src/test/org/apache/lucene/analysis/ru/testUnicode.txt"),
  +                new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/testUnicode.txt")),
                   "Unicode");
   
           sampleUnicode =
               new InputStreamReader(
  -                new FileInputStream("src/test/org/apache/lucene/analysis/ru/resUnicode.htm"),
  +                new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/resUnicode.htm")),
                   "Unicode");
   
           TokenStream in = ra.tokenStream("all", inWords);
  @@ -151,9 +136,9 @@
           //System.out.println(new java.util.Date());
           RussianAnalyzer ra = new RussianAnalyzer(RussianCharsets.KOI8);
           // KOI8
  -        inWordsKOI8 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/testKOI8.txt"),
"iso-8859-1");
  +        inWordsKOI8 = new InputStreamReader(new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/testKOI8.txt")),
"iso-8859-1");
   
  -        sampleKOI8 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/resKOI8.htm"),
"iso-8859-1");
  +        sampleKOI8 = new InputStreamReader(new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/resKOI8.htm")),
"iso-8859-1");
   
           TokenStream in = ra.tokenStream("all", inWordsKOI8);
           RussianLetterTokenizer sample =
  @@ -187,9 +172,9 @@
       public void test1251() throws IOException
       {
           // 1251
  -        inWords1251 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/test1251.txt"),
"iso-8859-1");
  +        inWords1251 = new InputStreamReader(new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/test1251.txt")),
"iso-8859-1");
   
  -        sample1251 = new InputStreamReader(new FileInputStream("src/test/org/apache/lucene/analysis/ru/res1251.htm"),
"iso-8859-1");
  +        sample1251 = new InputStreamReader(new FileInputStream(new File(dataDir, "/org/apache/lucene/analysis/ru/res1251.htm")),
"iso-8859-1");
   
           RussianAnalyzer ra = new RussianAnalyzer(RussianCharsets.CP1251);
           TokenStream in = ra.tokenStream("", inWords1251);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message