Esempio n. 1
0
  public void testSlash() throws Exception {
    String rsl;
    RslNode node;

    rsl = "&(executable=/bin/echo)(arguments=\\)";

    node = RSLParser.parse(rsl);

    NameOpValue nv = null;
    List values;

    nv = node.getParam("ARGUMENTS");
    values = nv.getValues();

    assertEquals("arg size", 1, values.size());

    assertEquals("arg 1", "\\", ((Value) values.get(0)).getCompleteValue());

    rsl = "&(executable=/bin/echo)(arguments=\"\\\")";

    node = RSLParser.parse(rsl);

    assertEquals("arg size", 1, values.size());

    assertEquals("arg 1", "\\", ((Value) values.get(0)).getCompleteValue());
  }
Esempio n. 2
0
  public void testAdvanced() throws Exception {
    String rsl =
        "&(arguments = -e '$GLOBUS_SH_PERL -e ''print STDERR \"stderr\n\"; '"
            + "#                      'print STDOUT \"stdout\n\";''')";

    RslNode node = RSLParser.parse(rsl);

    NameOpValue nv = null;
    List values;

    nv = node.getParam("ARGUMENTS");
    values = nv.getValues();

    assertEquals("arg size", 2, values.size());

    assertEquals("arg 1", "-e", ((Value) values.get(0)).getValue());

    String e = "$GLOBUS_SH_PERL -e 'print STDERR \"stderr\n\"; print STDOUT \"stdout\n\";'";

    assertEquals("arg 2", e, ((Value) values.get(1)).getCompleteValue());
  }