@@ -222,106 +222,6 @@ describe( "thing shadow class unit tests", function() {
222222 } ) ;
223223 } ) ;
224224
225- describe ( "subscribe to an illegal non-thing topic" , function ( ) {
226- //
227- // Verify that the thing shadow module throws an exception if we
228- // attempt to subscribe to an illegal non-thing topic.
229- //
230- it ( "throws an exception" , function ( ) {
231- assert . throws ( function ( err ) {
232- var thingShadows = thingShadow ( {
233- keyPath :'test/data/private.pem.key' ,
234- certPath :'test/data/certificate.pem.crt' ,
235- caPath :'test/data/root-CA.crt' ,
236- clientId :'dummy-client-1' ,
237- host :'XXXX.iot.us-east-1.amazonaws.com'
238- } ) ;
239- thingShadows . subscribe ( '$aws/things/nonThingTopic1' ) ;
240- } , function ( err ) { console . log ( '\t[' + err + ']' ) ; return true ; }
241- ) ;
242- } ) ;
243- } ) ;
244-
245- describe ( "subscribe to an topic array which contains an illegal non-thing topic" , function ( ) {
246- //
247- // Verify that the thing shadow module throws an exception if we
248- // attempt to subscribe to an illegal non-thing topic.
249- //
250- it ( "throws an exception" , function ( ) {
251- assert . throws ( function ( err ) {
252- var thingShadows = thingShadow ( {
253- keyPath :'test/data/private.pem.key' ,
254- certPath :'test/data/certificate.pem.crt' ,
255- caPath :'test/data/root-CA.crt' ,
256- clientId :'dummy-client-1' ,
257- host :'XXXX.iot.us-east-1.amazonaws.com'
258- } ) ;
259- thingShadows . subscribe ( [ 'topic1' , '$aws/things/nonThingTopic1' , 'topic2' ] ) ;
260- } , function ( err ) { console . log ( '\t[' + err + ']' ) ; return true ; }
261- ) ;
262- } ) ;
263- } ) ;
264-
265- describe ( "publish to an illegal non-thing topic" , function ( ) {
266- //
267- // Verify that the thing shadow module throws an exception if we
268- // attempt to publish to an illegal non-thing topic.
269- //
270- it ( "throws an exception" , function ( ) {
271- assert . throws ( function ( err ) {
272- var thingShadows = thingShadow ( {
273- keyPath :'test/data/private.pem.key' ,
274- certPath :'test/data/certificate.pem.crt' ,
275- caPath :'test/data/root-CA.crt' ,
276- clientId :'dummy-client-1' ,
277- host :'XXXX.iot.us-east-1.amazonaws.com'
278- } ) ;
279- thingShadows . publish ( '$aws/things/nonThingTopic1' ,
280- { data : 'value' } ) ;
281- } , function ( err ) { console . log ( '\t[' + err + ']' ) ; return true ; }
282- ) ;
283- } ) ;
284- } ) ;
285-
286- describe ( "unsubscribe from an illegal non-thing topic" , function ( ) {
287- //
288- // Verify that the thing shadow module throws an exception if we
289- // attempt to unsubscribe from an illegal non-thing topic.
290- //
291- it ( "throws an exception" , function ( ) {
292- assert . throws ( function ( err ) {
293- var thingShadows = thingShadow ( {
294- keyPath :'test/data/private.pem.key' ,
295- certPath :'test/data/certificate.pem.crt' ,
296- caPath :'test/data/root-CA.crt' ,
297- clientId :'dummy-client-1' ,
298- host :'XXXX.iot.us-east-1.amazonaws.com'
299- } ) ;
300- thingShadows . unsubscribe ( '$aws/things/nonThingTopic1' ) ;
301- } , function ( err ) { console . log ( '\t[' + err + ']' ) ; return true ; }
302- ) ;
303- } ) ;
304- } ) ;
305- describe ( "unsubscribe from an array which contains illegal non-thing topic" , function ( ) {
306- //
307- // Verify that the thing shadow module throws an exception if we
308- // attempt to unsubscribe from an illegal non-thing topic.
309- //
310- it ( "throws an exception" , function ( ) {
311- assert . throws ( function ( err ) {
312- var thingShadows = thingShadow ( {
313- keyPath :'test/data/private.pem.key' ,
314- certPath :'test/data/certificate.pem.crt' ,
315- caPath :'test/data/root-CA.crt' ,
316- clientId :'dummy-client-1' ,
317- host :'XXXX.iot.us-east-1.amazonaws.com'
318- } ) ;
319- thingShadows . unsubscribe ( [ 'topic1' , '$aws/things/nonThingTopic1' , 'topic2' ] ) ;
320- } , function ( err ) { console . log ( '\t[' + err + ']' ) ; return true ; }
321- ) ;
322- } ) ;
323- } ) ;
324-
325225//
326226// Verify that the thing shadow module does not throw an exception
327227// when the end() method is invoked.
0 commit comments