Examples of ErrorBuffer


Examples of games.stendhal.common.ErrorBuffer

        }
      }

      // use the same routine as in the client to parse quoted arguments
      final CommandlineParser parser = new CommandlineParser(cmd);
      final ErrorDrain errors = new ErrorBuffer();

      final List<String> args = parser.readAllParameters(errors);

      new GameEvent(player.getName(), "script", script, mode, args.toString()).raise();
View Full Code Here

Examples of net.rim.tumbler.processbuffer.ErrorBuffer

            System.arraycopy(cmd, 0, join, 0, cmd.length);
            System.arraycopy(files, 0, join, cmd.length, n);
            Process p = buildProcess(join, new File(bindebugPath));

            OutputBuffer stdout = new OutputBuffer(p);
            ErrorBuffer stderr = new ErrorBuffer(p);
            ExitBuffer exitcode = new ExitBuffer(p);

            stdout.waitFor();
            stderr.waitFor();
            exitcode.waitFor();

            if (exitcode.getExitValue().intValue() != 0) {
                System.out.write(stderr.getStderr());
                System.out.write(stdout.getStdout());
                System.out.flush();
                return exitcode.getExitValue().intValue();
            }
        } catch (IOException ioe) {
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    public STViz inspect(Locale locale) {
    return inspect(impl.nativeGroup.errMgr, locale, STWriter.NO_WRAP);
  }

  public STViz inspect(ErrorManager errMgr, Locale locale, int lineWidth) {
    ErrorBuffer errors = new ErrorBuffer();
    impl.nativeGroup.setListener(errors);
    StringWriter out = new StringWriter();
    STWriter wr = new AutoIndentWriter(out);
    wr.setLineWidth(lineWidth);
    Interpreter interp =
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String expecting = " Ter@1: big, Tom@2: n/a, Sriram@n/a: n/a ";
        assertEquals(expecting, p.render());
    }

  @Test public void testEvalSTIteratingSubtemplateInSTFromAnotherGroup() throws Exception {
    ErrorBuffer errors = new ErrorBuffer();
    STGroup innerGroup = new STGroup();
    innerGroup.setListener(errors);
    innerGroup.defineTemplate("test", "m", "<m:samegroup()>");
    innerGroup.defineTemplate("samegroup", "x", "hi ");
    ST st = innerGroup.getInstanceOf("test");
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    assertEquals(expected, result);
  }

  @Test public void testEvalSTIteratingSubtemplateInSTFromAnotherGroupSingleValue() throws Exception {
    ErrorBuffer errors = new ErrorBuffer();
    STGroup innerGroup = new STGroup();
    innerGroup.setListener(errors);
    innerGroup.defineTemplate("test", "m", "<m:samegroup()>");
    innerGroup.defineTemplate("samegroup", "x", "hi ");
    ST st = innerGroup.getInstanceOf("test");
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    assertEquals(expected, result);
  }

  @Test public void testEvalSTFromAnotherGroup() throws Exception {
    ErrorBuffer errors = new ErrorBuffer();
    STGroup innerGroup = new STGroup();
    innerGroup.setListener(errors);
    innerGroup.defineTemplate("bob", "inner");
    ST st = innerGroup.getInstanceOf("bob");
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

  }

  @Test public void testWeirdChar() throws Exception {
    String template = "   <*>";
    STGroup group = new STGroup();
    ErrorBuffer errors = new ErrorBuffer();
    group.setListener(errors);
    try {
      group.defineTemplate("test", template);
    }
    catch (STException se) {
      assert false;
    }
    String result = errors.toString();
    String expected = "test 1:4: invalid character '*'"+newline +
              "test 1:0: this doesn't look like a template: \"   <*>\""+newline;
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

  }

  @Test public void testWeirdChar2() throws Exception {
    String template = "\n<\\\n";
    STGroup group = new STGroup();
    ErrorBuffer errors = new ErrorBuffer();
    group.setListener(errors);
    try {
      group.defineTemplate("test", template);
    }
    catch (STException se) {
      assert false;
    }
    String result = errors.toString();
    String expected = "test 1:2: invalid escaped char: '<EOF>'" + newline +
              "test 1:2: expecting '>', found '<EOF>'"+newline;
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

    @Test public void testValidButOutOfPlaceChar() throws Exception {
        String templates =
            "foo() ::= <<hi <.> mom>>\n";
        writeFile(tmpdir, "t.stg", templates);

    STErrorListener errors = new ErrorBuffer();
    STGroupFile group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
        String expected = "t.stg 1:15: doesn't look like an expression"+newline;
        String result = errors.toString();
        assertEquals(expected, result);
    }
View Full Code Here

Examples of org.stringtemplate.v4.misc.ErrorBuffer

        String templates =
        "foo() ::= \"hi <\n" +
        ".> mom\"\n";
    writeFile(tmpdir, "t.stg", templates);

    ErrorBuffer errors = new ErrorBuffer();
    STGroupFile group = new STGroupFile(tmpdir+"/"+"t.stg");
    group.setListener(errors);
    group.load(); // force load
    String expected = "[t.stg 1:15: \\n in string, t.stg 1:14: doesn't look like an expression]";
    String result = errors.errors.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.