Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/spell/SuggestUnitTest.java |
— | — | @@ -7,9 +7,9 @@ |
8 | 8 | import org.wikimedia.lsearch.config.IndexId; |
9 | 9 | import org.wikimedia.lsearch.search.NamespaceFilter; |
10 | 10 | import org.wikimedia.lsearch.spell.dist.EditDistance; |
11 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 11 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
12 | 12 | |
13 | | -public class SuggestUnitTest extends WikiTestCase |
| 13 | +public class SuggestUnitTest extends AbstractWikiTestCase |
14 | 14 | { |
15 | 15 | |
16 | 16 | public void testMakeNamespaces() throws IOException { |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/spell/api/SpellCheckIndexerTest.java |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | package org.wikimedia.lsearch.spell.api; |
3 | 3 | |
4 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 4 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
5 | 5 | |
6 | | -public class SpellCheckIndexerTest extends WikiTestCase { |
| 6 | +public class SpellCheckIndexerTest extends AbstractWikiTestCase { |
7 | 7 | public void testMakeIndex(){ |
8 | 8 | // TODO retest what goes into the final .spell index |
9 | 9 | } |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/test/WikiTestCase.java |
— | — | @@ -1,79 +0,0 @@ |
2 | | -package org.wikimedia.lsearch.test; |
3 | | - |
4 | | -import java.io.File; |
5 | | - |
6 | | -import junit.framework.TestCase; |
7 | | - |
8 | | -import org.wikimedia.lsearch.analyzers.WikiQueryParser; |
9 | | -import org.wikimedia.lsearch.config.Configuration; |
10 | | -import org.wikimedia.lsearch.config.GlobalConfiguration; |
11 | | - |
12 | | - |
13 | | -/** |
14 | | - * parent class for test that require that the configuration files be initialized |
15 | | - * |
16 | | - * @author rainman |
17 | | - * |
18 | | - */ |
19 | | -public abstract class WikiTestCase extends TestCase { |
20 | | - |
21 | | - public Configuration getConfig() { |
22 | | - return config; |
23 | | - } |
24 | | - |
25 | | - |
26 | | - |
27 | | - public void setConfig(final Configuration config) { |
28 | | - this.config = config; |
29 | | - } |
30 | | - |
31 | | - |
32 | | - public GlobalConfiguration getGlobal() { |
33 | | - return global; |
34 | | - } |
35 | | - |
36 | | - |
37 | | - public void setGlobal(final GlobalConfiguration global) { |
38 | | - this.global = global; |
39 | | - } |
40 | | - |
41 | | - |
42 | | - protected Configuration config = null; |
43 | | - |
44 | | - protected GlobalConfiguration global = null; |
45 | | - |
46 | | - @Override |
47 | | - protected void setUp() { |
48 | | - if(config == null) |
49 | | - { |
50 | | - String winPathFixer; |
51 | | - if(System.getProperty("os.name").startsWith("Windows")){ |
52 | | - winPathFixer = File.separator; |
53 | | - }else{ |
54 | | - winPathFixer=""; |
55 | | - } |
56 | | - |
57 | | - Configuration.setConfigFile( |
58 | | - System.getProperty("user.dir")+ |
59 | | - winPathFixer+ |
60 | | - File.separator+ |
61 | | - "test-data"+ |
62 | | - File.separator+ |
63 | | - "lsearch.conf.test"); |
64 | | - |
65 | | - Configuration.setGlobalConfigUrl( |
66 | | - "file://"+ |
67 | | - winPathFixer+ |
68 | | - System.getProperty("user.dir")+ |
69 | | - File.separator+"test-data"+ |
70 | | - File.separator+"lsearch-global.test"); |
71 | | - |
72 | | - config = Configuration.open(); |
73 | | - global = GlobalConfiguration.getInstance(); |
74 | | - WikiQueryParser.TITLE_BOOST = 2; |
75 | | - WikiQueryParser.ALT_TITLE_BOOST = 6; |
76 | | - WikiQueryParser.CONTENTS_BOOST = 1; |
77 | | - } |
78 | | - } |
79 | | - |
80 | | -} |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/test/AbstractWikiTestCase.java |
— | — | @@ -0,0 +1,81 @@ |
| 2 | +package org.wikimedia.lsearch.test; |
| 3 | + |
| 4 | +import java.io.File; |
| 5 | + |
| 6 | +import junit.framework.TestCase; |
| 7 | + |
| 8 | +import org.wikimedia.lsearch.analyzers.WikiQueryParser; |
| 9 | +import org.wikimedia.lsearch.config.Configuration; |
| 10 | +import org.wikimedia.lsearch.config.GlobalConfiguration; |
| 11 | + |
| 12 | + |
| 13 | +/** |
| 14 | + * parent class for test that require that the configuration files be initialized |
| 15 | + * |
| 16 | + * @author rainman |
| 17 | + * |
| 18 | + */ |
| 19 | +public abstract class AbstractWikiTestCase extends TestCase { |
| 20 | + |
| 21 | + public Configuration getConfig() { |
| 22 | + return config; |
| 23 | + } |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + public void setConfig(final Configuration config) { |
| 28 | + this.config = config; |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + public GlobalConfiguration getGlobal() { |
| 33 | + return global; |
| 34 | + } |
| 35 | + |
| 36 | + |
| 37 | + public void setGlobal(final GlobalConfiguration global) { |
| 38 | + this.global = global; |
| 39 | + } |
| 40 | + |
| 41 | + |
| 42 | + protected Configuration config = null; |
| 43 | + |
| 44 | + protected GlobalConfiguration global = null; |
| 45 | + |
| 46 | + @Override |
| 47 | + protected void setUp() { |
| 48 | + if(config == null) |
| 49 | + { |
| 50 | + String winPathFixer; |
| 51 | + if(System.getProperty("os.name").startsWith("Windows")){ |
| 52 | + winPathFixer = File.separator; |
| 53 | + }else{ |
| 54 | + winPathFixer=""; |
| 55 | + } |
| 56 | + |
| 57 | + Configuration.setConfigFile( |
| 58 | + System.getProperty("user.dir")+ |
| 59 | + winPathFixer+ |
| 60 | + File.separator+"src"+ |
| 61 | + File.separator+"test"+ |
| 62 | + File.separator+"resources"+ |
| 63 | + File.separator+"lsearch.conf.test"); |
| 64 | + |
| 65 | + Configuration.setGlobalConfigUrl( |
| 66 | + "file://"+ |
| 67 | + winPathFixer+ |
| 68 | + System.getProperty("user.dir")+ |
| 69 | + File.separator+"src"+ |
| 70 | + File.separator+"test"+ |
| 71 | + File.separator+"resources"+ |
| 72 | + File.separator+"lsearch-global.test"); |
| 73 | + |
| 74 | + config = Configuration.open(); |
| 75 | + global = GlobalConfiguration.getInstance(); |
| 76 | + WikiQueryParser.TITLE_BOOST = 2; |
| 77 | + WikiQueryParser.ALT_TITLE_BOOST = 6; |
| 78 | + WikiQueryParser.CONTENTS_BOOST = 1; |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | +} |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/config/GlobalConfigurationTest.java |
— | — | @@ -12,14 +12,14 @@ |
13 | 13 | |
14 | 14 | import org.apache.log4j.Logger; |
15 | 15 | import org.wikimedia.lsearch.search.NamespaceFilter; |
16 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 16 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
17 | 17 | import org.wikimedia.lsearch.util.StringUtils; |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @author rainman |
21 | 21 | * |
22 | 22 | */ |
23 | | -public class GlobalConfigurationTest extends WikiTestCase { // NOPMD by OrenBochman on 1/15/12 3:38 AM |
| 23 | +public class GlobalConfigurationTest extends AbstractWikiTestCase { // NOPMD by OrenBochman on 1/15/12 3:38 AM |
24 | 24 | |
25 | 25 | private static final Logger LOG = Logger.getLogger(GlobalConfigurationTest.class.getName()); |
26 | 26 | private transient GlobalConfiguration global = null; |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/search/PrefixMatchTest.java |
— | — | @@ -1,11 +1,11 @@ |
2 | 2 | package org.wikimedia.lsearch.search; |
3 | 3 | |
4 | 4 | import org.apache.lucene.search.ArticleNamespaceScaling; |
5 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 5 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
6 | 6 | import org.wikimedia.lsearch.config.IndexId; |
7 | 7 | import org.wikimedia.lsearch.search.SearchEngine.PrefixMatch; |
8 | 8 | |
9 | | -public class PrefixMatchTest extends WikiTestCase { |
| 9 | +public class PrefixMatchTest extends AbstractWikiTestCase { |
10 | 10 | public void testDeserialization(){ |
11 | 11 | IndexId iid = IndexId.get("enwiki"); |
12 | 12 | PrefixMatch m = new PrefixMatch("0:Some_title 10 ",iid.getNamespaceScaling()); |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/index/WikiIndexModifierTest.java |
— | — | @@ -19,9 +19,9 @@ |
20 | 20 | import org.wikimedia.lsearch.config.IndexId; |
21 | 21 | import org.wikimedia.lsearch.ranks.StringList; |
22 | 22 | import org.wikimedia.lsearch.related.RelatedTitle; |
23 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 23 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
24 | 24 | |
25 | | -public class WikiIndexModifierTest extends WikiTestCase { |
| 25 | +public class WikiIndexModifierTest extends AbstractWikiTestCase { |
26 | 26 | Document doc = null; |
27 | 27 | Analyzer analyzer = null; |
28 | 28 | Analyzer highlightAnalyzer = null; |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/WordNetTest.java |
— | — | @@ -2,9 +2,9 @@ |
3 | 3 | |
4 | 4 | import java.util.ArrayList; |
5 | 5 | |
6 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 6 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
7 | 7 | |
8 | | -public class WordNetTest extends WikiTestCase { |
| 8 | +public class WordNetTest extends AbstractWikiTestCase { |
9 | 9 | |
10 | 10 | protected ArrayList<String> list(String[] strs){ |
11 | 11 | ArrayList<String> l = new ArrayList<String>(); |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/AnalysisTest.java |
— | — | @@ -17,9 +17,9 @@ |
18 | 18 | import org.wikimedia.lsearch.config.GlobalConfiguration; |
19 | 19 | import org.wikimedia.lsearch.config.IndexId; |
20 | 20 | import org.wikimedia.lsearch.ranks.StringList; |
21 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 21 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
22 | 22 | |
23 | | -public class AnalysisTest extends WikiTestCase { |
| 23 | +public class AnalysisTest extends AbstractWikiTestCase { |
24 | 24 | Analyzer a = null; |
25 | 25 | Configuration config = null; |
26 | 26 | |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/WikiQueryParserTest.java |
— | — | @@ -16,11 +16,11 @@ |
17 | 17 | import org.wikimedia.lsearch.config.GlobalConfiguration; |
18 | 18 | import org.wikimedia.lsearch.config.IndexId; |
19 | 19 | import org.wikimedia.lsearch.index.WikiIndexModifier; |
20 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 20 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
21 | 21 | |
22 | 22 | import junit.framework.TestCase; |
23 | 23 | |
24 | | -public class WikiQueryParserTest extends WikiTestCase { |
| 24 | +public class WikiQueryParserTest extends AbstractWikiTestCase { |
25 | 25 | |
26 | 26 | |
27 | 27 | |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/analyzers/FastWikiTokenizerTest.java |
— | — | @@ -21,9 +21,9 @@ |
22 | 22 | import org.wikimedia.lsearch.config.Configuration; |
23 | 23 | import org.wikimedia.lsearch.config.IndexId; |
24 | 24 | import org.wikimedia.lsearch.index.WikiIndexModifier; |
25 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 25 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
26 | 26 | |
27 | | -public class FastWikiTokenizerTest extends WikiTestCase { |
| 27 | +public class FastWikiTokenizerTest extends AbstractWikiTestCase { |
28 | 28 | IndexId iid; |
29 | 29 | TokenizerOptions options; |
30 | 30 | |
Index: trunk/lucene-search-3/src/test/java/org/wikimedia/lsearch/beans/TitleTest.java |
— | — | @@ -1,8 +1,8 @@ |
2 | 2 | package org.wikimedia.lsearch.beans; |
3 | 3 | |
4 | | -import org.wikimedia.lsearch.test.WikiTestCase; |
| 4 | +import org.wikimedia.lsearch.test.AbstractWikiTestCase; |
5 | 5 | |
6 | | -public class TitleTest extends WikiTestCase { |
| 6 | +public class TitleTest extends AbstractWikiTestCase { |
7 | 7 | |
8 | 8 | public void testStatic(){ |
9 | 9 | assertEquals(0,Title.namespaceAsInt("0:Title")); |
Index: trunk/lucene-search-3/pom.xml |
— | — | @@ -410,6 +410,7 @@ |
411 | 411 | <scm> |
412 | 412 | <developerConnection>oren</developerConnection> |
413 | 413 | <url>http://svn.wikimedia.org/svnroot/mediawiki/trunk/lucene-search-3</url> |
| 414 | + <connection>svn+ssh</connection> |
414 | 415 | </scm> |
415 | 416 | <ciManagement> |
416 | 417 | <system>jenkins</system> |