예제 #1
0
 private static void checkLocale(
     final String localeName, String expr, String expected, boolean isQuery) {
   TestContext testContextSpain =
       new TestContext() {
         public mondrian.olap.Connection getConnection() {
           Util.PropertyList properties = Util.parseConnectString(getConnectString());
           properties.put(RolapConnectionProperties.Locale.name(), localeName);
           return DriverManager.getConnection(properties, null);
         }
       };
   if (isQuery) {
     String query =
         "WITH MEMBER [Measures].[Foo] AS '"
             + expr
             + "',\n"
             + " FORMAT_STRING = '#,##.#' \n"
             + "SELECT {[MEasures].[Foo]} ON COLUMNS FROM [Sales]";
     String expected2 =
         "Axis #0:\n"
             + "{}\n"
             + "Axis #1:\n"
             + "{[Measures].[Foo]}\n"
             + "Row #0: "
             + expected
             + "\n";
     testContextSpain.assertQueryReturns(query, expected2);
   } else {
     testContextSpain.assertExprReturns(expr, expected);
   }
 }