Sha256: 21da55557bf6675e661eeb56ac564707081484511999b9721f4c5aee4f57abfa

Contents?: true

Size: 1.98 KB

Versions: 1

Compression:

Stored size: 1.98 KB

Contents

# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2011, 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed 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.
#

gem 'minitest'
require 'coveralls'
Coveralls.wear!
require 'minitest'
require 'couchbase'
require 'open-uri'
require 'ostruct'
require_relative 'mock'
require 'pry'

# Surpress connection logging
# java_import java.lang.System
# java_import java.util.logging.Logger
# java_import java.util.logging.Level

# properties = System.getProperties
# properties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.Log4JLogger")
# System.setProperties(properties)

# Logger.getLogger('net.spy.memcached').setLevel(Level::SEVERE)
# Logger.getLogger('com.couchbase.client').setLevel(Level::SEVERE)
# Logger.getLogger('com.couchbase.client.vbucket').setLevel(Level::SEVERE)

# $stderr = StringIO.new

class Minitest::Test

  def cb
    Couchbase.bucket
  end

  def with_configs(configs = {})
    configs = Couchbase::Bucket::DEFAULT_OPTIONS.merge(configs)
    if configs[:host].nil?
      configs[:host] = configs[:hostname]
    end
    yield OpenStruct.new(configs)
  end

  def uniq_id(*suffixes)
    test_id = [caller.first[/.*[` ](.*)'/, 1], suffixes].compact.join("_")
    @ids ||= {}
    @ids[test_id] ||= Time.now.to_f
    [test_id, @ids[test_id]].join("_")
  end

end

$mock = start_mock

Dir.glob('test/test_store.rb').each { |test| require test }
exit_code = Minitest.run(ARGV)
Couchbase.disconnect
$mock.stop
java.lang.System.exit(exit_code ? 0 : 1)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couchbase-jruby-client-0.1.8-java test/setup.rb