3
I have a file .properties
where I carry the name of the tests that will be deleted from my application. This file needs to have the same name as the "variables" since they all mean the same thing (deleted tests), the problem is that my code is just recognizing the last test (the NATONE in case).
data properties.:
prop.teste.excl = CQT-SUST
prop.teste.excl = NATONE
code:
public static Properties getProp() throws IOException
{
Properties props = new Properties();
FileInputStream file = new FileInputStream("src/resources/dados.properties");
props.load(file);
return props;
}
public ArrayList<String> testeInterno() throws IOException
{
String property;
ArrayList<String> testeInt = new ArrayList<String>();
Properties prop = getProp();
for ( int i = 0; i < prop.size(); i++)
{
property = "prop.teste.excl";
testeInt.add(i, prop.getProperty(property));
System.out.println(testeInt.get(i));
}
return testeInt;
}
I thought to put ";" at the end of each line of my file but I do not know how to make the code that recognizes ";" as the end of the line and also do not know if it would work.
You can add the question which error message occurs?
– R.Santos
does not show an error, but it fails to catch the first test (CQT-SUST) only returns the (NATONE)
– Mari Teixeira
Changing the sequence, placing the (CQT-SUST) last it returns from there?
– R.Santos
yes, he was only taking the last one. But I’ve already solved with Articuno’s answer
– Mari Teixeira