Ejemplo n.º 1
0
        public void ComponentList_InvalidList()
        {
            var cm = new ConfigurationManager();

            var props = new HashMap <String, Object>();

            cm.AddConfigurable(typeof(DummyProcessor), "dummyA");
            props.Put(DummyFrontEnd.DataProcs, Arrays.AsList("dummyA, dummyB"));
            cm.AddConfigurable(typeof(DummyFrontEnd), "dfe", props);

            cm.Lookup("dfe");
        }
Ejemplo n.º 2
0
        public void ConfigurationManager_DynamicConfCreation()
        {
            var cm = new ConfigurationManager();

            const string instanceName = "docu";
            var          props        = new HashMap <string, object>();

            props.Put(DummyComp.PropFrontend, new DummyFrontEnd());
            cm.AddConfigurable(typeof(DummyComp), instanceName, props);

            Assert.IsNotNull(cm.GetPropertySheet(instanceName));
            Assert.IsNotNull(cm.Lookup(instanceName));
            Assert.IsTrue(cm.Lookup(instanceName) is DummyComp);
        }
Ejemplo n.º 3
0
        // note: it is not a bug but a feature of this test to print a stacktrace
        public void Configurable_DynamicConfCreationWithoutDefaultProperty()
        {
            try {
                var cm = new ConfigurationManager();

                const string instanceName = "testconf";
                cm.AddConfigurable(typeof(TestConfigurable), instanceName);

                cm.Lookup(instanceName);
                Assert.Fail("add didn't fail without given default frontend");
            } catch (NullReferenceException e) {
            } catch (PropertyException e) {
            }
        }