Skip to content

Commit

Permalink
issue SFDO-Community#229 - Ensure context is shared when differ only …
Browse files Browse the repository at this point in the history
…by case

Additional debug statements have been removed from tests in this commit.
  • Loading branch information
jondavis9898 committed Aug 20, 2015
1 parent e42deb1 commit 60d8e3d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion rolluptool/src/classes/RollupService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 0 additions & 20 deletions rolluptool/src/classes/RollupServiceTest4.cls
Original file line number Diff line number Diff line change
Expand Up @@ -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> { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List<String> { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List<String> { 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());
Expand Down Expand Up @@ -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> { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List<String> { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List<String> { 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());
Expand Down Expand Up @@ -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> { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List<String> { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List<String> { 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());
Expand Down Expand Up @@ -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> { String.valueOf(beforeQueries), String.valueOf(Limits.getQueries()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% QueryRows - before:{0} after:{1}', new List<String> { String.valueOf(beforeRows), String.valueOf(Limits.getQueryRows()) }));
System.debug(LoggingLevel.ERROR, String.format('%%LIMITS%% DMLRows - before:{0} after:{1}', new List<String> { 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
Expand Down

0 comments on commit 60d8e3d

Please sign in to comment.