[Mondrian] Calculation Captions in Virtual Cubes

Julian Hyde jhyde at pentaho.org
Tue Feb 5 14:22:39 EST 2008


Alan,
 
Sorry for the delay in replying. I am busy, as ever.
 
Your proposed getCaption() method makes sense. It almost seems to simple to
test, but then again, no code is too simple to break, so let's test it.
 
To test it, add a method to SchemaTest. The test will probably need to
create its own variant of the foodmart schema; follow the example of a test
in that class that tests a similar thing. Then execute a query on that
virtual cube that returns the measure on the columns axis, navigate to the
member using something like
result.getAxes().get(0).axis.getPositions().get(0).getMembers().get(0) and
call its getCaption method to make sure that the caption is as you want.
 
Julian
 
 


  _____  

From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Alan Jackson
Sent: Monday, February 04, 2008 1:28 PM
To: mondrian at pentaho.org
Subject: RE: [Mondrian] Calculation Captions in Virtual Cubes


In the absence of any responses to my request for help, I am still no
further forward.
I have seen that the final has been removed from MemberBase::getCaption by
wgorman's check-in on 16 Nov.
 
I would still like to add the following to RolapVirtualCubeMeasure.java but
am void of any ideas on how I can really test this in a unit test fashion.
 
public String getCaption() {
    return cubeMeasure.getCaption();
}
The reason I would like to do this is that without passing this request on
to the cubeMeasure, the default caption is returned for the member - not the
caption as specified in the original cube's schema XML.

 

Any thoughts on a means to test this would be appreciated - or if someone
wants to check it and submit it for me then I would be grateful.

If I'm missing the point of this list then please tell me to shut up!

Thanks

Alan

 


  _____  

From: mondrian-bounces at pentaho.org on behalf of Alan Jackson
Sent: Thu 31/01/2008 19:32
To: mondrian at pentaho.org
Subject: [Mondrian] Calculation Captions in Virtual Cubes


Hi
 
The problem is where a calculation in a cube has a caption define in the
schema XML. When using this calculation in a virtual cube, the specified
caption is not returned but the default caption is returned.
(see thread http://forums.pentaho.org/showthread.php?t=53867
<https://mail.symmetrics.net/exchweb/bin/redir.asp?URL=http://forums.pentaho
.org/showthread.php?t=53867> )
 
I've got a solution that works in our scenario, but I'm struggling to create
a unit test to highlight the problem - I want to create unit tests so that I
am able to submit the change back into the community. The example tests I've
seen all end up getting the measure through the schema objects rather than
getting the caption from the axis result sets.
 
Are there any examples you guys can point me to that get the captions back
for the axes that I could use to validate this fix?
 
 
The main contention in the fix would be the removal of the "final" from
MemberBase::getCaption so that it can be overridden in
RolapVirtualCubeMeasure - do you see this being a big problem?
 
TIA
Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20080205/11c52517/attachment.html 


More information about the Mondrian mailing list