public void testQuoting(){
  String input;
  String output;
  input="blahblah";
  output=Utils.quote(input);
  assertTrue("No quoting necessary",!output.startsWith("'") && !output.endsWith("'"));
  input="";
  output=Utils.quote(input);
  assertTrue("Empty string quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue("Empty string restored",input.equals(Utils.unquote(output)));
  input=" ";
  output=Utils.quote(input);
  assertTrue("Blank quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue("Blank restored",input.equals(Utils.unquote(output)));
  input="{";
  output=Utils.quote(input);
  assertTrue(">" + input + "< quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue(">" + input + "< restored",input.equals(Utils.unquote(output)));
  input="}";
  output=Utils.quote(input);
  assertTrue(">" + input + "< quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue(">" + input + "< restored",input.equals(Utils.unquote(output)));
  input=",";
  output=Utils.quote(input);
  assertTrue(">" + input + "< quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue(">" + input + "< restored",input.equals(Utils.unquote(output)));
  input="?";
  output=Utils.quote(input);
  assertTrue(">" + input + "< quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue(">" + input + "< restored",input.equals(Utils.unquote(output)));
  input="\r\n\t'\"%";
  output=Utils.quote(input);
  assertTrue(">" + input + "< quoted",output.startsWith("'") && output.endsWith("'"));
  assertTrue(">" + input + "< restored",input.equals(Utils.unquote(output)));
}

public void testQuoting ( ) { String input ; String output ; input = "blahblah" ; output = Utils . quote ( input ) ; assertTrue ( "No quoting necessary" , ! output . startsWith ( "'" ) && ! output . endsWith ( "'" ) ) ; input = "" ; output = Utils . quote ( input ) ; assertTrue ( "Empty string quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( "Empty string restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = " " ; output = Utils . quote ( input ) ; assertTrue ( "Blank quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( "Blank restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = "{" ; output = Utils . quote ( input ) ; assertTrue ( ">" + input + "< quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( ">" + input + "< restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = "}" ; output = Utils . quote ( input ) ; assertTrue ( ">" + input + "< quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( ">" + input + "< restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = "," ; output = Utils . quote ( input ) ; assertTrue ( ">" + input + "< quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( ">" + input + "< restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = "?" ; output = Utils . quote ( input ) ; assertTrue ( ">" + input + "< quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( ">" + input + "< restored" , input . equals ( Utils . unquote ( output ) ) ) ; input = "\r\n\t'\"%" ; output = Utils . quote ( input ) ; assertTrue ( ">" + input + "< quoted" , output . startsWith ( "'" ) && output . endsWith ( "'" ) ) ; assertTrue ( ">" + input + "< restored" , input . equals ( Utils . unquote ( output ) ) ) ; }
tests quote and unquote
