    @Test
    public void testAddSameFactoryIdTwice() {

        String id = "java";
        JavaFactory expected = new JavaFactory();
        try {
            broker.addFactory(id, expected);
            Assert.fail("ConfigurationException expected");
        } catch (ConfigurationException ce) {
            int error = ConfigurationConstants.DUPLICATE_COMPONENT_ID;
            Assert.assertTrue(ce.getNumber() == error);
        }
    }