UnacceptableConfiguration {
// Remove the topics attribute of the subscriber and replace with a
// malformed one
m_subscriber.removeAttribute(m_subscriberTopics);
ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
fact.start();
// Try to create an instance with malformed specified topics
Dictionary conf = new Hashtable();
conf.put("instance.name","consumer with malformed topics");
Dictionary topics = new Hashtable();
topics.put("donut-subscriber", "| |\\| \\/ /-\\ |_ | |)");
conf.put("event.topics", topics);
ComponentInstance instance;
try {
instance = fact.createComponentInstance(conf);
// Should not be executed
instance.dispose();
fail("The factory must not create instance with invalid specified topics.");
} catch (ConfigurationException e) {
// OK
} finally {
fact.stop();
// Restore the original state of the subscriber
m_subscriber.addAttribute(m_subscriberTopics);
}
}