<commit_before>require 'test/unit'
require 'logging'
require File.expand_path '../../../../../assert_helper.rb', __FILE__
require File.expand_path '../../../../../../lib/configuration/app_logger.rb', __FILE__
require File.expand_path '../../../../../../lib/code/builder/java/java_builder.rb', __FILE__

class JavaBuilderTest < Test::Unit::TestCase
  
  include RamlPoliglota::Code::Builder::Java

  def test_build_model
    builder = JavaBuilder.new
    assert_nothing_raised(RuntimeError) { builder.build_model(nil) }
  end

end<commit_msg>Apply unit test to java builder.<commit_after>require 'test/unit'
require 'logging'
require File.expand_path '../../../../../assert_helper.rb', __FILE__
require File.expand_path '../../../../../../lib/configuration/app_logger.rb', __FILE__
require File.expand_path '../../../../../../lib/code/builder/java/java_builder.rb', __FILE__

class JavaBuilderTest < Test::Unit::TestCase
  
  include RamlPoliglota::Code::Builder::Java

  def test_build_model
    builder = JavaBuilder.new
    
    clazz = CLASS_META_FACTORY[:model][:bilbo_baggins][:object]
    clazz.methods.clear
    hash = Hash.new
    hash['class'] = clazz

    expected = CLASS_META_FACTORY[:model][:bilbo_baggins][:text]
    actual = builder.build_model(hash)

    assert_equal expected, actual
  end

end
{'fraction_non_alphanumeric': 0.17391304347826086, 'fraction_numerical': 0.0, 'mean_word_length': 3.493150684931507, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6980102', 'n_tokens_mistral': 412, 'n_tokens_neox': 407, 'n_words': 74}