From 60d8e3d420a05e887e75cbe93ffb8aa6d56ff9d3 Mon Sep 17 00:00:00 2001 From: Jon Davis Date: Wed, 19 Aug 2015 18:29:00 -0700 Subject: [PATCH] issue #229 - Ensure context is shared when differ only by case Additional debug statements have been removed from tests in this commit. --- rolluptool/src/classes/RollupService.cls | 2 +- rolluptool/src/classes/RollupServiceTest4.cls | 20 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/rolluptool/src/classes/RollupService.cls b/rolluptool/src/classes/RollupService.cls index 056a134d..437c8936 100644 --- a/rolluptool/src/classes/RollupService.cls +++ b/rolluptool/src/classes/RollupService.cls @@ -696,7 +696,7 @@ global with sharing class RollupService // Determine if an LREngine Context has been created for this parent child relationship, filter combination or underlying query type and sharing mode? String rsfType = rsf.isAggregateBasedRollup() ? 'aggregate' : 'query'; String orderBy = String.isBlank(Lookup.FieldToOrderBy__c) ? '' : Lookup.FieldToOrderBy__c; - String contextKey = lookup.ParentObject__c + '#' + lookup.RelationshipField__c + '#' + lookup.RelationShipCriteria__c + '#' + rsfType + '#' + sharingMode + '#' + orderBy; + String contextKey = (lookup.ParentObject__c + '#' + lookup.RelationshipField__c + '#' + lookup.RelationShipCriteria__c + '#' + rsfType + '#' + sharingMode + '#' + orderBy).toLowerCase(); LREngine.Context lreContext = engineCtxByParentRelationship.get(contextKey); if(lreContext==null) diff --git a/rolluptool/src/classes/RollupServiceTest4.cls b/rolluptool/src/classes/RollupServiceTest4.cls index e358bad6..9a9b6b4c 100644 --- a/rolluptool/src/classes/RollupServiceTest4.cls +++ b/rolluptool/src/classes/RollupServiceTest4.cls @@ -232,11 +232,6 @@ private class RollupServiceTest4 { insert children; // Assert limits - // TODO: Remove debug statements - in-place to get full picture when test fails - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% Queries - before:{0} after:{1}', new List { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List { String.valueOf(beforeDMLRows), String.valueOf(Limits.getDMLRows()) })); - // + One query on Rollup object // + One query on LookupChild__c for rollup System.assertEquals(beforeQueries + 2, Limits.getQueries()); @@ -355,11 +350,6 @@ private class RollupServiceTest4 { insert children; // Assert limits - // TODO: Remove debug statements - in-place to get full picture when test fails - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% Queries - before:{0} after:{1}', new List { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List { String.valueOf(beforeDMLRows), String.valueOf(Limits.getDMLRows()) })); - // + One query on Rollup object // + One query on LookupChild__c for rollup System.assertEquals(beforeQueries + 2, Limits.getQueries()); @@ -486,11 +476,6 @@ private class RollupServiceTest4 { insert children; // Assert limits - // TODO: Remove debug statements - in-place to get full picture when test fails - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% Queries - before:{0} after:{1}', new List { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List { String.valueOf(beforeDMLRows), String.valueOf(Limits.getDMLRows()) })); - // + One query on Rollup object // + One query on LookupChild__c for rollup System.assertEquals(beforeQueries + 2, Limits.getQueries()); @@ -619,11 +604,6 @@ private class RollupServiceTest4 { insert children; // Assert limits - // TODO: Remove debug statements - in-place to get full picture when test fails - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% Queries - before:{0} after:{1}', new List { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) })); - System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List { String.valueOf(beforeDMLRows), String.valueOf(Limits.getDMLRows()) })); - // + One query on Rollup object // + One query on LookupChild__c for rollup A // + One query on LookupChild__c for rollup B