Package com.google.gxp.compiler.reparent

Examples of com.google.gxp.compiler.reparent.ConflictingAttributesError


    // both tests
    compile("<gxp:loop var='v' type='t' java:iterator='e' js:iterable='e' />");
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterator='e' js:iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'js:iterable' attribute",
                                               "'iterator' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' java:iterator='e' iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'iterable' attribute",
                                               "'java:iterator' attribute"));

    compile("<gxp:loop var='v' type='t' cpp:iterator='e' cpp:iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'cpp:iterable' attribute",
                                               "'cpp:iterator' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' cpp:iterator='e' js:iterable='e' />");
View Full Code Here


    compile("<gxp:loop var='v' type='t' iterable='e' expr:delimiter='' java:delimiter=''/>");
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterable='e' delimiter='' java:delimiter=''/>");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'delimiter' attribute",
                                               "'java:delimiter' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterable='e' cpp:delimiter=''>",
            "  <gxp:attr name='delimiter'>",
            "    ,",
            "  </gxp:attr>",
            "</gxp:loop>");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'delimiter' attribute",
                                               "'cpp:delimiter' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testImport_hasBothClassAndPackage() throws Exception {
    compile("<gxp:import package='com.google.a' class='com.google.a.b' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:import>",
                                               "'class' attribute", "'package' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

  }

  public void testParam_conflictingTypeAttributes() throws Exception {
    compile("<gxp:param name='foo' gxp:type='boolean' content-type='text/html'" +
            "                      type='String' cpp:type='string' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'content-type' attribute"));
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'type' attribute"));;
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'cpp:type' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:param name='foo' content-type='text/html' type='String' java:type='string' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'content-type' attribute",
                                               "'type' attribute"));;
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'content-type' attribute",
                                               "'java:type' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

* Tests of proper error reporting by the GXP compiler relating to loops.
*/
public class LoopErrorTest extends BaseTestCase {
  public void testLoop_bothIteratorAndIterable() throws Exception {
    compile("<gxp:loop var='x' type='int' iterable='foo' iterator='bar'>content</gxp:loop>");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:loop>",
                                               "'iterable' attribute",
                                               "'iterator' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    // both tests
    compile("<gxp:loop var='v' type='t' java:iterator='e' scala:iterator='e' js:iterable='e' />");
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterator='e' js:iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'js:iterable' attribute",
                                               "'iterator' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' java:iterator='e' iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'iterable' attribute",
                                               "'java:iterator' attribute"));

    compile("<gxp:loop var='v' type='t' cpp:iterator='e' cpp:iterable='e' />");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'cpp:iterable' attribute",
                                               "'cpp:iterator' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' cpp:iterator='e' js:iterable='e' />");
View Full Code Here

    compile("<gxp:loop var='v' type='t' iterable='e' expr:delimiter='' java:delimiter=''/>");
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterable='e' delimiter='' java:delimiter=''/>");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'delimiter' attribute",
                                               "'java:delimiter' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:loop var='v' type='t' iterable='e' cpp:delimiter=''>",
            "  <gxp:attr name='delimiter'>",
            "    ,",
            "  </gxp:attr>",
            "</gxp:loop>");
    assertAlert(new ConflictingAttributesError(pos(2, 1), "<gxp:loop>",
                                               "'delimiter' attribute",
                                               "'cpp:delimiter' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testImport_hasBothClassAndPackage() throws Exception {
    compile("<gxp:import package='com.google.a' class='com.google.a.b' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:import>",
                                               "'class' attribute", "'package' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

  }

  public void testParam_conflictingTypeAttributes() throws Exception {
    compile("<gxp:param name='foo' gxp:type='boolean' content-type='text/html'" +
            "                      type='String' cpp:type='string' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'content-type' attribute"));
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'type' attribute"));;
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'gxp:type' attribute",
                                               "'cpp:type' attribute"));
    assertNoUnexpectedAlerts();

    compile("<gxp:param name='foo' content-type='text/html' type='String' java:type='string' />");
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'content-type' attribute",
                                               "'type' attribute"));;
    assertAlert(new ConflictingAttributesError(pos(2,1), "<gxp:param>",
                                               "'content-type' attribute",
                                               "'java:type' attribute"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.reparent.ConflictingAttributesError

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.