mirror of https://github.com/apache/lucene.git
refactor the solr mock a bit more
git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@492692 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b3fc2da6b
commit
9da08c70d7
|
@ -45,7 +45,7 @@ end
|
|||
Rake::TestTask.new('test') do |t|
|
||||
t.pattern = 'test/*_test.rb'
|
||||
t.verbose = true
|
||||
t.ruby_opts = ['-r solr', '-r test/unit']
|
||||
t.ruby_opts = ['-r solr', '-r test/unit', '-Itest']
|
||||
end
|
||||
|
||||
task :test do
|
||||
|
|
|
@ -12,23 +12,9 @@
|
|||
|
||||
require 'test/unit'
|
||||
require 'solr'
|
||||
require 'solr_mock_base'
|
||||
|
||||
module Solr
|
||||
class Connection
|
||||
def post(request)
|
||||
"foo"
|
||||
end
|
||||
end
|
||||
|
||||
class MockSolrBaseTest < Test::Unit::TestCase
|
||||
def test_mock
|
||||
connection = Connection.new("http://localhost:9999")
|
||||
assert_equal "foo", connection.post(UpdateRequest.new("bogus"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ConnectionTest < Solr::MockSolrBaseTest
|
||||
class ConnectionTest < SolrMockBaseTestCase
|
||||
def test_connection_initialize
|
||||
request = Solr::UpdateRequest.new("<commit/>")
|
||||
connection = Solr::Connection.new("http://localhost:8983")
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
require 'test/unit'
|
||||
|
||||
def start_solr_server
|
||||
Dir.chdir(File.dirname(__FILE__) + '/../solr') do
|
||||
puts "starting solr server"
|
||||
|
|
Loading…
Reference in New Issue