1

I am doing a unit testing.

there is a method where xml need to be passed , in the method the parameter type is String I have the xml file in my laptop.

can some one suggest me how we can pass this xml file data to the method ?

F0cus
  • 585
  • 3
  • 18
  • 52
  • please let me know if my question is not clear or need more clarification – F0cus May 19 '17 at 12:22
  • Possible duplicate of [Java : Convert formatted xml file to one line string](http://stackoverflow.com/questions/5511096/java-convert-formatted-xml-file-to-one-line-string) – Arnaud May 19 '17 at 12:24
  • Read your XML File with BufferedReader and then append with StringBuffer – Mizuki May 19 '17 at 12:44
  • Possible duplicate of [Read file As String](http://stackoverflow.com/questions/12910503/read-file-as-string) – G_H May 19 '17 at 12:52

1 Answers1

0

need more clarification

I guess, that the String varibale is the path name of the xml-file on your laptop: e.g.

"D:\\temp\\the_xmlfile.xml"
Norbert
  • 234
  • 1
  • 9
  • no Norbert .. I printed the value which is going into the java method. its a proper XML - (LONG type - Oracle PL/SQL). the overall scenario is a PL/SQL package is calling a java class , I inserted the parameter value,which is going into the java class into a table and now am testing the java code – F0cus May 19 '17 at 13:02