Program: 51642
Project: 51642
Buggy source:
/** 
 * Derived class can override this method to add more functions.
 */
protected void defineFunctions(){
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getDimension();
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension;
    }
    public void testDimensionHierarchy(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getDimension();
    }
    public void testLevelDimension(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getDimension();
    }
    public void testMemberDimension(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension[] dimensions=cube.getDimensions();
      int n=getIntArg(evaluator,args,0);
      if ((n > dimensions.length) || (n < 1)) {
        throw newEvalException(this,"String_Node_Str" + n + "String_Node_Str");
      }
      return dimensions[n - 1];
    }
    public void testDimensionsNumeric(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      String defValue="String_Node_Str";
      String s=getStringArg(evaluator,args,0,defValue);
      if (s.indexOf("String_Node_Str") == -1) {
        s=Util.quoteMdxIdentifier(s);
      }
      Cube cube=evaluator.getCube();
      boolean fail=false;
      OlapElement o=Util.lookupCompound(cube,s,cube,fail);
      if (o == null) {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str");
      }
 else       if (o instanceof Dimension) {
        return (Dimension)o;
      }
 else {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str"+ o);
      }
    }
    public void testDimensionsString(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getHierarchy();
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getHierarchy();
    }
    public void testTime(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testBasic9(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testFirstInLevel9(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testHierarchyAll(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testHierarchyNull(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLevel();
    }
    public void testMemberLevel(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      Level[] levels=hierarchy.getLevels();
      int n=getIntArg(evaluator,args,1);
      if ((n > levels.length) || (n < 1)) {
        throw newEvalException(this,"String_Node_Str" + n + "String_Node_Str");
      }
      return levels[n - 1];
    }
    public void testLevelsNumeric(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testLevelsTooSmall(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
    public void testLevelsTooLarge(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      String s=getStringArg(evaluator,args,0,null);
      Cube cube=evaluator.getCube();
      boolean fail=false;
      OlapElement o=null;
      if (s.startsWith("String_Node_Str")) {
        o=Util.lookupCompound(cube,s,cube,fail);
      }
 else {
        o=null;
      }
      if (o == null) {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str");
      }
 else       if (o instanceof Level) {
        return (Level)o;
      }
 else {
        throw newEvalException(this,"String_Node_Str" + o.getDescription() + "String_Node_Str");
      }
    }
    public void testLevelsString(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testLevelsStringFail(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,false);
      Level level=getLevelArg(evaluator,args,1,false);
      if (member.getHierarchy() != level.getHierarchy()) {
        throw newEvalException(this,"String_Node_Str" + member + "String_Node_Str"+ level+ "String_Node_Str");
      }
      if (member.getLevel().equals(level)) {
        return member;
      }
      Member[] members=member.getAncestorMembers();
      for (int i=0; i < members.length; i++) {
        if (members[i].getLevel().equals(level))         return members[i];
      }
      return member.getHierarchy().getNullMember();
    }
    public void testAncestor(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testAncestorHigher(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testAncestorSameLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testAncestorWrongHierarchy(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
    public void testAncestorAllLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension timeDimension=cube.getYearLevel().getDimension();
      Member member=evaluator.getContext(timeDimension);
      Level level=member.getLevel().getChildLevel();
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodNoArgs(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension timeDimension=cube.getYearLevel().getDimension();
      Member member=evaluator.getContext(timeDimension);
      Level level=getLevelArg(evaluator,args,0,true);
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testClosingPeriodLevelNotInTimeFails(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Level level=member.getLevel().getChildLevel();
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodMember(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      Member member=getMemberArg(evaluator,args,1,true);
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriod(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testClosingPeriodBelow(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member1=getMemberArg(evaluator,args,0,true);
      Member member2=getMemberArg(evaluator,args,1,true);
      Member cousin=cousin(member1,member2);
      if (cousin == null) {
        cousin=member1.getHierarchy().getNullMember();
      }
      return cousin;
    }
    private Member cousin(    Member member1,    Member member2){
      if (member1.getHierarchy() != member2.getHierarchy()) {
        throw newEvalException(this,"String_Node_Str" + member1 + "String_Node_Str"+ member2+ "String_Node_Str");
      }
      if (member1.getLevel().getDepth() < member2.getLevel().getDepth()) {
        return null;
      }
      return cousin2(member1,member2);
    }
    private Member cousin2(    Member member1,    Member member2){
      if (member1.getLevel() == member2.getLevel()) {
        return member2;
      }
      Member uncle=cousin2(member1.getParentMember(),member2);
      if (uncle == null) {
        return null;
      }
      int ordinal=getOrdinalInParent(member1);
      Member[] cousins=uncle.getMemberChildren();
      if (cousins.length < ordinal) {
        return null;
      }
      return cousins[ordinal];
    }
    private int getOrdinalInParent(    Member member){
      Member parent=member.getParentMember();
      Member[] siblings;
      if (parent == null) {
        siblings=member.getHierarchy().getRootMembers();
      }
 else {
        siblings=parent.getMemberChildren();
      }
      for (int i=0; i < siblings.length; i++) {
        if (siblings[i] == member) {
          return i;
        }
      }
      throw Util.newInternal("String_Node_Str" + member + "String_Node_Str");
    }
    public void testCousin1(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousin2(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousinOverrun(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testCousinThreeDown(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousinSameLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testCousinHigherLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testCousinWrongHierarchy(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return evaluator.getContext(dimension);
    }
    public void testCurrentMemberFromSlicer(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
    public void testCurrentMemberFromDefaultMember(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
    public void testCurrentMemberFromAxis(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0,0}).getValue());
    }
    /** 
 * When evaluating a calculated member, MSOLAP regards that calculated member as the current member of that dimension, so it cycles in this case. But I disagree; it is the previous current member, before the calculated member was expanded.
 */
    public void testCurrentMemberInCalcMember(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getHierarchy().getDefaultMember();
    }
    public void testDimensionDefaultMember(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      if (children.length == 0) {
        return member.getHierarchy().getNullMember();
      }
 else {
        return children[0];
      }
    }
    public void testFirstChildFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstChildAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstChildOfChildless(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      Member[] children;
      if (parent == null) {
        if (member.isNull()) {
          return member;
        }
        children=member.getHierarchy().getRootMembers();
      }
 else {
        children=parent.getMemberChildren();
      }
      return children[0];
    }
    public void testFirstSiblingFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
    public void testFirstSiblingRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingNull(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      int n=getIntArg(evaluator,args,1);
      return member.getLeadMember(-n);
    }
    public void testLag(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLagFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testLagAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testLagRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLagRootTooFar(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      if (children.length == 0) {
        return member.getHierarchy().getNullMember();
      }
 else {
        return children[children.length - 1];
      }
    }
    public void testLastChild(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildOfChildless(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      Member[] children;
      if (parent == null) {
        if (member.isNull()) {
          return member;
        }
        children=member.getHierarchy().getRootMembers();
      }
 else {
        children=parent.getMemberChildren();
      }
      return children[children.length - 1];
    }
    public void testLastSibling(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
    public void testLastSiblingRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingNull(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      int n=getIntArg(evaluator,args,1);
      return member.getLeadMember(n);
    }
    public void testLead(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLeadNegative(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLeadLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLeadMember(+1);
    }
    public void testBasic2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
    public void testAll2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      if (parent == null) {
        parent=member.getHierarchy().getNullMember();
      }
      return parent;
    }
    public void testBasic5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testAll5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLeadMember(-1);
    }
    public void testBasic(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
    public void testAll(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return avg(evaluator.push(),members,exp);
    }
    public void testAvg(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return correlation(evaluator.push(),members,exp1,exp2);
    }
    public void testCorrelation(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      String empties=(String)getArg(evaluator,args,1,"String_Node_Str");
      if (empties.equals("String_Node_Str")) {
        return new Double(members.size());
      }
 else {
        int retval=0;
        for (int i=0; i < members.size(); i++) {
          if ((members.elementAt(i) != Util.nullValue) && (members.elementAt(i) != null)) {
            retval++;
          }
        }
        return new Double(retval);
      }
    }
    public void testCount(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return covariance(evaluator.push(),members,exp1,exp2,true);
    }
    public void testCovariance(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return covariance(evaluator.push(),members,exp1,exp2,false);
    }
    public void testCovarianceN(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return max(evaluator.push(),members,exp);
    }
    public void testMax(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return median(evaluator.push(),members,exp);
    }
    public void testMedian(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return min(evaluator.push(),members,exp);
    }
    public void testMin(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,false);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,false);
    }
    public void testStdev(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,true);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,true);
    }
    public void testStdevP(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return sum(evaluator.push(),members,exp);
    }
    public void testSumNoExp(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.evaluateScalar(evaluator);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member[] members=getTupleArg(evaluator,args,0);
      Evaluator evaluator2=evaluator.push(members);
      return evaluator2.evaluateCurrent();
    }
  }
);
  if (false)   define(new ResolverBase("String_Node_Str",null,null,FunDef.TypeParentheses){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length == 1 && args[0].getType() == FunCall.CatTuple) {
        return new ValueFunDef(new int[]{FunCall.CatTuple});
      }
      for (int i=0; i < args.length; i++) {
        Exp arg=args[i];
        if (!canConvert(arg,FunCall.CatMember,conversionCount)) {
          return null;
        }
      }
      int[] argTypes=new int[args.length];
      for (int i=0; i < argTypes.length; i++) {
        argTypes[i]=FunCall.CatMember;
      }
      return new ValueFunDef(argTypes);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,false);
    }
    public void testVar(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,false);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,true);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,true);
    }
    public void testVarP(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set=(Vector)getArg(evaluator,args,0);
      int n=getIntArg(evaluator,args,1);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2,null);
      if (exp != null) {
        boolean desc=false, brk=true;
        sort(evaluator,set,exp,desc,brk);
      }
      if (n < set.size()) {
        set.setSize(n);
      }
      return set;
    }
    public void testBottomCount(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,false,true,n.doubleValue());
    }
    public void testBottomPercent(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,false,false,n.doubleValue());
    }
    public void testBottomSum(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      return toVector(children);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Hierarchy getHierarchy(    Exp[] args){
      return null;
    }
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set0=(Vector)getArg(evaluator,args,0), set1=(Vector)getArg(evaluator,args,1);
      if (set0.isEmpty() || set1.isEmpty()) {
        return emptyVector;
      }
      int arity0=1, arity1=1;
      if (set0.elementAt(0) instanceof Member[]) {
        arity0=((Member[])set0.elementAt(0)).length;
      }
      if (set1.elementAt(0) instanceof Member[]) {
        arity1=((Member[])set1.elementAt(0)).length;
      }
      Vector result=new Vector();
      if (arity0 == 1 && arity1 == 1) {
        for (int i=0, m=set0.size(); i < m; i++) {
          Member o0=(Member)set0.elementAt(i);
          for (int j=0, n=set1.size(); j < n; j++) {
            Member o1=(Member)set1.elementAt(j);
            result.addElement(new Member[]{o0,o1});
          }
        }
      }
 else {
        Member[] row=new Member[arity0 + arity1];
        for (int i=0, m=set0.size(); i < m; i++) {
          int x=0;
          Object o0=set0.elementAt(i);
          if (o0 instanceof Member) {
            row[x++]=(Member)o0;
          }
 else {
            assertTrue(o0 instanceof Member[]);
            final Member[] members=(Member[])o0;
            for (int k=0; k < members.length; k++) {
              row[x++]=members[k];
            }
          }
          for (int j=0, n=set1.size(); j < n; j++) {
            Object o1=set1.elementAt(j);
            if (o1 instanceof Member) {
              row[x++]=(Member)o1;
            }
 else {
              assertTrue(o1 instanceof Member[]);
              final Member[] members=(Member[])o1;
              for (int k=0; k < members.length; k++) {
                row[x++]=members[k];
              }
            }
            result.addElement(row.clone());
            x=arity0;
          }
        }
      }
      return result;
    }
    public void testCrossjoinNested(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str",test.toString(axis.positions));
    }
  }
);
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String descFlag=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},dummyFunDef);
      if (!descFlag.equals("String_Node_Str")) {
        throw newEvalException(null,"String_Node_Str");
      }
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Member member=getMemberArg(evaluator,args,0,true);
          Level level=getLevelArg(evaluator,args,1,true);
          if (member.getLevel().getDepth() > level.getDepth()) {
            return new Member[0];
          }
          final Hierarchy hierarchy=member.getHierarchy();
          Member[] children={member};
          while (children.length > 0 && children[0].getLevel().getDepth() < level.getDepth()) {
            children=hierarchy.getChildMembers(children);
          }
          return toVector(children);
        }
      }
