<commit_before>/**
 Duration 30s
 Scene.db:
    *Ent 1: Anything.

 Tests:
   -std.http.basicGet
   -timeout


 If download is successful for all of them, prints success message.
 Otherwise, prints error message.

Stage 1:
  Issue http gets for google, stanfod, sirikata.com, and google with
 query parameters.

<wait 25 seconds >

Stage 2: 
 Check if all downloads are complete.  And are successful.  If we got information from all of them, then we 
 
 */

system.require('std/http/http.em');
system.require('unitTests/emTests/helperLibs/util.em');
mTest = new UnitTest('timeoutTest.em');

successObject = {
    'google':false,
    'stanford': false,
    'sirikata': false,
    'googleQueryParams':false
};


system.onPresenceConnected(stage1);

function stage1()
{
    system.timeout(30,endTimeout);

    //issue query to google
    url = 'http://www.google.com';
    std.http.basicGet(url,callbackFunctionFactory('google'));

    url = 'http://www.stanford.edu/';
    std.http.basicGet(url,callbackFunctionFactory('stanford'));

    url = 'http://www.sirikata.com/blog/';
    std.http.basicGet(url,callbackFunctionFactory('sirikata'));

    url = 'http://www.google.com/search?client=ubuntu&channel=fs&q=emerson+check+test&ie=utf-8&oe=utf-8';
    std.http.basicGet(url,callbackFunctionFactory('googleQueryParams'));
}


function callbackFunctionFactory(callbackSite)
{
    var returner = function (success,data)
    {<commit_msg>Made the em test so that it doesn't wait until you have a presence before issuing http query.<commit_after>/**
 Duration 30s
 Scene.db:
    *Ent 1: Anything.

 Tests:
   -std.http.basicGet
   -timeout


 If download is successful for all of them, prints success message.
 Otherwise, prints error message.

Stage 1:
  Issue http gets for google, stanfod, sirikata.com, and google with
 query parameters.

<wait 25 seconds >

Stage 2: 
 Check if all downloads are complete.  And are successful.  If we got information from all of them, then we 
 
 */

system.require('std/http/http.em');
system.require('unitTests/emTests/helperLibs/util.em');
mTest = new UnitTest('timeoutTest.em');

successObject = {
    'google':false,
    'stanford': false,
    'sirikata': false,
    'googleQueryParams':false
};


//system.onPresenceConnected(stage1);
stage1();

function stage1()
{
    system.timeout(30,endTimeout);

    //issue query to google
    url = 'http://www.google.com';
    std.http.basicGet(url,callbackFunctionFactory('google'));

    url = 'http://www.stanford.edu/';
    std.http.basicGet(url,callbackFunctionFactory('stanford'));

    url = 'http://www.sirikata.com/blog/';
    std.http.basicGet(url,callbackFunctionFactory('sirikata'));

    url = 'http://www.google.com/search?client=ubuntu&channel=fs&q=emerson+check+test&ie=utf-8&oe=utf-8';
    std.http.basicGet(url,callbackFunctionFactory('googleQueryParams'));
}


function callbackFunctionFactory(callbackSite)
{
    var returner = function (success,data)
    {
{'fraction_non_alphanumeric': 0.13497970230040596, 'fraction_numerical': 0.009133964817320704, 'mean_word_length': 4.080756013745704, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6983113', 'n_tokens_mistral': 983, 'n_tokens_neox': 929, 'n_words': 220}