try{ //读入/prop/config.properties文件。
File f = new File("/prop/config.properties");
properties = new Properties();
properties.load((InputStream) new FileInputStream(f));
}catch(IOException e) { }
/** Creates a new instance of TestProperties */
public TestProperties() {
InputStream is = getClass().getResourceAsStream("/TestProperties.properties");
p = new Properties();
try {
p.load(is);
}
catch (IOException ex) {
ex.printStackTrace();
}
}
private static Properties p;
private static final TestProperties pi = new TestProperties();
public static String getTestId() {
return pi.p.getProperty("testId");
}
public static void main(String args[]){
System.out.println("testId="+getTestId()); //测试调用
}
}