;
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set0=(Vector)getArg(evaluator,args,0);
      int[] depthArray=new int[set0.size()];
      Vector drilledSet=new Vector();
      for (int i=0, m=set0.size(); i < m; i++) {
        Member member=(Member)set0.elementAt(i);
        depthArray[i]=member.getDepth();
      }
      Arrays.sort(depthArray);
      int maxDepth=depthArray[depthArray.length - 1];
      for (int i=0, m=set0.size(); i < m; i++) {
        Member member=(Member)set0.elementAt(i);
        drilledSet.addElement(member);
        if (member.getDepth() == maxDepth) {
          Member[] childMembers=member.getMemberChildren();
          for (int j=0; j < childMembers.length; j++) {
            drilledSet.addElement(childMembers[j]);
          }
        }
      }
      return drilledSet;
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      HashSet set2=toHashSet((Vector)getArg(evaluator,args,1));
      Vector set1=(Vector)getArg(evaluator,args,0);
      Vector result=new Vector();
      for (int i=0, count=set1.size(); i < count; i++) {
        Object o=set1.elementAt(i);
        if (!set2.contains(o)) {
          result.addElement(o);
        }
      }
      return result;
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      Exp exp=args[1];
      Vector result=new Vector();
      Evaluator evaluator2=evaluator.push();
      for (int i=0, count=members.size(); i < count; i++) {
        Object o=members.elementAt(i);
        if (o instanceof Member) {
          evaluator2.setContext((Member)o);
        }
 else         if (o instanceof Member[]) {
          evaluator2.setContext((Member[])o);
        }
 else {
          throw Util.newInternal("String_Node_Str" + o.getClass());
        }
        Boolean b=(Boolean)exp.evaluateScalar(evaluator2);
        if (b.booleanValue()) {
          result.add(o);
        }
      }
      return result;
    }
    /** 
 * Make sure that slicer is in force when expression is applied on axis, E.g. select filter([Customers].members, [Unit Sales] > 100) from sales where ([Time].[1998])
 */
    public void testFilterWithSlicer(    FoodMartTestCase test){
      Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      Axis rows=result.getAxes()[1];
      test.assertEquals(1,rows.positions.length);
      Cell cell=result.getCell(new int[]{0,0});
      test.assertEquals("String_Node_Str",cell.getFormattedValue());
    }
    public void testFilterCompound(    FoodMartTestCase test){
      Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      Position[] rows=result.getAxes()[1].positions;
      test.assertTrue(rows.length == 3);
      test.assertEquals("String_Node_Str",rows[0].members[0].getName());
      test.assertEquals("String_Node_Str",rows[0].members[1].getName());
      test.assertEquals("String_Node_Str",rows[1].members[0].getName());
      test.assertEquals("String_Node_Str",rows[1].members[1].getName());
      test.assertEquals("String_Node_Str",rows[2].members[0].getName());
      test.assertEquals("String_Node_Str",rows[2].members[1].getName());
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String order=getLiteralArg(args,1,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean post=order.equals("String_Node_Str");
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector members=(Vector)getArg(evaluator,args,0);
          hierarchize(members,post);
          return members;
        }
      }
