Skip to content

Commit

Permalink
pass in the properties file name to the constructor of the parameter …
Browse files Browse the repository at this point in the history
…parser
  • Loading branch information
chenson42 committed Jan 2, 2013
1 parent a519148 commit b20f576
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -37,7 +37,7 @@ final public class ParameterConstants {

public static final String ALL = "ALL";

private static Map<String, ParameterMetaData> parameterMetaData = new DefaultParameterParser().parse();
private static Map<String, ParameterMetaData> parameterMetaData = new DefaultParameterParser("/symmetric-default.properties").parse();

private ParameterConstants() {
}
Expand Down
Expand Up @@ -41,13 +41,17 @@ public class DefaultParameterParser {
private static final String DATABASE_OVERRIDABLE = "DatabaseOverridable:";
private static final String TAGS = "Tags:";
private static final String TYPE = "Type:";

private String propertiesFilePath;

final Logger log = LoggerFactory.getLogger(getClass());

public DefaultParameterParser() {
public DefaultParameterParser(String propertiesFilePath) {
this.propertiesFilePath = propertiesFilePath;
}

public Map<String, ParameterMetaData> parse() {
return parse("/symmetric-default.properties");
return parse(propertiesFilePath);
}

public Map<String, ParameterMetaData> parse(String fileName) {
Expand Down
Expand Up @@ -32,7 +32,7 @@ public class DefaultParameterParserTest {

@Test
public void testParse() {
DefaultParameterParser parser = new DefaultParameterParser();
DefaultParameterParser parser = new DefaultParameterParser("/symmetric-default.properties");
Map<String, ParameterMetaData> metaData = parser.parse();

Assert.assertNotNull(metaData);
Expand Down

0 comments on commit b20f576

Please sign in to comment.