@@ -99,23 +99,25 @@ describe('Runtime Catalogue', function() {
9999 }
100100 } ;
101101
102- let stub = sinon . stub ( runtimeCatalogue , '_makeLocalRequest' ) ;
103- stub . withArgs ( '../resources/descriptors/Hyperties.json' ) . returns ( new Promise ( function ( resolve , reject ) {
104- try {
105- resolve ( JSON . stringify ( Hyperties ) ) ;
106- } catch ( e ) {
107- reject ( e ) ;
108- }
109-
110- } ) ) ;
111-
112- stub . withArgs ( '../resources/descriptors/ProtoStubs.json' ) . returns ( new Promise ( function ( resolve , reject ) {
113- try {
114- resolve ( JSON . stringify ( ProtoStubs ) ) ;
115- } catch ( e ) {
116- reject ( e ) ;
117- }
118- } ) ) ;
102+ sinon . stub ( runtimeCatalogue , '_makeLocalRequest' , function ( url ) {
103+
104+ return new Promise ( function ( resolve , reject ) {
105+ if ( url === '../resources/descriptors/Hyperties.json' ) {
106+ try {
107+ resolve ( JSON . stringify ( Hyperties ) ) ;
108+ } catch ( e ) {
109+ reject ( e ) ;
110+ }
111+ } else if ( url === '../resources/descriptors/ProtoStubs.json' ) {
112+ try {
113+ resolve ( JSON . stringify ( ProtoStubs ) ) ;
114+ } catch ( e ) {
115+ reject ( e ) ;
116+ }
117+ }
118+ } ) ;
119+
120+ } ) ;
119121
120122 } ) ;
121123
@@ -150,11 +152,11 @@ describe('Runtime Catalogue', function() {
150152 // _hypertyType: '0',
151153 // _dataObjects: []
152154 // }
153- let descriptorValidation = [ '_guid' , '_type' , '_objectName' , '_description' , '_language' , '_sourcePackageURL' , '_signature' , '_sourcePackage' , '_configuration' , '_constraints' , '_policies' , '_messageSchema' , '_hypertyType' , '_dataObjects' ] ;
155+ let descriptorValidation = [ '_guid' , '_type' , '_version' , ' _objectName', '_description' , '_language' , '_sourcePackageURL' , '_signature' , '_sourcePackage' , '_configuration' , '_constraints' , '_policies' , '_messageSchema' , '_hypertyType' , '_dataObjects' ] ;
154156
155157 // TODO: Check the hyperty descriptor response and compare
156158 // with what is defined in the specification;
157- let hypertyDescriptorURL = 'hyperty-catalogue://sp1/HelloHyperty' ;
159+ let hypertyDescriptorURL = 'hyperty-catalogue://sp1.domain /HelloHyperty' ;
158160 expect ( runtimeCatalogue . getHypertyDescriptor ( hypertyDescriptorURL ) . then ( function ( hypertyDescriptor ) {
159161 _hypertyDescriptor = hypertyDescriptor ;
160162 return _hypertyDescriptor ;
@@ -187,7 +189,7 @@ describe('Runtime Catalogue', function() {
187189 // policies, constraints, configuration,
188190 // hypertyCapabilities, protocolCapabilities
189191 //
190- let descriptorValidation = [ '_guid' , '_type' , '_description' , '_objectName' , '_sourcePackageURL' , '_sourcePackage' , '_language' , '_signature' , '_messageSchemas' , '_configuration' , '_constraints' ] ;
192+ let descriptorValidation = [ '_guid' , '_type' , '_version' , ' _description', '_objectName' , '_sourcePackageURL' , '_sourcePackage' , '_language' , '_signature' , '_messageSchemas' , '_configuration' , '_constraints' ] ;
191193
192194 // TODO: Check the hyperty descriptor response and compare
193195 // with what is defined in the specification;
0 commit comments