;
    }
    public void testHierarchize(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testHierarchizePost(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testHierarchizeCrossJoinPre(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testHierarchizeCrossJoinPost(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=(Dimension)getArg(evaluator,args,0);
      Hierarchy hierarchy=dimension.getHierarchy();
      return addMembers(new Vector(),hierarchy);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=(Hierarchy)getArg(evaluator,args,0);
      return addMembers(new Vector(),hierarchy);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=(Level)getArg(evaluator,args,0);
      return toVector(level.getMembers());
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getMonthLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String order=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean desc=order.equals("String_Node_Str") || order.equals("String_Node_Str");
      final boolean brk=order.equals("String_Node_Str") || order.equals("String_Node_Str");
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector members=(Vector)getArg(evaluator,args,0);
          ExpBase exp=(ExpBase)getArgNoEval(args,1);
          sort(evaluator,members,exp,desc,brk);
          return members;
        }
      }
;
    }
    public void testOrder(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderParentsMissing(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + "String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderCrossJoinBreak(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderCrossJoin(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderHierarchicalDesc(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testOrderCrossJoinDesc(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testOrderBug656802(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,false);
      Member member=getMemberArg(evaluator,args,1,false);
      return new Vector(periodsToDate(evaluator,level,member));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getQuarterLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public void unparse(    Exp[] args,    PrintWriter pw,    ElementCallback callback){
      if (callback.isPlatoMdx()) {
        super.unparse(new Exp[]{args[0]},pw,callback);
      }
 else {
        super.unparse(args,pw,callback);
      }
    }
    public Hierarchy getHierarchy(    Exp[] args){
      return (args.length == 2) ? (Hierarchy)args[1] : null;
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector v0=(Vector)getArg(evaluator,args,0), v1=(Vector)getArg(evaluator,args,1);
      if (args.length > 2) {
        throw Util.newInternal("String_Node_Str");
      }
      if (v1.isEmpty()) {
        return v0;
      }
      if (v0.isEmpty()) {
        return v0;
      }
      HashSet set1=toHashSet(v1);
      Vector result=new Vector();
      int i=0, n=v0.size();
      while (i < n) {
        Object o=v0.elementAt(i++);
        result.addElement(o);
        Member m=null;
        int k=-1;
        if (o instanceof Member) {
          if (!set1.contains(o)) {
            continue;
          }
          m=(Member)o;
          k=-1;
        }
 else {
          Util.assertTrue(o instanceof Member[]);
          Member[] members=(Member[])o;
          for (int j=0; j < members.length; j++) {
            Member member=members[j];
            if (set1.contains(member)) {
              k=j;
              m=member;
              break;
            }
          }
          if (k == -1) {
            continue;
          }
        }
        boolean isDrilledDown=false;
        if (i < n) {
          Object next=v0.elementAt(i);
          Member nextMember=(k < 0) ? (Member)next : ((Member[])next)[k];
          boolean strict=true;
          if (isAncestorOf(m,nextMember,strict)) {
            isDrilledDown=true;
          }
        }
        if (isDrilledDown) {
          do {
            Object next=v0.elementAt(i);
            Member nextMember=(k < 0) ? (Member)next : ((Member[])next)[k];
            boolean strict=true;
            if (isAncestorOf(m,nextMember,strict)) {
              i++;
            }
 else {
              break;
            }
          }
 while (i < n);
        }
 else {
          Member[] children=m.getMemberChildren();
          for (int j=0; j < children.length; j++) {
            if (k < 0) {
              result.addElement(children[j]);
            }
 else {
              Member[] members=(Member[])((Member[])o).clone();
              members[k]=children[j];
              result.addElement(members);
            }
          }
        }
      }
      return result;
    }
    public void testToggleDrillState(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testToggleDrillState2(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testToggleDrillState3(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testToggleDrillStateTuple(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set=(Vector)getArg(evaluator,args,0);
      int n=getIntArg(evaluator,args,1);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2,null);
      if (exp != null) {
        boolean desc=true, brk=true;
        sort(evaluator,set,exp,desc,brk);
      }
      if (n < set.size()) {
        set.setSize(n);
      }
      return set;
    }
    public void testTopCount(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,true,true,n.doubleValue());
    }
    public void testTopPercent(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,true,false,n.doubleValue());
    }
    public void testTopSum(    FoodMartTestCase test){
      Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
  }
));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String allString=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean all=allString.equalsIgnoreCase("String_Node_Str");
      checkCompatible(args[0],args[1],dummyFunDef);
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector left=(Vector)getArg(evaluator,args,0), right=(Vector)getArg(evaluator,args,1);
          if (all) {
            if (left == null || left.isEmpty()) {
              return right;
            }
            add(left,right);
            return left;
          }
 else {
            HashSet added=new HashSet();
            Vector result=new Vector();
            addUnique(result,left,added);
            addUnique(result,right,added);
            return result;
          }
        }
      }
