Package com.google.gxp.compiler.codegen

Examples of com.google.gxp.compiler.codegen.MissingExpressionError


    compile(String.format("%s expr:%s='e' %s", prefix, attrName, suffix));
    assertNoUnexpectedAlerts();

    // attribute with java: prefix
    compile(String.format("%s java:%s='e' %s", prefix, attrName, suffix));
    assertAlert(new MissingExpressionError(pos(errorLine, errorColumn), displyName, "JavaScript"));
    assertNoUnexpectedAlerts();

    // basic attribute and with java: prefix
    compile(String.format("%s %s='e' java:%s='e' %s", prefix, attrName, attrName, suffix));
    assertNoUnexpectedAlerts();
View Full Code Here


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

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

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

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

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

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

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

    compile("<gxp:loop var='v' type='t' js:iterator='e' />");
    assertAlert(new UnknownAttributeError("<gxp:loop>", pos(2, 1), "'js:iterator' attribute"));
View Full Code Here

  public void testCall_JavaAndCppAttribute() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='s' type='String' />");
    FileRef caller = createFile("caller", "<call:callee cpp:s='foo' java:s='bar' />");
    compileFiles(callee, caller);
    assertAlert(new MissingExpressionError(pos(2,1), "'s' attribute", "JavaScript"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testOutputElement_OnlyJavaAttribute() throws Exception {
    compile("<div java:class='baz'/>");
    assertAlert(new MissingExpressionError(pos(2,1), "'class' attribute", "JavaScript"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

          appendLine("}");
        } else {
          // if we only have an expression for 1 of iterable/iterator then we
          // add a MissingExpressionAlert
          if (loop.getIterable() == null && loop.getIterator() != null) {
            alertSink.add(new MissingExpressionError(loop.getIterator(), JAVA));
          } else if (loop.getIterator() == null && loop.getIterable() != null) {
            alertSink.add(new MissingExpressionError(loop.getIterable(), JAVA));
          } else {
            alertSink.add(new LoopMissingBothIterableAndIteratorError(loop, JAVA));
          }
        }
        // close outer scope
View Full Code Here

    compile(String.format("%s expr:%s='e' %s", prefix, attrName, suffix));
    assertNoUnexpectedAlerts();

    // attribute with java: prefix
    compile(String.format("%s java:%s='e' %s", prefix, attrName, suffix));
    assertAlert(new MissingExpressionError(pos(errorLine, errorColumn), displyName, "JavaScript"));
    assertAlert(new MissingExpressionError(pos(errorLine, errorColumn), displyName, "Scala"));
    assertNoUnexpectedAlerts();

    // basic attribute and with java: prefix
    compile(String.format("%s %s='e' java:%s='e' %s", prefix, attrName, attrName, suffix));
    assertNoUnexpectedAlerts();
View Full Code Here

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

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

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

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

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

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

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

    compile("<gxp:loop var='v' type='t' js:iterator='e' />");
    assertAlert(new UnknownAttributeError("<gxp:loop>", pos(2, 1), "'js:iterator' attribute"));
View Full Code Here

  public void testCall_JavaAndCppAttribute() throws Exception {
    FileRef callee = createFile("callee", "<gxp:param name='s' type='String' />");
    FileRef caller = createFile("caller", "<call:callee cpp:s='foo' java:s='bar' />");
    compileFiles(callee, caller);
    assertAlert(new MissingExpressionError(pos(2,1), "'s' attribute", "JavaScript"));
    assertAlert(new MissingExpressionError(pos(2,1), "'s' attribute", "Scala"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

    assertNoUnexpectedAlerts();
  }

  public void testOutputElement_OnlyJavaAttribute() throws Exception {
    compile("<div java:class='baz'/>");
    assertAlert(new MissingExpressionError(pos(2,1), "'class' attribute", "JavaScript"));
    assertAlert(new MissingExpressionError(pos(2,1), "'class' attribute", "Scala"));
    assertNoUnexpectedAlerts();
  }
View Full Code Here

          appendLine("}");
        } else {
          // if we only have an expression for 1 of iterable/iterator then we
          // add a MissingExpressionAlert
          if (loop.getIterable() == null && loop.getIterator() != null) {
            alertSink.add(new MissingExpressionError(loop.getIterator(), JAVA));
          } else if (loop.getIterator() == null && loop.getIterable() != null) {
            alertSink.add(new MissingExpressionError(loop.getIterable(), JAVA));
          } else {
            alertSink.add(new LoopMissingBothIterableAndIteratorError(loop, JAVA));
          }
        }
        // close outer scope
View Full Code Here

TOP

Related Classes of com.google.gxp.compiler.codegen.MissingExpressionError

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.