diff --git a/src/codec/MapGetAllCodec.ts b/src/codec/MapGetAllCodec.ts index e0ceea4b0..2e77434c9 100644 --- a/src/codec/MapGetAllCodec.ts +++ b/src/codec/MapGetAllCodec.ts @@ -1,12 +1,12 @@ /* tslint:disable */ import ClientMessage = require('../ClientMessage'); -import ImmutableLazyDataList = require('./ImmutableLazyDataList'); import {BitsUtil} from '../BitsUtil'; import Address = require('../Address'); import {AddressCodec} from './AddressCodec'; import {MemberCodec} from './MemberCodec'; import {Data} from '../serialization/Data'; import {EntryViewCodec} from './EntryViewCodec'; +import DistributedObjectInfoCodec = require('./DistributedObjectInfoCodec'); import {MapMessageType} from './MapMessageType'; var REQUEST_TYPE = MapMessageType.MAP_GETALL; @@ -16,14 +16,13 @@ var RETRYABLE = false; export class MapGetAllCodec { - static calculateSize(name:string, keys:any) { // Calculates the request payload size var dataSize:number = 0; dataSize += BitsUtil.calculateSizeString(name); dataSize += BitsUtil.INT_SIZE_IN_BYTES; - keys.foreach((keysItem:any) => { + keys.forEach((keysItem:any) => { dataSize += BitsUtil.calculateSizeData(keysItem); }); return dataSize; @@ -37,7 +36,7 @@ export class MapGetAllCodec { clientMessage.appendString(name); clientMessage.appendInt32(keys.length); - keys.foreach((keysItem:any) => { + keys.forEach((keysItem:any) => { clientMessage.appendData(keysItem); }); @@ -50,15 +49,18 @@ export class MapGetAllCodec { var parameters:any = {'response': null}; var responseSize = clientMessage.readInt32(); var response:any = []; - for (var responseIndex = 0; responseIndex <= responseSize; responseIndex++) { + for (var responseIndex = 0; responseIndex < responseSize; responseIndex++) { var responseItem:any; - responseItem = clientMessage.readMapEntry(); + var responseItemKey:Data; + var responseItemVal:any; + responseItemKey = clientMessage.readData(); + responseItemVal = clientMessage.readData(); + responseItem = [responseItemKey, responseItemVal]; response.push(responseItem) } - parameters['response'] = new ImmutableLazyDataList(response, toObjectFunction); + parameters['response'] = response; return parameters; } - } diff --git a/test/MapProxyTest.js b/test/MapProxyTest.js index 5aaab4b13..2fe7515c6 100644 --- a/test/MapProxyTest.js +++ b/test/MapProxyTest.js @@ -181,6 +181,21 @@ describe("MapProxy Test", function() { }) }); + it.skip('getAll', function() { + return map.getAll([ + 'key0', 'key1', 'key2', 'key3', 'key4', + 'key5', 'key6', 'key7', 'key8', 'key9' + ]).then(function (values) { + return expect(values).to.deep.have.members([ + ['key0', 'val0'], ['key1', 'val1'], + ['key2', 'val2'], ['key3', 'val3'], + ['key4', 'val4'], ['key5', 'val5'], + ['key6', 'val6'], ['key7', 'val7'], + ['key8', 'val8'], ['key9', 'val9'] + ]); + }) + }); + it('delete', function() { return map.put('key-to-delete', 'value').then(function() { return map.delete('key-to-delete'); @@ -264,7 +279,15 @@ describe("MapProxy Test", function() { }); }); - it('forceUnlock'); + it('forceUnlock', function() { + return map.lock('key0').then(function() { + return map.forceUnlock('key0'); + }).then(function() { + return map.isLocked('key0'); + }).then(function(isLocked) { + return expect(isLocked).to.be.false; + }); + }); it('keySet', function() { return map.keySet().then(function(keySet) {