;
    }
    public void testUnionAll(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testUnion(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testUnionEmptyBoth(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testUnionEmptyRight(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testUnionTuple(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testUnionQuery(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final Axis rowsAxis=result.getAxes()[1];
      test.assertEquals(45,rowsAxis.positions.length);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getWeekLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getYearLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      final Member member0=getMemberArg(evaluator,args,0,true);
      final Member member1=getMemberArg(evaluator,args,1,true);
      if (member0.isNull() || member1.isNull()) {
        return emptyVector;
      }
      if (member0.getLevel() != member1.getLevel()) {
        throw newEvalException(this,"String_Node_Str");
      }
      return new Vector(FunUtil.memberRange(member0,member1));
    }
    public void testRange(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void _testRangeLarge(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testRangeStartEqualsEnd(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testRangeEndBeforeStart(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testRangeBetweenDifferentLevelsIsError(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
    public void testRangeBoundedByAll(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      String expected="String_Node_Str";
      test.assertEquals(expected,test.toString(axis.positions));
    }
    public void testRangeBoundedByNull(    FoodMartTestCase test){
      final Axis axis=test.executeAxis2("String_Node_Str");
      test.assertTrue(axis.positions.length == 0);
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeBraces){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      int[] parameterTypes=new int[args.length];
      for (int i=0; i < args.length; i++) {
        if (canConvert(args[i],Exp.CatMember,conversionCount)) {
          parameterTypes[i]=Exp.CatMember;
          continue;
        }
        if (canConvert(args[i],Exp.CatSet,conversionCount)) {
          parameterTypes[i]=Exp.CatSet;
          continue;
        }
        if (canConvert(args[i],Exp.CatTuple,conversionCount)) {
          parameterTypes[i]=Exp.CatTuple;
          continue;
        }
        return null;
      }
      return new SetFunDef(this,syntacticType,parameterTypes);
    }
    public void testSetContainingLevelFails(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      boolean logical=getBooleanArg(evaluator,args,0);
      return getStringArg(evaluator,args,logical ? 1 : 2,null);
    }
    public void testIIf(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getName();
    }
    public void testDimensionName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getName();
    }
    public void testHierarchyName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getName();
    }
    public void testLevelName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getName();
    }
    public void testMemberName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getUniqueName();
    }
    public void testDimensionUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getUniqueName();
    }
    public void testHierarchyUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getUniqueName();
    }
    public void testLevelUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getUniqueName();
    }
    public void testMemberUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testMemberUniqueNameOfNull(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public void unparse(    Exp[] args,    PrintWriter pw,    ElementCallback callback){
      if (callback.isPlatoMdx()) {
        super.unparse(new Exp[]{args[0]},pw,callback);
      }
 else {
        super.unparse(args,pw,callback);
      }
    }
    public Hierarchy getHierarchy(    Exp[] args){
      return (args.length == 2) ? (Hierarchy)args[1] : null;
    }
  }
);
  define(new ResolverBase("String_Node_Str",null,null,FunDef.TypeParentheses){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length == 1) {
        return new ParenthesesFunDef(args[0].getType());
      }
 else {
        return new TupleFunDef(ExpBase.getTypes(args));
      }
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeFunction){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 1) {
        return null;
      }
      final int[] types={Exp.CatNumeric,Exp.CatString};
      for (int j=0; j < types.length; j++) {
        int type=types[j];
        int matchingArgs=0;
        conversionCount[0]=0;
        for (int i=0; i < args.length; i++) {
          if (canConvert(args[i],type,conversionCount)) {
            matchingArgs++;
          }
        }
        if (matchingArgs == args.length) {
          return new FunDefBase(this,FunDef.TypeFunction,type,ExpBase.getTypes(args));
        }
      }
      return null;
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeCase){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 1) {
        return null;
      }
      int j=0, clauseCount=args.length / 2, mismatchingArgs=0;
      int returnType=args[1].getType();
      for (int i=0; i < clauseCount; i++) {
        if (!canConvert(args[j++],Exp.CatLogical,conversionCount)) {
          mismatchingArgs++;
        }
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      if (j < args.length) {
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      Util.assertTrue(j == args.length);
      if (mismatchingArgs == 0) {
        return new FunDefBase(this,FunDef.TypeFunction,returnType,ExpBase.getTypes(args)){
          public Object evaluate(          Evaluator evaluator,          Exp[] args){
            return evaluateCaseTest(evaluator,args);
          }
        }
;
      }
 else {
        return null;
      }
    }
    Object evaluateCaseTest(    Evaluator evaluator,    Exp[] args){
      int clauseCount=args.length / 2, j=0;
      for (int i=0; i < clauseCount; i++) {
        boolean logical=getBooleanArg(evaluator,args,j++);
        if (logical) {
          return getArg(evaluator,args,j);
        }
 else {
          j++;
        }
      }
      if (j < args.length) {
        return getArg(evaluator,args,j);
      }
 else {
        return null;
      }
    }
    public void testCaseTestMatch(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseTestMatchElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseTestMatchNoElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeCase){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 3) {
        return null;
      }
      int valueType=args[0].getType();
      int returnType=args[2].getType();
      int j=0, clauseCount=(args.length - 1) / 2, mismatchingArgs=0;
      if (!canConvert(args[j++],valueType,conversionCount)) {
        mismatchingArgs++;
      }
      for (int i=0; i < clauseCount; i++) {
        if (!canConvert(args[j++],valueType,conversionCount)) {
          mismatchingArgs++;
        }
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      if (j < args.length) {
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      Util.assertTrue(j == args.length);
      if (mismatchingArgs == 0) {
        return new FunDefBase(this,FunDef.TypeFunction,returnType,ExpBase.getTypes(args)){
          public Object evaluate(          Evaluator evaluator,          Exp[] args){
            return evaluateCaseMatch(evaluator,args);
          }
        }
;
      }
 else {
        return null;
      }
    }
    Object evaluateCaseMatch(    Evaluator evaluator,    Exp[] args){
      int clauseCount=(args.length - 1) / 2, j=0;
      Object value=getArg(evaluator,args,j++);
      for (int i=0; i < clauseCount; i++) {
        Object match=getArg(evaluator,args,j++);
        if (match.equals(value)) {
          return getArg(evaluator,args,j);
        }
 else {
          j++;
        }
      }
      if (j < args.length) {
        return getArg(evaluator,args,j);
      }
 else {
        return null;
      }
    }
    public void testCaseMatch(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseMatchElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseMatchNoElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeMethod){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      final int[] argTypes=new int[]{Exp.CatMember,Exp.CatString};
      if (args.length != 2 || args[0].getType() != Exp.CatMember || args[1].getType() != Exp.CatString) {
        return null;
      }
      int returnType;
      if (args[1] instanceof Literal) {
        String propertyName=(String)((Literal)args[1]).getValue();
        Hierarchy hierarchy=args[0].getHierarchy();
        Level[] levels=hierarchy.getLevels();
        Property property=lookupProperty(levels[levels.length - 1],propertyName);
        if (property == null) {
          returnType=Exp.CatValue;
        }
 else {
switch (property.getType()) {
case Property.TYPE_BOOLEAN:
            returnType=Exp.CatLogical;
          break;
case Property.TYPE_NUMERIC:
        returnType=Exp.CatNumeric;
      break;
case Property.TYPE_STRING:
    returnType=Exp.CatString;
  break;
default :
throw Util.newInternal("String_Node_Str" + property.getType());
}
}
}
 else {
returnType=Exp.CatValue;
}
return new PropertiesFunDef(name,signature,description,syntacticType,returnType,argTypes);
}
public void testPropertiesExpr(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
/** 
 * Tests that non-existent property throws an error. 
 */
public void testPropertiesNonExistent(FoodMartTestCase test){
test.assertExprThrows("String_Node_Str","String_Node_Str");
}
public void testPropertiesFilter(FoodMartTestCase test){
Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
test.assertEquals(8,result.getAxes()[1].positions.length);
}
public void testPropertyInCalculatedMember(FoodMartTestCase test){
Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
Member member;
Cell cell;
member=result.getAxes()[1].positions[17].members[0];
test.assertEquals("String_Node_Str",member.getUniqueName());
cell=result.getCell(new int[]{0,17});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
cell=result.getCell(new int[]{1,17});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
member=result.getAxes()[1].positions[3].members[0];
test.assertEquals("String_Node_Str",member.getUniqueName());
cell=result.getCell(new int[]{0,3});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
cell=result.getCell(new int[]{1,3});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
}
}
);
define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}){
protected FunDef createFunDef(Exp[] args,FunDef dummyFunDef){
String parameterName;
if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) {
parameterName=(String)((Literal)args[0]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str");
}
Exp typeArg=args[1];
Hierarchy hierarchy;
int type;
switch (typeArg.getType()) {
case Exp.CatHierarchy:
case Exp.CatDimension:
hierarchy=typeArg.getHierarchy();
if (hierarchy == null || !isConstantHierarchy(typeArg)) {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
type=Exp.CatMember;
break;
case Exp.CatSymbol:
hierarchy=null;
String s=(String)((Literal)typeArg).getValue();
if (s.equalsIgnoreCase("String_Node_Str")) {
type=Exp.CatNumeric;
break;
}
 else if (s.equalsIgnoreCase("String_Node_Str")) {
type=Exp.CatString;
break;
}
default :
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
Exp exp=args[2];
if (exp.getType() != type) {
String typeName=Exp.catEnum.getName(type).toUpperCase();
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str"+ typeName);
}
if (type == Exp.CatMember) {
Hierarchy expHierarchy=exp.getHierarchy();
if (expHierarchy != hierarchy) {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str"+ hierarchy);
}
}
String parameterDescription=null;
if (args.length > 3) {
if (args[3] instanceof Literal && args[3].getType() == Exp.CatString) {
parameterDescription=(String)((Literal)args[3]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
}
return new ParameterFunDef(dummyFunDef,parameterName,hierarchy,type,exp,parameterDescription);
}
}
);
define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"}){
protected FunDef createFunDef(Exp[] args,FunDef dummyFunDef){
String parameterName;
if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) {
parameterName=(String)((Literal)args[0]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str");
}
return new ParameterFunDef(dummyFunDef,parameterName,null,Exp.CatUnknown,null,null);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() + o1.doubleValue());
}
public void testPlus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() - o1.doubleValue());
}
public void testMinus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testMinusAssociativity(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() * o1.doubleValue());
}
public void testMultiply(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testMultiplyPrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
Double result=new Double(o0.doubleValue() / o1.doubleValue());
return result;
}
public double evaluate(double d1,double d2){
return d1 / d2;
}
public void testDivide(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testDivideByZero(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testDividePrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0);
return new Double(-o0.doubleValue());
}
public void testUnaryMinus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testUnaryMinusMember(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testUnaryMinusPrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return o0 + o1;
}
public void testStringConcat(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringConcat2(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(getBooleanArg(evaluator,args,0) && getBooleanArg(evaluator,args,1));
}
public void testAnd(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testAnd2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(getBooleanArg(evaluator,args,0) || getBooleanArg(evaluator,args,1));
}
public void testOr(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOr2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity1(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity3(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
final boolean b0=getBooleanArg(evaluator,args,0);
final boolean b1=getBooleanArg(evaluator,args,1);
return toBoolean(b0 != b1);
}
public void testXor(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testXorAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(!getBooleanArg(evaluator,args,0));
}
public void testNot(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNotNot(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNotAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return toBoolean(o0.equals(o1));
}
public void testStringEquals(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringEqualsAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringEqualsEmpty(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.equals(o1));
}
public void testEq(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return toBoolean(!o0.equals(o1));
}
public void testStringNe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(!o0.equals(o1));
}
public void testNe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNeInfinity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) < 0);
}
public void testLt(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) <= 0);
}
public void testLe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) > 0);
}
public void testGt(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) >= 0);
}
public void testGe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
}

Fixed version (ground truth):
/** 
 * Derived class can override this method to add more functions.
 */
