Repository: gora Updated Branches: refs/heads/master dce6a66eb -> ff312980a
GORA-339 Upgrade solr dependencies to 4.8.1 Project: http://git-wip-us.apache.org/repos/asf/gora/repo Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/475027d5 Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/475027d5 Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/475027d5 Branch: refs/heads/master Commit: 475027d566d0b2d5e2dc73a53dde3f2bff62e3c1 Parents: 0778e56 Author: Lewis John McGibbney <lewis.j.mcgibb...@jpl.nasa.gov> Authored: Tue Jun 17 15:18:53 2014 -0400 Committer: Lewis John McGibbney <lewis.j.mcgibb...@jpl.nasa.gov> Committed: Tue Jun 17 15:18:53 2014 -0400 ---------------------------------------------------------------------- .../org/apache/gora/solr/store/SolrStore.java | 13 +-- .../solr/Employee/conf/lang/stopwords_en.txt | 54 +++++++++++++ .../test/conf/solr/Employee/conf/protwords.txt | 21 +++++ .../src/test/conf/solr/Employee/conf/schema.xml | 2 +- .../test/conf/solr/Employee/conf/solrconfig.xml | 2 +- .../test/conf/solr/Employee/conf/stopwords.txt | 14 ++++ .../test/conf/solr/Employee/conf/synonyms.txt | 29 +++++++ .../src/test/conf/solr/Employee/core.properties | 1 + .../solr/WebPage/conf/lang/stopwords_en.txt | 54 +++++++++++++ .../test/conf/solr/WebPage/conf/protwords.txt | 21 +++++ .../src/test/conf/solr/WebPage/conf/schema.xml | 2 +- .../test/conf/solr/WebPage/conf/solrconfig.xml | 2 +- .../test/conf/solr/WebPage/conf/stopwords.txt | 14 ++++ .../test/conf/solr/WebPage/conf/synonyms.txt | 29 +++++++ .../src/test/conf/solr/WebPage/core.properties | 1 + .../conf/solr/collection1/conf/solrconfig.xml | 2 +- .../test/conf/solr/collection1/core.properties | 1 + gora-solr/src/test/conf/solr/solr.xml | 27 ++++++- gora-solr/src/test/conf/solr/zoo.cfg | 17 ++++ .../apache/gora/solr/GoraSolrTestDriver.java | 19 +++-- pom.xml | 84 +++++++++++--------- 21 files changed, 346 insertions(+), 63 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java index b6e544c..0b8fe4d 100644 --- a/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java +++ b/gora-solr/src/main/java/org/apache/gora/solr/store/SolrStore.java @@ -184,17 +184,8 @@ public class SolrStore<K, T extends PersistentBase> extends DataStoreBase<K, T> // CloudSolrServer - denoted by "cloud" in properties } else if (solrJServerType.toString().toLowerCase().equals("cloud")) { LOG.info("Using CloudSolrServer Solrj implementation."); - try { - this.adminServer = new CloudSolrServer(solrServerUrl); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - try { - this.server = new CloudSolrServer( solrServerUrl + "/" + mapping.getCoreName() ); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - // ConcurrentUpdateSolrServer - denoted by "concurrent" in properties + this.adminServer = new CloudSolrServer(solrServerUrl); + this.server = new CloudSolrServer( solrServerUrl + "/" + mapping.getCoreName() ); } else if (solrJServerType.toString().toLowerCase().equals("concurrent")) { LOG.info("Using ConcurrentUpdateSolrServer Solrj implementation."); this.adminServer = new ConcurrentUpdateSolrServer(solrServerUrl, 1000, 10); http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/lang/stopwords_en.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/lang/stopwords_en.txt b/gora-solr/src/test/conf/solr/Employee/conf/lang/stopwords_en.txt new file mode 100644 index 0000000..224230c --- /dev/null +++ b/gora-solr/src/test/conf/solr/Employee/conf/lang/stopwords_en.txt @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +# Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +such +that +the +their +then +there +these +they +this +to +was +will +with http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/protwords.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/protwords.txt b/gora-solr/src/test/conf/solr/Employee/conf/protwords.txt new file mode 100644 index 0000000..5a32e50 --- /dev/null +++ b/gora-solr/src/test/conf/solr/Employee/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/schema.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/schema.xml b/gora-solr/src/test/conf/solr/Employee/conf/schema.xml index 9295c61..3cb2e24 100644 --- a/gora-solr/src/test/conf/solr/Employee/conf/schema.xml +++ b/gora-solr/src/test/conf/solr/Employee/conf/schema.xml @@ -16,7 +16,7 @@ limitations under the License. --> -<schema name="testexample" version="1.5"> +<schema name="test example Employee" version="1.5"> <fields> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/solrconfig.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/solrconfig.xml b/gora-solr/src/test/conf/solr/Employee/conf/solrconfig.xml index 9bc4b3d..81ec4ba 100644 --- a/gora-solr/src/test/conf/solr/Employee/conf/solrconfig.xml +++ b/gora-solr/src/test/conf/solr/Employee/conf/solrconfig.xml @@ -21,7 +21,7 @@ this file, see http://wiki.apache.org/solr/SolrConfigXml. --> <config> - <luceneMatchVersion>LUCENE_40</luceneMatchVersion> + <luceneMatchVersion>4.8</luceneMatchVersion> <dataDir>${solr.data.dir:}</dataDir> <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/stopwords.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/stopwords.txt b/gora-solr/src/test/conf/solr/Employee/conf/stopwords.txt new file mode 100644 index 0000000..25b47f6 --- /dev/null +++ b/gora-solr/src/test/conf/solr/Employee/conf/stopwords.txt @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/conf/synonyms.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/conf/synonyms.txt b/gora-solr/src/test/conf/solr/Employee/conf/synonyms.txt new file mode 100644 index 0000000..f00294b --- /dev/null +++ b/gora-solr/src/test/conf/solr/Employee/conf/synonyms.txt @@ -0,0 +1,29 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaafoo => aaabar +bbbfoo => bbbfoo bbbbar +cccfoo => cccbar cccbaz +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/Employee/core.properties ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/Employee/core.properties b/gora-solr/src/test/conf/solr/Employee/core.properties new file mode 100644 index 0000000..d5cc1f9 --- /dev/null +++ b/gora-solr/src/test/conf/solr/Employee/core.properties @@ -0,0 +1 @@ +name=Employee http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/lang/stopwords_en.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/lang/stopwords_en.txt b/gora-solr/src/test/conf/solr/WebPage/conf/lang/stopwords_en.txt new file mode 100644 index 0000000..224230c --- /dev/null +++ b/gora-solr/src/test/conf/solr/WebPage/conf/lang/stopwords_en.txt @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# a couple of test stopwords to test that the words are really being +# configured from this file: +stopworda +stopwordb + +# Standard english stop words taken from Lucene's StopAnalyzer +a +an +and +are +as +at +be +but +by +for +if +in +into +is +it +no +not +of +on +or +such +that +the +their +then +there +these +they +this +to +was +will +with http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/protwords.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/protwords.txt b/gora-solr/src/test/conf/solr/WebPage/conf/protwords.txt new file mode 100644 index 0000000..5a32e50 --- /dev/null +++ b/gora-solr/src/test/conf/solr/WebPage/conf/protwords.txt @@ -0,0 +1,21 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +# Use a protected word file to protect against the stemmer reducing two +# unrelated words to the same base word. + +# Some non-words that normally won't be encountered, +# just to test that they won't be stemmed. +dontstems +zwhacky + http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/schema.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/schema.xml b/gora-solr/src/test/conf/solr/WebPage/conf/schema.xml index 48bde7c..fe36abb 100644 --- a/gora-solr/src/test/conf/solr/WebPage/conf/schema.xml +++ b/gora-solr/src/test/conf/solr/WebPage/conf/schema.xml @@ -16,7 +16,7 @@ limitations under the License. --> -<schema name="testexample" version="1.5"> +<schema name="test example WebPage" version="1.5"> <fields> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/solrconfig.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/solrconfig.xml b/gora-solr/src/test/conf/solr/WebPage/conf/solrconfig.xml index cbd69ba..a88f393 100644 --- a/gora-solr/src/test/conf/solr/WebPage/conf/solrconfig.xml +++ b/gora-solr/src/test/conf/solr/WebPage/conf/solrconfig.xml @@ -21,7 +21,7 @@ this file, see http://wiki.apache.org/solr/SolrConfigXml. --> <config> - <luceneMatchVersion>LUCENE_40</luceneMatchVersion> + <luceneMatchVersion>4.8</luceneMatchVersion> <dataDir>${solr.data.dir:}</dataDir> <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/stopwords.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/stopwords.txt b/gora-solr/src/test/conf/solr/WebPage/conf/stopwords.txt new file mode 100644 index 0000000..25b47f6 --- /dev/null +++ b/gora-solr/src/test/conf/solr/WebPage/conf/stopwords.txt @@ -0,0 +1,14 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/conf/synonyms.txt ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/conf/synonyms.txt b/gora-solr/src/test/conf/solr/WebPage/conf/synonyms.txt new file mode 100644 index 0000000..f00294b --- /dev/null +++ b/gora-solr/src/test/conf/solr/WebPage/conf/synonyms.txt @@ -0,0 +1,29 @@ +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#----------------------------------------------------------------------- +#some test synonym mappings unlikely to appear in real input text +aaafoo => aaabar +bbbfoo => bbbfoo bbbbar +cccfoo => cccbar cccbaz +fooaaa,baraaa,bazaaa + +# Some synonym groups specific to this example +GB,gib,gigabyte,gigabytes +MB,mib,megabyte,megabytes +Television, Televisions, TV, TVs +#notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming +#after us won't split it into two words. + +# Synonym mappings can be used for spelling correction too +pixima => pixma + http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/WebPage/core.properties ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/WebPage/core.properties b/gora-solr/src/test/conf/solr/WebPage/core.properties new file mode 100644 index 0000000..ff8238b --- /dev/null +++ b/gora-solr/src/test/conf/solr/WebPage/core.properties @@ -0,0 +1 @@ +name=WebPage http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/collection1/conf/solrconfig.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/collection1/conf/solrconfig.xml b/gora-solr/src/test/conf/solr/collection1/conf/solrconfig.xml index 1a13205..5e5fc9a 100644 --- a/gora-solr/src/test/conf/solr/collection1/conf/solrconfig.xml +++ b/gora-solr/src/test/conf/solr/collection1/conf/solrconfig.xml @@ -21,7 +21,7 @@ this file, see http://wiki.apache.org/solr/SolrConfigXml. --> <config> - <luceneMatchVersion>LUCENE_40</luceneMatchVersion> + <luceneMatchVersion>4.8</luceneMatchVersion> <dataDir>${solr.data.dir:}</dataDir> <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/collection1/core.properties ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/collection1/core.properties b/gora-solr/src/test/conf/solr/collection1/core.properties new file mode 100644 index 0000000..bc0cf7d --- /dev/null +++ b/gora-solr/src/test/conf/solr/collection1/core.properties @@ -0,0 +1 @@ +name=collection1 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/solr.xml ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/solr.xml b/gora-solr/src/test/conf/solr/solr.xml index 2cb6e91..e7f630d 100644 --- a/gora-solr/src/test/conf/solr/solr.xml +++ b/gora-solr/src/test/conf/solr/solr.xml @@ -26,11 +26,34 @@ http://wiki.apache.org/solr/CoreAdmin --> +<!-- + All (relative) paths are relative to the Solr Home Directory + + persistent: Save changes made via the API to this file + sharedLib: path to a lib directory that will be shared across all cores +--> <solr persistent="false"> + <!-- by default, this is 50 @ WARN + <logging enabled="true"> + <watcher size="100" threshold="DEBUG" /> + </logging> + --> - <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}"> + <!-- + adminPath: RequestHandler path to manage cores. + If 'null' (or absent), cores will not be manageable via request handler + defaultCoreName: (optional) core to use when no core name is specified in an access url + + All of the attributes in cores after defaultCoreName only apply when running in SolrCloud mode. + You can read more about SolrCloud mode at http://wiki.apache.org/solr/SolrCloud + --> + <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:9876}" + hostContext="${hostContext:solr}" zkClientTimeout="${zkClientTimeout:15000}"> + <core name="collection1" instanceDir="collection1" /> <core name="Employee" instanceDir="Employee" /> <core name="WebPage" instanceDir="WebPage" /> + <!-- shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory"> + <str name="urlScheme">${urlScheme:}</str> + </shardHandlerFactory--> </cores> - </solr> http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/conf/solr/zoo.cfg ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/conf/solr/zoo.cfg b/gora-solr/src/test/conf/solr/zoo.cfg new file mode 100644 index 0000000..863fd19 --- /dev/null +++ b/gora-solr/src/test/conf/solr/zoo.cfg @@ -0,0 +1,17 @@ +# The number of milliseconds of each tick +tickTime=2000 +# The number of ticks that the initial +# synchronization phase can take +initLimit=10 +# The number of ticks that can pass between +# sending a request and getting an acknowledgement +syncLimit=5 + +# the directory where the snapshot is stored. +# dataDir=/opt/zookeeper/data +# NOTE: Solr defaults the dataDir to <solrHome>/zoo_data + +# the port at which the clients will connect +# clientPort=2181 +# NOTE: Solr sets this based on zkRun / zkHost params + http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java ---------------------------------------------------------------------- diff --git a/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java b/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java index d736dc1..d23788d 100644 --- a/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java +++ b/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java @@ -26,6 +26,7 @@ import org.apache.gora.solr.store.SolrStore; import org.apache.solr.client.solrj.embedded.JettySolrRunner; public class GoraSolrTestDriver extends GoraTestDriver { + //Embedded JettySolr server JettySolrRunner solr; public GoraSolrTestDriver() { @@ -35,7 +36,7 @@ public class GoraSolrTestDriver extends GoraTestDriver { @Override public void setUpClass() throws Exception { super.setUpClass(); - solr = new JettySolrRunner("solr","/solr", 9876); + solr = new JettySolrRunner("src/test/conf/solr","/solr", 9876); solr.start(); } @@ -53,7 +54,7 @@ public class GoraSolrTestDriver extends GoraTestDriver { * Simply cleans up Solr's output from the Unit tests. * In the case of a failure, it waits 250 msecs and tries again, 3 times in total. */ - public void cleanupDirectoriesFailover() { + private void cleanupDirectoriesFailover() { int tries = 3; while (tries-- > 0) { try { @@ -76,17 +77,19 @@ public class GoraSolrTestDriver extends GoraTestDriver { * @throws Exception * if an error occurs */ - public void cleanupDirectories() throws Exception { - File dirFile = new File("solr"); - if (dirFile.exists()) { - FileUtils.deleteDirectory(dirFile); + private void cleanupDirectories() throws Exception { + File employeeDirFile = new File("src/test/conf/solr/Employee/data"); + File webpageDirFile = new File("src/test/conf/solr/WebPage/data"); + if (employeeDirFile.exists()) { + FileUtils.deleteDirectory(employeeDirFile); + } + if (webpageDirFile.exists()) { + FileUtils.deleteDirectory(webpageDirFile); } } - @Override protected void setProperties(Properties properties) { - // TODO Auto-generated method stub super.setProperties(properties); } http://git-wip-us.apache.org/repos/asf/gora/blob/475027d5/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index a89f5af..d200cff 100644 --- a/pom.xml +++ b/pom.xml @@ -281,17 +281,17 @@ </repository> </repositories> - <build> - <defaultGoal>install</defaultGoal> - <directory>target</directory> - <outputDirectory>${basedir}/target/classes</outputDirectory> - <finalName>${project.artifactId}-${project.version}</finalName> - <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory> - <sourceDirectory>${basedir}/src/main/java</sourceDirectory> - <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory> - <pluginManagement> - <plugins> - <plugin> + <build> + <defaultGoal>install</defaultGoal> + <directory>target</directory> + <outputDirectory>${basedir}/target/classes</outputDirectory> + <finalName>${project.artifactId}-${project.version}</finalName> + <testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory> + <sourceDirectory>${basedir}/src/main/java</sourceDirectory> + <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory> + <pluginManagement> + <plugins> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>${maven-assembly-plugin.version}</version> @@ -322,16 +322,16 @@ <artifactId>maven-clean-plugin</artifactId> <version>${maven-clean-plugin.version}</version> <configuration> - <filesets> - <fileset> - <directory>${basedir}/lib</directory> - <followSymlinks>false</followSymlinks> - <useDefaultExcludes>true</useDefaultExcludes> - <includes> - <include>*.jar</include> - </includes> - </fileset> - </filesets> + <filesets> + <fileset> + <directory>${basedir}/lib</directory> + <followSymlinks>false</followSymlinks> + <useDefaultExcludes>true</useDefaultExcludes> + <includes> + <include>*.jar</include> + </includes> + </fileset> + </filesets> </configuration> </plugin> <plugin> @@ -384,23 +384,32 @@ </lifecycleMappingMetadata> </configuration> </plugin> - </plugins> - </pluginManagement> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${maven-compiler-plugin.version}</version> + <inherited>true</inherited> + <configuration> + <source>${javac.src.version}</source> + <target>${javac.target.version}</target> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + <!-- executable>{JAVA_HOME_1_7}/bin/javac</executable --> + <fork>true</fork> + </configuration> + </plugin> + </plugins> + </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> - <inherited>true</inherited> - <configuration> - <source>${javac.src.version}</source> - <target>${javac.target.version}</target> - </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>${maven-surfire-plugin.version}</version> + <version>${maven-surfire-plugin.version}</version><!--$NO-MVN-MAN-VER$--> <inherited>true</inherited> <configuration> <systemPropertyVariables> @@ -613,14 +622,14 @@ <cassandra.version>2.0.2</cassandra.version> <hector.version>1.1-4</hector.version> <!-- Solr Dependencies --> - <lucene-solr.version>4.3.0</lucene-solr.version> - <solr-solrj.version>4.3.0</solr-solrj.version> + <lucene-solr.version>4.8.1</lucene-solr.version> + <solr-solrj.version>4.8.1</solr-solrj.version> <jetty.version>8.1.8.v20121106</jetty.version> <slf4j.version>1.6.6</slf4j.version> <log4j.version>1.2.16</log4j.version> - <tika.version>1.3</tika.version> + <tika.version>1.5</tika.version> <httpcomponents.version>4.2.3</httpcomponents.version> - <commons-io.version>2.1</commons-io.version> + <commons-io.version>1.3.2</commons-io.version> <restlet.version>2.1.1</restlet.version> <!-- Misc Dependencies --> @@ -638,7 +647,7 @@ <junit.version>4.10</junit.version> <!-- Maven Plugin Dependencies --> - <maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version> + <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version> <maven-resources-plugin.version>2.5</maven-resources-plugin.version> <!-- pegged at 2.3.2 for eclipse users, see https://github.com/sonatype/m2eclipse-extras/issues/10 --> <maven-jar-plugin.version>2.3.2</maven-jar-plugin.version> @@ -658,12 +667,13 @@ <!-- General Properties --> <implementation.build>${scmBranch}@r${buildNumber}</implementation.build> - <javac.src.version>1.6</javac.src.version> - <javac.target.version>1.6</javac.target.version> + <javac.src.version>1.7</javac.src.version> + <javac.target.version>1.7</javac.target.version> <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format> <skipTests>false</skipTests> <assembly.finalName>apache-${project.build.finalName}</assembly.finalName> <downloads.url>http://www.apache.org/dist/gora</downloads.url> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencyManagement> @@ -968,7 +978,7 @@ <version>1.2.1</version> </dependency> <dependency> - <groupId>commons-io</groupId> + <groupId>org.apache.commons</groupId> <artifactId>commons-io</artifactId> <version>${commons-io.version}</version> </dependency>