Package com.google.gxp.compiler.alerts.common

Examples of com.google.gxp.compiler.alerts.common.InvalidMessageError


    // static content differs
    compile("<gxp:msg>",
            "<gxp:ph name='x'/>foo<gxp:eph/>",
            "<gxp:ph name='x'/>bar<gxp:eph/>",
            "</gxp:msg>");
    assertAlert(new InvalidMessageError(
                    pos(4, 1), "Conflicting declarations of X within message"));
    assertNoUnexpectedAlerts();

    // static the same
    compile("<gxp:msg>",
            "<gxp:ph name='x'/>foo<gxp:eph/>",
            "<gxp:ph name='x'/>foo<gxp:eph/>",
            "</gxp:msg>");
    assertNoUnexpectedAlerts();

    // dynamic content differs (even if they look the same, NativeExpressions
    // potentially eveluate to different values, so are considered "different")
    compile("<gxp:msg>",
            "<gxp:ph name='x' example='5'/><gxp:eval expr='x.getY()'/><gxp:eph/>",
            "<gxp:ph name='x' example='5'/><gxp:eval expr='x.getY()'/><gxp:eph/>",
            "</gxp:msg>");
    assertAlert(new InvalidMessageError(
                    pos(4, 1), "Conflicting declarations of X within message"));
    assertNoUnexpectedAlerts();

    // Simple evaluations of a single variable are OK.
    compile("<gxp:msg>",
View Full Code Here


    assertNoUnexpectedAlerts();
  }

  public void testPlaceholderStart_invalidName() throws Exception {
    compile("<gxp:msg><gxp:ph name='ham on rye'/>x<gxp:eph/></gxp:msg>");
    assertAlert(new InvalidMessageError(
        pos(2, 10), "Invalid placeholder specification: only caps, digits,"
                    + " and underscores allowed in presentation"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

  public void testPlaceholder_transconsoleError() throws Exception {
    compile("<gxp:msg>",
            "<gxp:ph name='cola'/>coke<gxp:eph/>",
            "<gxp:ph name='cola'/>pepsi<gxp:eph/>",
            "</gxp:msg>");
    assertAlert(new InvalidMessageError(
        pos(4, 1), "Conflicting declarations of COLA within message"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testPlaceholder_conflictsWithMessageContent() throws Exception {
    compile("<gxp:msg>Your SSN is: <gxp:ph name='ssn'/>123<gxp:eph/></gxp:msg>");
    assertAlert(new InvalidMessageError(
        pos(2, 1), "Placeholder name (SSN) duplicated in message content."));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.alerts.common.InvalidMessageError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.