protected void defineFunctions(){
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getDimension();
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension;
    }
    public void testDimensionHierarchy(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getDimension();
    }
    public void testLevelDimension(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getDimension();
    }
    public void testMemberDimension(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension[] dimensions=cube.getDimensions();
      int n=getIntArg(evaluator,args,0);
      if ((n > dimensions.length) || (n < 1)) {
        throw newEvalException(this,"String_Node_Str" + n + "String_Node_Str");
      }
      return dimensions[n - 1];
    }
    public void testDimensionsNumeric(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      String defValue="String_Node_Str";
      String s=getStringArg(evaluator,args,0,defValue);
      if (s.indexOf("String_Node_Str") == -1) {
        s=Util.quoteMdxIdentifier(s);
      }
      Cube cube=evaluator.getCube();
      boolean fail=false;
      OlapElement o=Util.lookupCompound(cube,s,cube,fail);
      if (o == null) {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str");
      }
 else       if (o instanceof Dimension) {
        return (Dimension)o;
      }
 else {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str"+ o);
      }
    }
    public void testDimensionsString(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getHierarchy();
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getHierarchy();
    }
    public void testTime(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testBasic9(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testFirstInLevel9(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testHierarchyAll(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testHierarchyNull(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLevel();
    }
    public void testMemberLevel(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      Level[] levels=hierarchy.getLevels();
      int n=getIntArg(evaluator,args,1);
      if ((n > levels.length) || (n < 1)) {
        throw newEvalException(this,"String_Node_Str" + n + "String_Node_Str");
      }
      return levels[n - 1];
    }
    public void testLevelsNumeric(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testLevelsTooSmall(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
    public void testLevelsTooLarge(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      String s=getStringArg(evaluator,args,0,null);
      Cube cube=evaluator.getCube();
      boolean fail=false;
      OlapElement o=null;
      if (s.startsWith("String_Node_Str")) {
        o=Util.lookupCompound(cube,s,cube,fail);
      }
 else {
        o=null;
      }
      if (o == null) {
        throw newEvalException(this,"String_Node_Str" + s + "String_Node_Str");
      }
 else       if (o instanceof Level) {
        return (Level)o;
      }
 else {
        throw newEvalException(this,"String_Node_Str" + o.getDescription() + "String_Node_Str");
      }
    }
    public void testLevelsString(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testLevelsStringFail(    FoodMartTestCase test){
      test.assertExprThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,false);
      Level level=getLevelArg(evaluator,args,1,false);
      if (member.getHierarchy() != level.getHierarchy()) {
        throw newEvalException(this,"String_Node_Str" + member + "String_Node_Str"+ level+ "String_Node_Str");
      }
      if (member.getLevel().equals(level)) {
        return member;
      }
      Member[] members=member.getAncestorMembers();
      for (int i=0; i < members.length; i++) {
        if (members[i].getLevel().equals(level))         return members[i];
      }
      return member.getHierarchy().getNullMember();
    }
    public void testAncestor(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testAncestorHigher(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testAncestorSameLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testAncestorWrongHierarchy(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
    public void testAncestorAllLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension timeDimension=cube.getYearLevel().getDimension();
      Member member=evaluator.getContext(timeDimension);
      Level level=member.getLevel().getChildLevel();
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodNoArgs(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Cube cube=evaluator.getCube();
      Dimension timeDimension=cube.getYearLevel().getDimension();
      Member member=evaluator.getContext(timeDimension);
      Level level=getLevelArg(evaluator,args,0,true);
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testClosingPeriodLevelNotInTimeFails(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Level level=member.getLevel().getChildLevel();
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriodMember(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      Member member=getMemberArg(evaluator,args,1,true);
      return openClosingPeriod(this,member,level);
    }
    public void testClosingPeriod(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testClosingPeriodBelow(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member1=getMemberArg(evaluator,args,0,true);
      Member member2=getMemberArg(evaluator,args,1,true);
      Member cousin=cousin(member1,member2);
      if (cousin == null) {
        cousin=member1.getHierarchy().getNullMember();
      }
      return cousin;
    }
    private Member cousin(    Member member1,    Member member2){
      if (member1.getHierarchy() != member2.getHierarchy()) {
        throw newEvalException(this,"String_Node_Str" + member1 + "String_Node_Str"+ member2+ "String_Node_Str");
      }
      if (member1.getLevel().getDepth() < member2.getLevel().getDepth()) {
        return null;
      }
      return cousin2(member1,member2);
    }
    private Member cousin2(    Member member1,    Member member2){
      if (member1.getLevel() == member2.getLevel()) {
        return member2;
      }
      Member uncle=cousin2(member1.getParentMember(),member2);
      if (uncle == null) {
        return null;
      }
      int ordinal=getOrdinalInParent(member1);
      Member[] cousins=uncle.getMemberChildren();
      if (cousins.length < ordinal) {
        return null;
      }
      return cousins[ordinal];
    }
    private int getOrdinalInParent(    Member member){
      Member parent=member.getParentMember();
      Member[] siblings;
      if (parent == null) {
        siblings=member.getHierarchy().getRootMembers();
      }
 else {
        siblings=parent.getMemberChildren();
      }
      for (int i=0; i < siblings.length; i++) {
        if (siblings[i] == member) {
          return i;
        }
      }
      throw Util.newInternal("String_Node_Str" + member + "String_Node_Str");
    }
    public void testCousin1(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousin2(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousinOverrun(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testCousinThreeDown(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getUniqueName());
    }
    public void testCousinSameLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testCousinHigherLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testCousinWrongHierarchy(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return evaluator.getContext(dimension);
    }
    public void testCurrentMemberFromSlicer(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
    public void testCurrentMemberFromDefaultMember(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
    public void testCurrentMemberFromAxis(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0,0}).getValue());
    }
    /** 
 * When evaluating a calculated member, MSOLAP regards that calculated member as the current member of that dimension, so it cycles in this case. But I disagree; it is the previous current member, before the calculated member was expanded.
 */
    public void testCurrentMemberInCalcMember(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
      test.assertEquals("String_Node_Str",result.getCell(new int[]{0}).getValue());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getHierarchy().getDefaultMember();
    }
    public void testDimensionDefaultMember(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      if (children.length == 0) {
        return member.getHierarchy().getNullMember();
      }
 else {
        return children[0];
      }
    }
    public void testFirstChildFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstChildAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstChildOfChildless(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      Member[] children;
      if (parent == null) {
        if (member.isNull()) {
          return member;
        }
        children=member.getHierarchy().getRootMembers();
      }
 else {
        children=parent.getMemberChildren();
      }
      return children[0];
    }
    public void testFirstSiblingFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
    public void testFirstSiblingRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testFirstSiblingNull(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      int n=getIntArg(evaluator,args,1);
      return member.getLeadMember(-n);
    }
    public void testLag(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLagFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testLagAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
    public void testLagRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLagRootTooFar(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      if (children.length == 0) {
        return member.getHierarchy().getNullMember();
      }
 else {
        return children[children.length - 1];
      }
    }
    public void testLastChild(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastChildOfChildless(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      Member[] children;
      if (parent == null) {
        if (member.isNull()) {
          return member;
        }
        children=member.getHierarchy().getRootMembers();
      }
 else {
        children=parent.getMemberChildren();
      }
      return children[children.length - 1];
    }
    public void testLastSibling(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingFirstInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingAll(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertTrue(member.isAll());
    }
    public void testLastSiblingRoot(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLastSiblingNull(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      int n=getIntArg(evaluator,args,1);
      return member.getLeadMember(n);
    }
    public void testLead(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLeadNegative(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertEquals("String_Node_Str",member.getName());
    }
    public void testLeadLastInLevel(    FoodMartTestCase test){
      Member member=test.executeAxis("String_Node_Str");
      test.assertNull(member);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLeadMember(+1);
    }
    public void testBasic2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
    public void testAll2(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member parent=member.getParentMember();
      if (parent == null) {
        parent=member.getHierarchy().getNullMember();
      }
      return parent;
    }
    public void testBasic5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testAll5(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getLeadMember(-1);
    }
    public void testBasic(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions[0].members[0].getName().equals("String_Node_Str"));
    }
    public void testFirstInLevel(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
    public void testAll(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str");
      test.assertTrue(result.getAxes()[0].positions.length == 0);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return avg(evaluator.push(),members,exp);
    }
    public void testAvg(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return correlation(evaluator.push(),members,exp1,exp2);
    }
    public void testCorrelation(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      String empties=(String)getArg(evaluator,args,1,"String_Node_Str");
      if (empties.equals("String_Node_Str")) {
        return new Double(members.size());
      }
 else {
        int retval=0;
        for (int i=0; i < members.size(); i++) {
          if ((members.elementAt(i) != Util.nullValue) && (members.elementAt(i) != null)) {
            retval++;
          }
        }
        return new Double(retval);
      }
    }
    public void testCount(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return covariance(evaluator.push(),members,exp1,exp2,true);
    }
    public void testCovariance(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp1=(ExpBase)getArg(evaluator,args,1);
      ExpBase exp2=(ExpBase)getArg(evaluator,args,2);
      return covariance(evaluator.push(),members,exp1,exp2,false);
    }
    public void testCovarianceN(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return max(evaluator.push(),members,exp);
    }
    public void testMax(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return median(evaluator.push(),members,exp);
    }
    public void testMedian(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return min(evaluator.push(),members,exp);
    }
    public void testMin(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,false);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,false);
    }
    public void testStdev(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,true);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return stdev(evaluator.push(),members,exp,true);
    }
    public void testStdevP(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return sum(evaluator.push(),members,exp);
    }
    public void testSumNoExp(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.evaluateScalar(evaluator);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member[] members=getTupleArg(evaluator,args,0);
      Evaluator evaluator2=evaluator.push(members);
      return evaluator2.evaluateCurrent();
    }
  }
);
  if (false)   define(new ResolverBase("String_Node_Str",null,null,FunDef.TypeParentheses){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length == 1 && args[0].getType() == FunCall.CatTuple) {
        return new ValueFunDef(new int[]{FunCall.CatTuple});
      }
      for (int i=0; i < args.length; i++) {
        Exp arg=args[i];
        if (!canConvert(arg,FunCall.CatMember,conversionCount)) {
          return null;
        }
      }
      int[] argTypes=new int[args.length];
      for (int i=0; i < argTypes.length; i++) {
        argTypes[i]=FunCall.CatMember;
      }
      return new ValueFunDef(argTypes);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,false);
    }
    public void testVar(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,false);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,true);
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,1);
      return var(evaluator.push(),members,exp,true);
    }
    public void testVarP(    FoodMartTestCase test){
      String result=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",result);
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set=(Vector)getArg(evaluator,args,0);
      int n=getIntArg(evaluator,args,1);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2,null);
      if (exp != null) {
        boolean desc=false, brk=true;
        sort(evaluator,set,exp,desc,brk);
      }
      if (n < set.size()) {
        set.setSize(n);
      }
      return set;
    }
    public void testBottomCount(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,false,true,n.doubleValue());
    }
    public void testBottomPercent(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,false,false,n.doubleValue());
    }
    public void testBottomSum(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      Member[] children=member.getMemberChildren();
      return toVector(children);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Hierarchy getHierarchy(    Exp[] args){
      return null;
    }
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set0=(Vector)getArg(evaluator,args,0), set1=(Vector)getArg(evaluator,args,1);
      if (set0.isEmpty() || set1.isEmpty()) {
        return emptyVector;
      }
      int arity0=1, arity1=1;
      if (set0.elementAt(0) instanceof Member[]) {
        arity0=((Member[])set0.elementAt(0)).length;
      }
      if (set1.elementAt(0) instanceof Member[]) {
        arity1=((Member[])set1.elementAt(0)).length;
      }
      Vector result=new Vector();
      if (arity0 == 1 && arity1 == 1) {
        for (int i=0, m=set0.size(); i < m; i++) {
          Member o0=(Member)set0.elementAt(i);
          for (int j=0, n=set1.size(); j < n; j++) {
            Member o1=(Member)set1.elementAt(j);
            result.addElement(new Member[]{o0,o1});
          }
        }
      }
 else {
        Member[] row=new Member[arity0 + arity1];
        for (int i=0, m=set0.size(); i < m; i++) {
          int x=0;
          Object o0=set0.elementAt(i);
          if (o0 instanceof Member) {
            row[x++]=(Member)o0;
          }
 else {
            assertTrue(o0 instanceof Member[]);
            final Member[] members=(Member[])o0;
            for (int k=0; k < members.length; k++) {
              row[x++]=members[k];
            }
          }
          for (int j=0, n=set1.size(); j < n; j++) {
            Object o1=set1.elementAt(j);
            if (o1 instanceof Member) {
              row[x++]=(Member)o1;
            }
 else {
              assertTrue(o1 instanceof Member[]);
              final Member[] members=(Member[])o1;
              for (int k=0; k < members.length; k++) {
                row[x++]=members[k];
              }
            }
            result.addElement(row.clone());
            x=arity0;
          }
        }
      }
      return result;
    }
    public void testCrossjoinNested(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
  }
);
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String descFlag=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},dummyFunDef);
      if (!descFlag.equals("String_Node_Str")) {
        throw newEvalException(null,"String_Node_Str");
      }
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Member member=getMemberArg(evaluator,args,0,true);
          Level level=getLevelArg(evaluator,args,1,true);
          if (member.getLevel().getDepth() > level.getDepth()) {
            return new Member[0];
          }
          final Hierarchy hierarchy=member.getHierarchy();
          Member[] children={member};
          while (children.length > 0 && children[0].getLevel().getDepth() < level.getDepth()) {
            children=hierarchy.getChildMembers(children);
          }
          return toVector(children);
        }
      }
;
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set0=(Vector)getArg(evaluator,args,0);
      int[] depthArray=new int[set0.size()];
      Vector drilledSet=new Vector();
      for (int i=0, m=set0.size(); i < m; i++) {
        Member member=(Member)set0.elementAt(i);
        depthArray[i]=member.getDepth();
      }
      Arrays.sort(depthArray);
      int maxDepth=depthArray[depthArray.length - 1];
      for (int i=0, m=set0.size(); i < m; i++) {
        Member member=(Member)set0.elementAt(i);
        drilledSet.addElement(member);
        if (member.getDepth() == maxDepth) {
          Member[] childMembers=member.getMemberChildren();
          for (int j=0; j < childMembers.length; j++) {
            drilledSet.addElement(childMembers[j]);
          }
        }
      }
      return drilledSet;
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      HashSet set2=toHashSet((Vector)getArg(evaluator,args,1));
      Vector set1=(Vector)getArg(evaluator,args,0);
      Vector result=new Vector();
      for (int i=0, count=set1.size(); i < count; i++) {
        Object o=set1.elementAt(i);
        if (!set2.contains(o)) {
          result.addElement(o);
        }
      }
      return result;
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      Exp exp=args[1];
      Vector result=new Vector();
      Evaluator evaluator2=evaluator.push();
      for (int i=0, count=members.size(); i < count; i++) {
        Object o=members.elementAt(i);
        if (o instanceof Member) {
          evaluator2.setContext((Member)o);
        }
 else         if (o instanceof Member[]) {
          evaluator2.setContext((Member[])o);
        }
 else {
          throw Util.newInternal("String_Node_Str" + o.getClass());
        }
        Boolean b=(Boolean)exp.evaluateScalar(evaluator2);
        if (b.booleanValue()) {
          result.add(o);
        }
      }
      return result;
    }
    /** 
 * Make sure that slicer is in force when expression is applied on axis, E.g. select filter([Customers].members, [Unit Sales] > 100) from sales where ([Time].[1998])
 */
    public void testFilterWithSlicer(    FoodMartTestCase test){
      Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      Axis rows=result.getAxes()[1];
      test.assertEquals(1,rows.positions.length);
      Cell cell=result.getCell(new int[]{0,0});
      test.assertEquals("String_Node_Str",cell.getFormattedValue());
    }
    public void testFilterCompound(    FoodMartTestCase test){
      Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      Position[] rows=result.getAxes()[1].positions;
      test.assertTrue(rows.length == 3);
      test.assertEquals("String_Node_Str",rows[0].members[0].getName());
      test.assertEquals("String_Node_Str",rows[0].members[1].getName());
      test.assertEquals("String_Node_Str",rows[1].members[0].getName());
      test.assertEquals("String_Node_Str",rows[1].members[1].getName());
      test.assertEquals("String_Node_Str",rows[2].members[0].getName());
      test.assertEquals("String_Node_Str",rows[2].members[1].getName());
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String order=getLiteralArg(args,1,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean post=order.equals("String_Node_Str");
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector members=(Vector)getArg(evaluator,args,0);
          hierarchize(members,post);
          return members;
        }
      }
