[Groonga-commit] groonga/gcs [master] Output root element #66

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 13日 (金) 18:11:51 JST


SHIMODA Hiroshi	2012-07-13 18:11:51 +0900 (Fri, 13 Jul 2012)

  New Revision: 2779455fa95bb578401c0a93c566d8117837c6e0
  https://github.com/groonga/gcs/commit/2779455fa95bb578401c0a93c566d8117837c6e0

  Log:
    Output root element #66

  Modified files:
    test/api-configuration.test.js
    test/test-utils.js

  Modified: test/api-configuration.test.js (+23 -22)
===================================================================
--- test/api-configuration.test.js    2012-07-13 18:06:45 +0900 (4a52ac5)
+++ test/api-configuration.test.js    2012-07-13 18:11:51 +0900 (461cf12)
@@ -62,31 +62,32 @@ suite('Configuration API', function() {
 
         var expected = {
               statusCode: 200,
-              body: { '@': {
-                        xmlns: XMLNS
+              body: {
+                CreateDomainResponse: {
+                  '@': { xmlns: XMLNS },
+                  CreateDomainResult: {
+                    DomainStatus: {
+                      Created: 'true',
+                      Deleted: 'false',
+                      DocService: {
+                        Endpoint: 'doc-companies-' + FAKE_DOMAIN_ID + '.localhost'
                       },
-                      CreateDomainResult: {
-                        DomainStatus: {
-                          Created: 'true',
-                          Deleted: 'false',
-                          DocService: {
-                            Endpoint: 'doc-companies-' + FAKE_DOMAIN_ID + '.localhost'
-                          },
-                          DomainId: FAKE_DOMAIN_ID + '/companies',
-                          DomainName: 'companies',
-                          NumSearchableDocs: '0',
-                          RequiresIndexDocuments: 'false',
-                          SearchInstanceCount: '0',
-                          SearchPartitionCount: '0',
-                          SearchService: {
-                            Endpoint: 'search-companies-' + FAKE_DOMAIN_ID + '.localhost'
-                          }
-                        }
-                      },
-                      ResponseMetadata: {
-                        RequestId: {}
+                      DomainId: FAKE_DOMAIN_ID + '/companies',
+                      DomainName: 'companies',
+                      NumSearchableDocs: '0',
+                      RequiresIndexDocuments: 'false',
+                      SearchInstanceCount: '0',
+                      SearchPartitionCount: '0',
+                      SearchService: {
+                        Endpoint: 'search-companies-' + FAKE_DOMAIN_ID + '.localhost'
                       }
                     }
+                  },
+                  ResponseMetadata: {
+                    RequestId: {}
+                  }
+                }
+              }
             };
         assert.deepEqual(toParsedResponse(response), expected);
 

  Modified: test/test-utils.js (+3 -1)
===================================================================
--- test/test-utils.js    2012-07-13 18:06:45 +0900 (7bb3176)
+++ test/test-utils.js    2012-07-13 18:11:51 +0900 (7ccbe04)
@@ -133,7 +133,9 @@ exports.rmRSync = rmRSync;
 
 function XMLStringToJSON(xml) {
   var xml2js = require('xml2js');
-  var parser = new xml2js.Parser();
+  var parser = new xml2js.Parser({
+                 explicitRoot: true
+               });
   var json;
   parser.addListener('end', function(result) {
     json = result;
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下載 



Groonga-commit メーリングリストの案内
Back to archive index