# 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
#
#
# 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.
# The behavior of TestSolrServer can be modified prior to start() by changing
# port, solr_home, and quiet properties.
require 'singleton'
# configure the singleton with some defaults
end
error = false
puts "starting solr server on #{RUBY_PLATFORM}"
error = true
puts "stopping solr server"
end
return error
end
"java -Djetty.port=#{@port} -Dsolr.solr.home=#{@solr_home} -jar start.jar"
end
puts "jetty_home: #{@jetty_home}"
puts "solr_home: #{@solr_home}"
puts "jetty_command: #{jetty_command}"
end
def stop
end
if RUBY_PLATFORM =~ /mswin32/
# start the solr server
Dir.chdir(@jetty_home) do
:app_name => jetty_command,
:process_inherit => false,
:thread_inherit => true,
:cwd => "#{@jetty_home}"
end
end
# stop a running solr server
Process.kill(1, @pid)
end
else # Not Windows
# start the solr server
Dir.chdir(@jetty_home) do
STDERR.close if @quiet
exec jetty_command
end
end
end
# stop a running solr server
end
end
end