<commit_before>require 'rho/mapview'

describe "MapView" do

  it "should create" do
    state = MapView.state
    state.should be_nil

    MapView.create :settings => {:map_type => 'roadmap', :region => [37, -122, 10, 10]}
    w = 5
    #w = 5 if System::get_property('platform') == 'ANDROID'
    sleep 20

    state = MapView.state
    state.should_not be_nil
    state.is_a?(Hash).should == true 
    delta = 0.001
    (state[:center][:latitude] - 37.0).abs.should  < delta
    (state[:center][:longitude] - (-122.0)).abs.should  < delta

    MapView.close
    sleep 20

    state = MapView.state
    state.should be_nil
  end

end<commit_msg>add test for 500 annotations in MapView<commit_after>require 'rho/mapview'

describe "MapView" do

  it "should create" do
    state = MapView.state
    state.should be_nil

    MapView.create :settings => {:map_type => 'roadmap', :region => [37, -122, 10, 10]}
    w = 5
    #w = 5 if System::get_property('platform') == 'ANDROID'
    sleep 20

    state = MapView.state
    state.should_not be_nil
    state.is_a?(Hash).should == true 
    delta = 0.001
    (state[:center][:latitude] - 37.0).abs.should  < delta
    (state[:center][:longitude] - (-122.0)).abs.should  < delta

    MapView.close
    sleep 20

    state = MapView.state
    state.should be_nil
  end

  it "should create 500 annotations" do
    state = MapView.state
    state.should be_nil

     myannotations = []
     500.times do |j|
          annotation = {:latitude => '37.349691', :longitude => '-121.983261', :title => "Test Location", :subtitle => "test", :url => "/app/GeoLocation/show?city=Current Location"}	
          myannotations << annotation
     end

     myannotations <<   {:street_address => "Cupertino, CA 95014", :title => "Cupertino", :subtitle => "zip: 95014", :url => "/app/GeoLocation/show?city=Cupertino"}
     myannotations << {:street_address => "Santa Clara, CA 95051", :title => "Santa Clara", :subtitle => "zip: 95051", :url => "/app/GeoLocation/show?city=Santa%20Clara"}

     map_params = {
          :settings => {:map_type => "roadmap", :region => [37, -122, 10, 10],
                        :zoom_enabled => true, :scroll_enabled => true, :shows_user_location => true, :api_key => '<KEY>'},
          :annotations => myannotations
     }

    MapView.create map_params

    w = 5
    #w = 5 if System::get_property('platform') == 'ANDROID'
    sleep 40

    state = MapView.state
    state.should_not be_nil
    state.is_a?(Hash).should == true 
    delta = 0.001
    (state[:center][:latitude] - 37.0).abs.should  < delta
    (state[:center][:longitude] - (-122.0)).abs.should  < delta

    MapView.close
    sleep 20

    state = MapView.state
    state.should be_nil
  end




end
{'fraction_non_alphanumeric': 0.1506398537477148, 'fraction_numerical': 0.04606946983546618, 'mean_word_length': 2.842696629213483, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 31, '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': '3420208', 'n_tokens_mistral': 1043, 'n_tokens_neox': 905, 'n_words': 221}