Changeset 8263

Show
Ignore:
Timestamp:
04/24/07 04:26:50 (19 months ago)
Author:
alex
Message:

tests.* -> doh.* migration. Moving DOH out of Core. Fixes #2795

Location:
dojo/trunk/tests
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/tests/data/JsonItemStore.js

    r8247 r8263  
    22dojo.require("dojo.data.JsonItemStore"); 
    33 
    4 tests.register("tests.data.JsonItemStore",  
     4function getCountriesStore(){ 
     5        if(dojo.isBrowser){ 
     6                return new dojo.data.JsonItemStore({url: dojo.moduleUrl("tests", "data/countries.json").toString() } );             
     7        }else{ 
     8                var jsonData = {}; 
     9                jsonData.identifier="abbr"; 
     10                jsonData.items= []; 
     11                jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
     12                jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
     13                jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
     14                jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
     15                jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
     16                jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
     17                jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
     18                return new dojo.data.JsonItemStore({data: jsonData}); 
     19        } 
     20} 
     21 
     22function getCountriesAttrsStore(){ 
     23        if(dojo.isBrowser){ 
     24                return new dojo.data.JsonItemStore({url:  dojo.moduleUrl("tests", "data/countries_withattributes.json").toString() } );  
     25        }else{ 
     26                var jsonData = {}; 
     27                jsonData.identifier="name"; 
     28                jsonData.items= []; 
     29                jsonData.items.push({name:"abbr"}); 
     30                jsonData.items.push({name:"name"}); 
     31                jsonData.items.push({name:"capital"}); 
     32                jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
     33                jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
     34                jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
     35                jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
     36                jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
     37                jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
     38                jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
     39                return new dojo.data.JsonItemStore({data: jsonData}); 
     40        } 
     41} 
     42 
     43doh.register("tests.data.JsonItemStore",  
    544        [ 
    645                function testReadAPI_fetch_all(t){ 
     
    1049                        //              Simple test of a basic fetch on JsonItemStore. 
    1150                         
    12                         var jsonItemStore = null; 
    13                         if(dojo.isBrowser){ 
    14                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    15                         }else{ 
    16                                 var jsonData = {}; 
    17                                 jsonData.identifier="abbr"; 
    18                                 jsonData.items= []; 
    19                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    20                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    21                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    22                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    23                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    24                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    25                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    26                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    27                         } 
     51                        var jsonItemStore = getCountriesStore(); 
    2852                         
    29                         var d = new tests.Deferred(); 
     53                        var d = new doh.Deferred(); 
    3054            function completedAll(items, request){ 
    3155                                t.is(7, items.length); 
     
    4771                        //              Simple test of a basic fetch on JsonItemStore of a single item. 
    4872 
    49                         var jsonItemStore = null; 
    50                         if(dojo.isBrowser){ 
    51                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    52                         }else{ 
    53                                 var jsonData = {}; 
    54                                 jsonData.identifier="abbr"; 
    55                                 jsonData.items= []; 
    56                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    57                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    58                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    59                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    60                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    61                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    62                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    63                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    64                         } 
     73                        var jsonItemStore = getCountriesStore(); 
    6574                         
    66                         var d = new tests.Deferred(); 
     75                        var d = new doh.Deferred(); 
    6776                        function onComplete(items, request){ 
    6877                                t.assertEqual(items.length, 1); 
     
    8594                        //              Simple test of a basic fetch on JsonItemStore. 
    8695 
    87                         var jsonItemStore = null; 
    88                         if(dojo.isBrowser){ 
    89                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    90                         }else{ 
    91                                 var jsonData = {}; 
    92                                 jsonData.identifier="abbr"; 
    93                                 jsonData.items= []; 
    94                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    95                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    96                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    97                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    98                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    99                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    100                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    101                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    102                         } 
    103  
    104                         var d = new tests.Deferred(); 
     96                        var jsonItemStore = getCountriesStore(); 
     97 
     98                        var d = new doh.Deferred(); 
    10599                        count = 0; 
    106100 
     
    136130                         //             Test of multiple fetches on a single result.  Paging, if you will. 
    137131 
    138                         var jsonItemStore = null; 
    139                         if(dojo.isBrowser){ 
    140                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    141                         }else{ 
    142                                 var jsonData = {}; 
    143                                 jsonData.identifier="abbr"; 
    144                                 jsonData.items= []; 
    145                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    146                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    147                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    148                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    149                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    150                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    151                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    152                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    153                         } 
     132                        var jsonItemStore = getCountriesStore(); 
    154133                         
    155                         var d = new tests.Deferred(); 
     134                        var d = new doh.Deferred(); 
    156135                        function dumpFirstFetch(items, request){ 
    157136                                t.assertEqual(items.length, 5); 
     
    221200                        //              Simple test of the getValue function of the store. 
    222201 
    223                         var jsonItemStore = null; 
    224                         if(dojo.isBrowser){ 
    225                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    226                         }else{ 
    227                                 var jsonData = {}; 
    228                                 jsonData.identifier="abbr"; 
    229                                 jsonData.items= []; 
    230                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    231                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    232                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    233                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    234                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    235                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    236                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    237                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    238                         } 
     202                        var jsonItemStore = getCountriesStore(); 
     203 
    239204                        var item = jsonItemStore.getItemByIdentity("sv"); 
    240205                        t.assertTrue(item !== null); 
     
    248213                        //              Simple test of the getValue function passing in an item as the attribute identifier. 
    249214 
    250                         var jsonItemStore = null; 
    251                         if(dojo.isBrowser){ 
    252                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries_withattributes.json"});             
    253                         }else{ 
    254                                 var jsonData = {}; 
    255                                 jsonData.identifier="name"; 
    256                                 jsonData.items= []; 
    257                                 jsonData.items.push({name:"abbr"}); 
    258                                 jsonData.items.push({name:"name"}); 
    259                                 jsonData.items.push({name:"capital"}); 
    260                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    261                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    262                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    263                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    264                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    265                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    266                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    267                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    268                         } 
     215                        var jsonItemStore = getCountriesAttrsStore(); 
    269216 
    270217                        var itemAttribute = jsonItemStore.getItemByIdentity("abbr"); 
     
    282229                        //              Simple test of the getValues function of the store. 
    283230 
    284                         var jsonItemStore = null; 
    285                         if(dojo.isBrowser){ 
    286                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    287                         }else{ 
    288                                 var jsonData = {}; 
    289                                 jsonData.identifier="abbr"; 
    290                                 jsonData.items= []; 
    291                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    292                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    293                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    294                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    295                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    296                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    297                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    298                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    299                         } 
     231                        var jsonItemStore = getCountriesStore(); 
    300232 
    301233                        var item = jsonItemStore.getItemByIdentity("sv"); 
     
    312244                        //              Simple test of the getValue function passing in an item as the attribute identifier. 
    313245 
    314                         var jsonItemStore = null; 
    315                         if(dojo.isBrowser){ 
    316                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries_withattributes.json"});             
    317                         }else{ 
    318                                 var jsonData = {}; 
    319                                 jsonData.identifier="name"; 
    320                                 jsonData.items= []; 
    321                                 jsonData.items.push({name:"abbr"}); 
    322                                 jsonData.items.push({name:"name"}); 
    323                                 jsonData.items.push({name:"capital"}); 
    324                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    325                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    326                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    327                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    328                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    329                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    330                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    331                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    332                         } 
    333  
     246                        var jsonItemStore = getCountriesAttrsStore(); 
    334247 
    335248                        var itemAttribute = jsonItemStore.getItemByIdentity("abbr"); 
     
    348261                        //      description: 
    349262                        //              Simple test of the getItemByIdentity function of the store. 
     263 
     264                        var jsonItemStore = getCountriesStore(); 
    350265                         
    351                         var jsonItemStore = null; 
    352                         if(dojo.isBrowser){ 
    353                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    354                         }else{ 
    355                                 var jsonData = {}; 
    356                                 jsonData.identifier="abbr"; 
    357                                 jsonData.items= []; 
    358                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    359                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    360                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    361                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    362                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    363                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    364                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    365                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    366                         } 
    367  
    368266                        var item = jsonItemStore.getItemByIdentity("sv"); 
    369267                        if (item === null){ 
     
    384282                        //              Simple test of the isItem function of the store 
    385283 
    386                         var jsonItemStore = null; 
    387                         if(dojo.isBrowser){ 
    388                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    389                         }else{ 
    390                                 var jsonData = {}; 
    391                                 jsonData.identifier="abbr"; 
    392                                 jsonData.items= []; 
    393                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    394                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    395                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    396                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    397                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    398                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    399                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    400                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    401                         } 
     284                        var jsonItemStore = getCountriesStore(); 
    402285 
    403286                        var item = jsonItemStore.getItemByIdentity("sv"); 
     
    412295                        //              Simple test of the hasAttribute function of the store 
    413296 
    414                         var jsonItemStore = null; 
    415                         if(dojo.isBrowser){ 
    416                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    417                         }else{ 
    418                                 var jsonData = {}; 
    419                                 jsonData.identifier="abbr"; 
    420                                 jsonData.items= []; 
    421                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    422                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    423                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    424                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    425                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    426                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    427                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    428                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    429                         } 
     297                        var jsonItemStore = getCountriesStore(); 
    430298 
    431299                        var item = jsonItemStore.getItemByIdentity("sv"); 
     
    449317                        //              Simple test of the hasAttribute passing in an item as the attribute identifier. 
    450318 
    451                         var jsonItemStore = null; 
    452                         if(dojo.isBrowser){ 
    453                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries_withattributes.json"});             
    454                         }else{ 
    455                                 var jsonData = {}; 
    456                                 jsonData.identifier="name"; 
    457                                 jsonData.items= []; 
    458                                 jsonData.items.push({name:"abbr"}); 
    459                                 jsonData.items.push({name:"name"}); 
    460                                 jsonData.items.push({name:"capital"}); 
    461                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    462                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    463                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    464                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    465                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    466                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    467                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    468                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    469                         } 
     319                        var jsonItemStore = getCountriesAttrsStore(); 
    470320 
    471321                        //First fine the item in the store that represents the attribute with name 'abbr'. 
     
    487337                        //              Simple test of the containsValue function of the store 
    488338 
    489                         var jsonItemStore = null; 
    490                         if(dojo.isBrowser){ 
    491                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    492                         }else{ 
    493                                 var jsonData = {}; 
    494                                 jsonData.identifier="abbr"; 
    495                                 jsonData.items= []; 
    496                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    497                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    498                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    499                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    500                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    501                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    502                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    503                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    504                         } 
     339                        var jsonItemStore = getCountriesStore(); 
    505340 
    506341                        var item = jsonItemStore.getItemByIdentity("sv"); 
     
    525360                        //              Simple test of the containsValue function of the store using attribute lookup. 
    526361 
    527                         var jsonItemStore = null; 
    528                         if(dojo.isBrowser){ 
    529                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries_withattributes.json"});             
    530                         }else{ 
    531                                 var jsonData = {}; 
    532                                 jsonData.identifier="name"; 
    533                                 jsonData.items= []; 
    534                                 jsonData.items.push({name:"abbr"}); 
    535                                 jsonData.items.push({name:"name"}); 
    536                                 jsonData.items.push({name:"capital"}); 
    537                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    538                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    539                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    540                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    541                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    542                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    543                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    544                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    545                         } 
     362                        var jsonItemStore = getCountriesAttrsStore(); 
    546363 
    547364                        var attributeItem = jsonItemStore.getItemByIdentity("abbr"); 
     
    559376                        //              Simple test of the getAttributes function of the store 
    560377 
    561                         var jsonItemStore = null; 
    562                         if(dojo.isBrowser){ 
    563                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    564                         }else{ 
    565                                 var jsonData = {}; 
    566                                 jsonData.identifier="abbr"; 
    567                                 jsonData.items= []; 
    568                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    569                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    570                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    571                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    572                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    573                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    574                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    575                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    576                         } 
     378                        var jsonItemStore = getCountriesStore(); 
    577379 
    578380                        var item = jsonItemStore.getItemByIdentity("sv"); 
     
    592394                        //              Simple test of the getFeatures function of the store 
    593395 
    594                         var jsonItemStore = null; 
    595                         if(dojo.isBrowser){ 
    596                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    597                         }else{ 
    598                                 var jsonData = {}; 
    599                                 jsonData.identifier="abbr"; 
    600                                 jsonData.items= []; 
    601                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    602                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    603                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    604                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    605                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    606                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    607                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    608                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    609                         } 
     396                        var jsonItemStore = getCountriesStore(); 
    610397 
    611398                        var features = jsonItemStore.getFeatures();  
     
    623410                        //              Function to test pattern matching of everything starting with lowercase e 
    624411 
    625                         var jsonItemStore = null; 
    626                         if(dojo.isBrowser){ 
    627                                 jsonItemStore = new dojo.data.JsonItemStore({url: "data/countries.json"});             
    628                         }else{ 
    629                                 var jsonData = {}; 
    630                                 jsonData.identifier="abbr"; 
    631                                 jsonData.items= []; 
    632                                 jsonData.items.push({abbr:"ec",name:"Ecuador",capital:"Quito"}); 
    633                                 jsonData.items.push({abbr:'eg',name:'Egypt',capital:'Cairo'}); 
    634                                 jsonData.items.push({abbr:'sv',name:'El Salvador',capital:'San Salvador'}); 
    635                                 jsonData.items.push({abbr:'gq',name:'Equatorial Guinea',capital:'Malabo'}); 
    636                                 jsonData.items.push({abbr:'er',name:'Eritrea',capital:'Asmara'}); 
    637                                 jsonData.items.push({abbr:'ee',name:'Estonia',capital:'Tallinn' }); 
    638                                 jsonData.items.push({abbr:'et',name:'Ethiopia',capital:'Addis Ababa'}); 
    639                                 jsonItemStore = new dojo.data.JsonItemStore({data: jsonData}); 
    640                         } 
    641  
    642                         var d = new tests.Deferred(); 
     412                        var jsonItemStore = getCountriesStore(); 
     413 
     414                        var d = new doh.Deferred(); 
    643415                        function completed(items, request) { 
    644416                                t.assertEqual(items.length, 5); 
     
    685457                                                                 }); 
    686458                         
    687                         var d = new tests.Deferred(); 
     459                        var d = new doh.Deferre