import java.util.Properties;
import org.apache.ibatis.io.Resources;
Properties props = Resources.getResourceAsProperties("test.properties");
String USERNAME=props.getProperty("test.username");
String PASSWORD=props.getProperty("test.password");
---------------------------------------------------------------------------------------------------------
test.properties文件内容:
---------------------------------------------------------------------------------------------------------
test.username=admin
test.password=123456