java - Which type of resource file to use to store constants -


i developing application tests web services, , use junit parameterized tests. want read parameters resources file. wondering best way store these parameters.

  1. in .properties file ?

    test1.inputpath= c:\\path test1.expectedoutputpath= c:\\path test2.inputpath= c:\\path2 test2.expectedoutputpath= c:\\path2 
  2. in xml file?

    <test>   <inputpath>  c:\path <\inputpath>   <expectedoutputpath>  c:\path <\expectedoutputpath> <\test> <test>   <inputpath>  c:\path2 <\inputpath>   <expectedoutputpath>  c:\path2 <\expectedoutputpath> <\test> 
  3. other way this?

thanks.

do not try make life more complicated ;) can read property files in way:

properties prop = new properties(); inputstream input = new fileinputstream(filename); prop.load(input); string s = prop.getproperty("test1.inputpath"); 

and import:

import java.util.properties; 

is still complicated you?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -