}
public void testInvalidBrackets() {
SimpleRootModuleDefinition rootDefinition = new SimpleRootModuleDefinition(rootModuleName, new String[] { "parent-context" });
String moduleString = "module (( null: set1, set2; mock: set3, duff )";
SingleStringSourceDelegate builder = new SingleStringSourceDelegate(rootDefinition, moduleString);
try {
builder.doDefinitionSplit();
fail(IllegalArgumentException.class.getName());
}
catch (ConfigurationException e) {
assertEquals("Invalid definition string module (( null: set1, set2; mock: set3, duff ). Invalid character '(' at column 9", e.getMessage());
}
moduleString = "module ( null: set1, set2; mock: set3, duff ))";
builder = new SingleStringSourceDelegate(rootDefinition, moduleString);
try {
builder.doDefinitionSplit();
fail(IllegalArgumentException.class.getName());
}
catch (ConfigurationException e) {
assertEquals("Invalid definition string module ( null: set1, set2; mock: set3, duff )). Invalid character ')' at column 46", e.getMessage());
}