;
    }
    public void testHierarchize(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testHierarchizePost(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testHierarchizeCrossJoinPre(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testHierarchizeCrossJoinPost(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=(Dimension)getArg(evaluator,args,0);
      Hierarchy hierarchy=dimension.getHierarchy();
      return addMembers(new Vector(),hierarchy);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=(Hierarchy)getArg(evaluator,args,0);
      return addMembers(new Vector(),hierarchy);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=(Level)getArg(evaluator,args,0);
      return toVector(level.getMembers());
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getMonthLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String order=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean desc=order.equals("String_Node_Str") || order.equals("String_Node_Str");
      final boolean brk=order.equals("String_Node_Str") || order.equals("String_Node_Str");
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector members=(Vector)getArg(evaluator,args,0);
          ExpBase exp=(ExpBase)getArgNoEval(args,1);
          sort(evaluator,members,exp,desc,brk);
          return members;
        }
      }
;
    }
    public void testOrder(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderParentsMissing(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + "String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderCrossJoinBreak(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderCrossJoin(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
    public void testOrderHierarchicalDesc(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testOrderCrossJoinDesc(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testOrderBug656802(    FoodMartTestCase test){
      test.runQueryCheckResult("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl);
    }
  }
);
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,false);
      Member member=getMemberArg(evaluator,args,1,false);
      return new Vector(periodsToDate(evaluator,level,member));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getQuarterLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public void unparse(    Exp[] args,    PrintWriter pw,    ElementCallback callback){
      if (callback.isPlatoMdx()) {
        super.unparse(new Exp[]{args[0]},pw,callback);
      }
 else {
        super.unparse(args,pw,callback);
      }
    }
    public Hierarchy getHierarchy(    Exp[] args){
      return (args.length == 2) ? (Hierarchy)args[1] : null;
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector v0=(Vector)getArg(evaluator,args,0), v1=(Vector)getArg(evaluator,args,1);
      if (args.length > 2) {
        throw Util.newInternal("String_Node_Str");
      }
      if (v1.isEmpty()) {
        return v0;
      }
      if (v0.isEmpty()) {
        return v0;
      }
      HashSet set1=toHashSet(v1);
      Vector result=new Vector();
      int i=0, n=v0.size();
      while (i < n) {
        Object o=v0.elementAt(i++);
        result.addElement(o);
        Member m=null;
        int k=-1;
        if (o instanceof Member) {
          if (!set1.contains(o)) {
            continue;
          }
          m=(Member)o;
          k=-1;
        }
 else {
          Util.assertTrue(o instanceof Member[]);
          Member[] members=(Member[])o;
          for (int j=0; j < members.length; j++) {
            Member member=members[j];
            if (set1.contains(member)) {
              k=j;
              m=member;
              break;
            }
          }
          if (k == -1) {
            continue;
          }
        }
        boolean isDrilledDown=false;
        if (i < n) {
          Object next=v0.elementAt(i);
          Member nextMember=(k < 0) ? (Member)next : ((Member[])next)[k];
          boolean strict=true;
          if (isAncestorOf(m,nextMember,strict)) {
            isDrilledDown=true;
          }
        }
        if (isDrilledDown) {
          do {
            Object next=v0.elementAt(i);
            Member nextMember=(k < 0) ? (Member)next : ((Member[])next)[k];
            boolean strict=true;
            if (isAncestorOf(m,nextMember,strict)) {
              i++;
            }
 else {
              break;
            }
          }
 while (i < n);
        }
 else {
          Member[] children=m.getMemberChildren();
          for (int j=0; j < children.length; j++) {
            if (k < 0) {
              result.addElement(children[j]);
            }
 else {
              Member[] members=(Member[])((Member[])o).clone();
              members[k]=children[j];
              result.addElement(members);
            }
          }
        }
      }
      return result;
    }
    public void testToggleDrillState(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testToggleDrillState2(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testToggleDrillState3(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testToggleDrillStateTuple(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector set=(Vector)getArg(evaluator,args,0);
      int n=getIntArg(evaluator,args,1);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2,null);
      if (exp != null) {
        boolean desc=true, brk=true;
        sort(evaluator,set,exp,desc,brk);
      }
      if (n < set.size()) {
        set.setSize(n);
      }
      return set;
    }
    public void testTopCount(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,true,true,n.doubleValue());
    }
    public void testTopPercent(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Vector members=(Vector)getArg(evaluator,args,0);
      ExpBase exp=(ExpBase)getArg(evaluator,args,2);
      Double n=getDoubleArg(evaluator,args,1);
      return topOrBottom(evaluator.push(),members,exp,true,false,n.doubleValue());
    }
    public void testTopSum(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
  }
));
  define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"}){
    protected FunDef createFunDef(    Exp[] args,    FunDef dummyFunDef){
      String allString=getLiteralArg(args,2,"String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},dummyFunDef);
      final boolean all=allString.equalsIgnoreCase("String_Node_Str");
      checkCompatible(args[0],args[1],dummyFunDef);
      return new FunDefBase(dummyFunDef){
        public Object evaluate(        Evaluator evaluator,        Exp[] args){
          Vector left=(Vector)getArg(evaluator,args,0), right=(Vector)getArg(evaluator,args,1);
          if (all) {
            if (left == null || left.isEmpty()) {
              return right;
            }
            add(left,right);
            return left;
          }
 else {
            HashSet added=new HashSet();
            Vector result=new Vector();
            addUnique(result,left,added);
            addUnique(result,right,added);
            return result;
          }
        }
      }
;
    }
    public void testUnionAll(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str");
    }
    public void testUnion(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testUnionEmptyBoth(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testUnionEmptyRight(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testUnionTuple(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testUnionQuery(    FoodMartTestCase test){
      Result result=test.runQuery("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
      final Axis rowsAxis=result.getAxes()[1];
      test.assertEquals(45,rowsAxis.positions.length);
    }
  }
);
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getWeekLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new FunkResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},new FunkBase(){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      return new Vector(periodsToDate(evaluator,evaluator.getCube().getYearLevel(),getMemberArg(evaluator,args,0,false)));
    }
  }
));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      final Member member0=getMemberArg(evaluator,args,0,true);
      final Member member1=getMemberArg(evaluator,args,1,true);
      if (member0.isNull() || member1.isNull()) {
        return emptyVector;
      }
      if (member0.getLevel() != member1.getLevel()) {
        throw newEvalException(this,"String_Node_Str");
      }
      return new Vector(FunUtil.memberRange(member0,member1));
    }
    public void testRange(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    /** 
 * Large dimensions use a different member reader, therefore need to be tested separately.
 */
    public void testRangeLarge(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testRangeStartEqualsEnd(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testRangeStartEqualsEndLarge(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testRangeEndBeforeStart(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testRangeEndBeforeStartLarge(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str");
    }
    public void testRangeBetweenDifferentLevelsIsError(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
    public void testRangeBoundedByAll(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testRangeBoundedByAllLarge(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testRangeBoundedByNull(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
    public void testRangeBoundedByNullLarge(    FoodMartTestCase test){
      test.assertAxisReturns("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeBraces){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      int[] parameterTypes=new int[args.length];
      for (int i=0; i < args.length; i++) {
        if (canConvert(args[i],Exp.CatMember,conversionCount)) {
          parameterTypes[i]=Exp.CatMember;
          continue;
        }
        if (canConvert(args[i],Exp.CatSet,conversionCount)) {
          parameterTypes[i]=Exp.CatSet;
          continue;
        }
        if (canConvert(args[i],Exp.CatTuple,conversionCount)) {
          parameterTypes[i]=Exp.CatTuple;
          continue;
        }
        return null;
      }
      return new SetFunDef(this,syntacticType,parameterTypes);
    }
    public void testSetContainingLevelFails(    FoodMartTestCase test){
      test.assertAxisThrows("String_Node_Str","String_Node_Str");
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      boolean logical=getBooleanArg(evaluator,args,0);
      return getStringArg(evaluator,args,logical ? 1 : 2,null);
    }
    public void testIIf(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getName();
    }
    public void testDimensionName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getName();
    }
    public void testHierarchyName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getName();
    }
    public void testLevelName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getName();
    }
    public void testMemberName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Dimension dimension=getDimensionArg(evaluator,args,0,true);
      return dimension.getUniqueName();
    }
    public void testDimensionUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Hierarchy hierarchy=getHierarchyArg(evaluator,args,0,true);
      return hierarchy.getUniqueName();
    }
    public void testHierarchyUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Level level=getLevelArg(evaluator,args,0,true);
      return level.getUniqueName();
    }
    public void testLevelUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public Object evaluate(    Evaluator evaluator,    Exp[] args){
      Member member=getMemberArg(evaluator,args,0,true);
      return member.getUniqueName();
    }
    public void testMemberUniqueName(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testMemberUniqueNameOfNull(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  if (false)   define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
    public void unparse(    Exp[] args,    PrintWriter pw,    ElementCallback callback){
      if (callback.isPlatoMdx()) {
        super.unparse(new Exp[]{args[0]},pw,callback);
      }
 else {
        super.unparse(args,pw,callback);
      }
    }
    public Hierarchy getHierarchy(    Exp[] args){
      return (args.length == 2) ? (Hierarchy)args[1] : null;
    }
  }
);
  define(new ResolverBase("String_Node_Str",null,null,FunDef.TypeParentheses){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length == 1) {
        return new ParenthesesFunDef(args[0].getType());
      }
 else {
        return new TupleFunDef(ExpBase.getTypes(args));
      }
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeFunction){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 1) {
        return null;
      }
      final int[] types={Exp.CatNumeric,Exp.CatString};
      for (int j=0; j < types.length; j++) {
        int type=types[j];
        int matchingArgs=0;
        conversionCount[0]=0;
        for (int i=0; i < args.length; i++) {
          if (canConvert(args[i],type,conversionCount)) {
            matchingArgs++;
          }
        }
        if (matchingArgs == args.length) {
          return new FunDefBase(this,FunDef.TypeFunction,type,ExpBase.getTypes(args));
        }
      }
      return null;
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeCase){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 1) {
        return null;
      }
      int j=0, clauseCount=args.length / 2, mismatchingArgs=0;
      int returnType=args[1].getType();
      for (int i=0; i < clauseCount; i++) {
        if (!canConvert(args[j++],Exp.CatLogical,conversionCount)) {
          mismatchingArgs++;
        }
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      if (j < args.length) {
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      Util.assertTrue(j == args.length);
      if (mismatchingArgs == 0) {
        return new FunDefBase(this,FunDef.TypeFunction,returnType,ExpBase.getTypes(args)){
          public Object evaluate(          Evaluator evaluator,          Exp[] args){
            return evaluateCaseTest(evaluator,args);
          }
        }
;
      }
 else {
        return null;
      }
    }
    Object evaluateCaseTest(    Evaluator evaluator,    Exp[] args){
      int clauseCount=args.length / 2, j=0;
      for (int i=0; i < clauseCount; i++) {
        boolean logical=getBooleanArg(evaluator,args,j++);
        if (logical) {
          return getArg(evaluator,args,j);
        }
 else {
          j++;
        }
      }
      if (j < args.length) {
        return getArg(evaluator,args,j);
      }
 else {
        return null;
      }
    }
    public void testCaseTestMatch(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseTestMatchElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseTestMatchNoElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeCase){
    protected FunDef resolve(    Exp[] args,    int[] conversionCount){
      if (args.length < 3) {
        return null;
      }
      int valueType=args[0].getType();
      int returnType=args[2].getType();
      int j=0, clauseCount=(args.length - 1) / 2, mismatchingArgs=0;
      if (!canConvert(args[j++],valueType,conversionCount)) {
        mismatchingArgs++;
      }
      for (int i=0; i < clauseCount; i++) {
        if (!canConvert(args[j++],valueType,conversionCount)) {
          mismatchingArgs++;
        }
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      if (j < args.length) {
        if (!canConvert(args[j++],returnType,conversionCount)) {
          mismatchingArgs++;
        }
      }
      Util.assertTrue(j == args.length);
      if (mismatchingArgs == 0) {
        return new FunDefBase(this,FunDef.TypeFunction,returnType,ExpBase.getTypes(args)){
          public Object evaluate(          Evaluator evaluator,          Exp[] args){
            return evaluateCaseMatch(evaluator,args);
          }
        }
;
      }
 else {
        return null;
      }
    }
    Object evaluateCaseMatch(    Evaluator evaluator,    Exp[] args){
      int clauseCount=(args.length - 1) / 2, j=0;
      Object value=getArg(evaluator,args,j++);
      for (int i=0; i < clauseCount; i++) {
        Object match=getArg(evaluator,args,j++);
        if (match.equals(value)) {
          return getArg(evaluator,args,j);
        }
 else {
          j++;
        }
      }
      if (j < args.length) {
        return getArg(evaluator,args,j);
      }
 else {
        return null;
      }
    }
    public void testCaseMatch(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseMatchElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
    public void testCaseMatchNoElse(    FoodMartTestCase test){
      String s=test.executeExpr("String_Node_Str");
      test.assertEquals("String_Node_Str",s);
    }
  }
);
  define(new ResolverBase("String_Node_Str","String_Node_Str","String_Node_Str",FunDef.TypeMethod){
    public FunDef resolve(    Exp[] args,    int[] conversionCount){
      final int[] argTypes=new int[]{Exp.CatMember,Exp.CatString};
      if (args.length != 2 || args[0].getType() != Exp.CatMember || args[1].getType() != Exp.CatString) {
        return null;
      }
      int returnType;
      if (args[1] instanceof Literal) {
        String propertyName=(String)((Literal)args[1]).getValue();
        Hierarchy hierarchy=args[0].getHierarchy();
        Level[] levels=hierarchy.getLevels();
        Property property=lookupProperty(levels[levels.length - 1],propertyName);
        if (property == null) {
          returnType=Exp.CatValue;
        }
 else {
switch (property.getType()) {
case Property.TYPE_BOOLEAN:
            returnType=Exp.CatLogical;
          break;
case Property.TYPE_NUMERIC:
        returnType=Exp.CatNumeric;
      break;
case Property.TYPE_STRING:
    returnType=Exp.CatString;
  break;
default :
throw Util.newInternal("String_Node_Str" + property.getType());
}
}
}
 else {
returnType=Exp.CatValue;
}
return new PropertiesFunDef(name,signature,description,syntacticType,returnType,argTypes);
}
public void testPropertiesExpr(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
/** 
 * Tests that non-existent property throws an error. 
 */
public void testPropertiesNonExistent(FoodMartTestCase test){
test.assertExprThrows("String_Node_Str","String_Node_Str");
}
public void testPropertiesFilter(FoodMartTestCase test){
Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
test.assertEquals(8,result.getAxes()[1].positions.length);
}
public void testPropertyInCalculatedMember(FoodMartTestCase test){
Result result=test.execute("String_Node_Str" + nl + "String_Node_Str"+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str"+ nl+ "String_Node_Str");
Member member;
Cell cell;
member=result.getAxes()[1].positions[17].members[0];
test.assertEquals("String_Node_Str",member.getUniqueName());
cell=result.getCell(new int[]{0,17});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
cell=result.getCell(new int[]{1,17});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
member=result.getAxes()[1].positions[3].members[0];
test.assertEquals("String_Node_Str",member.getUniqueName());
cell=result.getCell(new int[]{0,3});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
cell=result.getCell(new int[]{1,3});
test.assertEquals("String_Node_Str",cell.getFormattedValue());
}
}
);
define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}){
protected FunDef createFunDef(Exp[] args,FunDef dummyFunDef){
String parameterName;
if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) {
parameterName=(String)((Literal)args[0]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str");
}
Exp typeArg=args[1];
Hierarchy hierarchy;
int type;
switch (typeArg.getType()) {
case Exp.CatHierarchy:
case Exp.CatDimension:
hierarchy=typeArg.getHierarchy();
if (hierarchy == null || !isConstantHierarchy(typeArg)) {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
type=Exp.CatMember;
break;
case Exp.CatSymbol:
hierarchy=null;
String s=(String)((Literal)typeArg).getValue();
if (s.equalsIgnoreCase("String_Node_Str")) {
type=Exp.CatNumeric;
break;
}
 else if (s.equalsIgnoreCase("String_Node_Str")) {
type=Exp.CatString;
break;
}
default :
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
Exp exp=args[2];
if (exp.getType() != type) {
String typeName=Exp.catEnum.getName(type).toUpperCase();
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str"+ typeName);
}
if (type == Exp.CatMember) {
Hierarchy expHierarchy=exp.getHierarchy();
if (expHierarchy != hierarchy) {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str"+ hierarchy);
}
}
String parameterDescription=null;
if (args.length > 3) {
if (args[3] instanceof Literal && args[3].getType() == Exp.CatString) {
parameterDescription=(String)((Literal)args[3]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str" + parameterName + "String_Node_Str");
}
}
return new ParameterFunDef(dummyFunDef,parameterName,hierarchy,type,exp,parameterDescription);
}
}
);
define(new MultiResolver("String_Node_Str","String_Node_Str","String_Node_Str",new String[]{"String_Node_Str"}){
protected FunDef createFunDef(Exp[] args,FunDef dummyFunDef){
String parameterName;
if (args[0] instanceof Literal && args[0].getType() == Exp.CatString) {
parameterName=(String)((Literal)args[0]).getValue();
}
 else {
throw newEvalException(dummyFunDef,"String_Node_Str");
}
return new ParameterFunDef(dummyFunDef,parameterName,null,Exp.CatUnknown,null,null);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() + o1.doubleValue());
}
public void testPlus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() - o1.doubleValue());
}
public void testMinus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testMinusAssociativity(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return new Double(o0.doubleValue() * o1.doubleValue());
}
public void testMultiply(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testMultiplyPrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
Double result=new Double(o0.doubleValue() / o1.doubleValue());
return result;
}
public double evaluate(double d1,double d2){
return d1 / d2;
}
public void testDivide(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testDivideByZero(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testDividePrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0);
return new Double(-o0.doubleValue());
}
public void testUnaryMinus(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testUnaryMinusMember(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testUnaryMinusPrecedence(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return o0 + o1;
}
public void testStringConcat(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringConcat2(FoodMartTestCase test){
String s=test.executeExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(getBooleanArg(evaluator,args,0) && getBooleanArg(evaluator,args,1));
}
public void testAnd(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testAnd2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(getBooleanArg(evaluator,args,0) || getBooleanArg(evaluator,args,1));
}
public void testOr(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOr2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity1(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity2(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testOrAssociativity3(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
final boolean b0=getBooleanArg(evaluator,args,0);
final boolean b1=getBooleanArg(evaluator,args,1);
return toBoolean(b0 != b1);
}
public void testXor(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testXorAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
return toBoolean(!getBooleanArg(evaluator,args,0));
}
public void testNot(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNotNot(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNotAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return toBoolean(o0.equals(o1));
}
public void testStringEquals(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringEqualsAssociativity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testStringEqualsEmpty(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.equals(o1));
}
public void testEq(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
String o0=getStringArg(evaluator,args,0,null), o1=getStringArg(evaluator,args,1,null);
return toBoolean(!o0.equals(o1));
}
public void testStringNe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(!o0.equals(o1));
}
public void testNe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
public void testNeInfinity(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) < 0);
}
public void testLt(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) <= 0);
}
public void testLe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) > 0);
}
public void testGt(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
define(new FunDefBase("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"){
public Object evaluate(Evaluator evaluator,Exp[] args){
Double o0=getDoubleArg(evaluator,args,0), o1=getDoubleArg(evaluator,args,1);
return toBoolean(o0.compareTo(o1) >= 0);
}
public void testGe(FoodMartTestCase test){
String s=test.executeBooleanExpr("String_Node_Str");
test.assertEquals("String_Node_Str",s);
}
}
);
}