<commit_before>$LOAD_PATH.unshift File.expand_path('../mixin-utils', __FILE__)
$LOAD_PATH.unshift File.expand_path('../mixin-checkers', __FILE__)

require 'test/unit'
require 'killbill_client'
require 'helper'
require 'checker'
require 'logger'

module KillBillIntegrationTests
  class Base < Test::Unit::TestCase

    include Helper
    include Checker

    DEFAULT_KB_ADDRESS='127.0.0.1'
    DEFAULT_KB_PORT='8080'

    DEFAULT_KB_INIT_DATE = "2013-08-01"
    DEFAULT_KB_INIT_CLOCK = "#{DEFAULT_KB_INIT_DATE}T06:00:00.000Z"

    DEFAULT_MULTI_TENANT_INFO = {:use_multi_tenant => true,
                                 :create_multi_tenant => true}

    def setup_base(user=self.method_name, tenant_info=DEFAULT_MULTI_TENANT_INFO, init_clock=DEFAULT_KB_INIT_CLOCK, killbill_address=DEFAULT_KB_ADDRESS, killbill_port=DEFAULT_KB_PORT)

      # make sure this fits into 50 characters
      @user = user.slice(0..45)

      # Default running instance of Kill Bill server
      reset_killbill_client_url(killbill_address, killbill_port)

      # If needed we can activate client logger
      #setup_logger

      # RBAC default options
      @options = {:username => 'admin', :password => 'password'}

      # Create tenant and provide options for multi-tenants headers(X-Killbill-ApiKey/X-Killbill-ApiSecret)
      if tenant_info[:use_multi_tenant]
        if tenant_info[:create_multi_tenant]
          tenant = setup_create_tenant(@user, @options)
          @options[:api_key] = tenant.api_key
          @options[:api_secret] = tenant.api_secret
        # Reuse mt
        else
          @options[:api_key] = tenant_info[:api_key]
          @options[:api_secret] = tenant_info[:api_secret]<commit_msg>test_base: make username and password configurable<commit_after>$LOAD_PATH.unshift File.expand_path('../mixin-utils', __FILE__)
$LOAD_PATH.unshift File.expand_path('../mixin-checkers', __FILE__)

require 'test/unit'
require 'killbill_client'
require 'helper'
require 'checker'
require 'logger'

module KillBillIntegrationTests
  class Base < Test::Unit::TestCase

    include Helper
    include Checker

    DEFAULT_KB_ADDRESS='127.0.0.1'
    DEFAULT_KB_PORT='8080'

    DEFAULT_KB_INIT_DATE = "2013-08-01"
    DEFAULT_KB_INIT_CLOCK = "#{DEFAULT_KB_INIT_DATE}T06:00:00.000Z"

    DEFAULT_MULTI_TENANT_INFO = {:use_multi_tenant => true,
                                 :create_multi_tenant => true}

    def setup_base(user=self.method_name, tenant_info=DEFAULT_MULTI_TENANT_INFO, init_clock=DEFAULT_KB_INIT_CLOCK, killbill_address=DEFAULT_KB_ADDRESS, killbill_port=DEFAULT_KB_PORT)

      # make sure this fits into 50 characters
      @user = user.slice(0..45)

      # Default running instance of Kill Bill server
      reset_killbill_client_url(killbill_address, killbill_port)

      # If needed we can activate client logger
      #setup_logger

      # RBAC default options
      @options = {:username => ENV['USERNAME'] || 'admin', :password => ENV['PASSWORD'] || 'password'}

      # Create tenant and provide options for multi-tenants headers(X-Killbill-ApiKey/X-Killbill-ApiSecret)
      if tenant_info[:use_multi_tenant]
        if tenant_info[:create_multi_tenant]
          tenant = setup_create_tenant(@user, @options)
          @options[:api_key] = tenant.api_key
          @options[:api_secret] = tenant.api_secret
        # Reuse mt
        else
          @options[:api_key] = tenant_info[:api_key]
          @options[:api_secret] = tenant_info[:api_secret]
{'fraction_non_alphanumeric': 0.10043165467625899, 'fraction_numerical': 0.01841726618705036, 'mean_word_length': 3.684636118598383, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6257027', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1084, 'n_words': 210}