<commit_before>-module(testing_config).

-include_lib("eunit/include/eunit.hrl").
-include_lib("riak_solr/include/riak_solr.hrl").

parse_test_() ->
    [{setup, fun() -> start_config_server() end,
      fun({ok, Pid}) -> exit(Pid, kill) end,
      [fun() ->
               {ok, Schema} = riak_solr_config:get_schema("schema1"),
               validate_schema(schema1, Schema) end,
       fun() ->
               %% Parse...
               {ok, Xml} = file:read_file("./../test/test_data/add.xml"),
               {ok, Command, Entries} = riak_solr_xml_xform:xform(Xml),

               %% Validate...
               {ok, Schema} = riak_solr_config:get_schema("schema1"),
               ok = Schema:validate_commands(Command, Entries),
               sanity_check_cmds(Cmds1) end]}].

%% Helper functions
start_config_server() ->
    application:load(riak_solr),<commit_msg>Fixing up solr tests<commit_after>-module(testing_config).

-include_lib("eunit/include/eunit.hrl").

parse_test_() ->
    [{setup, fun() -> start_config_server() end,
      fun({ok, Pid}) -> exit(Pid, kill) end,
      [fun() ->
               {ok, Schema} = riak_solr_config:get_schema("schema1"),
               validate_schema(schema1, Schema) end,
       fun() ->
               %% Parse...
               {ok, Xml} = file:read_file("./../test/test_data/add.xml"),
               {ok, Command, Entries} = riak_solr_xml_xform:xform(Xml),

               %% Validate...
               {ok, Schema} = riak_solr_config:get_schema("schema1"),
               ok = Schema:validate_commands(Command, Entries),
               sanity_check_cmds(Cmds1) end]}].

%% Helper functions
start_config_server() ->
    application:load(riak_solr),
{'fraction_non_alphanumeric': 0.1611957796014068, 'fraction_numerical': 0.004689331770222743, 'mean_word_length': 2.3735177865612647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '7305085', 'n_tokens_mistral': 571, 'n_tokens_neox': 564, 'n_words': 85}