Exemple #1
0
        public void ImportInto(BehaviorGraph parent, ConfigLog log)
        {
            var childGraph = BehaviorGraphBuilder.Import(Registry, parent, log);
            parent.As<IChainImporter>().Import(childGraph, b => {
                b.PrependToUrl(Prefix);
                b.Origin = Registry.Name;
            });

            log.Import(Registry.Config, Provenance);
        }
Exemple #2
0
        public void SetUp()
        {
            source1 = new LambdaConfigurationAction(g => { });
            theLog = new ConfigLog();

            node = new TracedNode();
            node.Trace("something");
            node.Trace("else");

            node2 = new TracedNode();

            theConfigSource = theLog.StartSource(source1);
            theLog.RecordEvents(node);
            theLog.RecordEvents(node2);
        }
Exemple #3
0
        public void SetUp()
        {
            source1 = new LambdaConfigurationAction(g => { });
            theLog = new ConfigLog(null);
            theChain = new BehaviorChain();

            node = new TracedNode();
            node.Trace("something");
            node.Trace("else");

            node2 = new TracedNode();

            theConfigSource = theLog.StartSource(new FubuRegistry(), source1);
            theLog.RecordEvents(theChain, node);
            theLog.RecordEvents(theChain, node2);
        }
        public static BehaviorGraph Build(FubuRegistry registry)
        {
            var graph = new BehaviorGraph();
            startBehaviorGraph(registry, graph);
            var config = registry.Config;

            var log = new ConfigLog();
            graph.Services.AddService(log);
            log.Import(config);

            config.Add(new SystemServicesPack());
            config.Add(new DefaultConfigurationPack());

            // Apply settings
            config.RunActions(ConfigurationType.Settings, graph);
            config.Add(new RegisterAllSettings(graph));

            config.AllServiceRegistrations().Each(x => {
                x.Apply(graph.Services);
            });

            config.RunActions(ConfigurationType.Discovery, graph);

            config.UniqueImports().Each(import => import.ImportInto(graph, log));

            config.RunActions(ConfigurationType.Explicit, graph);
            config.RunActions(ConfigurationType.Policy, graph);
            config.RunActions(ConfigurationType.Attributes, graph);
            config.RunActions(ConfigurationType.ModifyRoutes, graph);
            config.RunActions(ConfigurationType.InjectNodes, graph);
            config.RunActions(ConfigurationType.Conneg, graph);
            config.RunActions(ConfigurationType.Attachment, graph);
            config.RunActions(ConfigurationType.Navigation, graph);
            config.RunActions(ConfigurationType.ByNavigation, graph);
            config.RunActions(ConfigurationType.Reordering, graph);
            config.RunActions(ConfigurationType.Instrumentation, graph);

            graph.Services.AddService(config);

            return graph;
        }
        // Need to track the ConfigLog
        public static BehaviorGraph Import(FubuRegistry registry, BehaviorGraph parent, ConfigLog log)
        {
            var graph = BehaviorGraph.ForChild(parent);
            startBehaviorGraph(registry, graph);
            var config = registry.Config;

            config.RunActions(ConfigurationType.Settings, graph);
            config.RunActions(ConfigurationType.Discovery, graph);

            config.Imports.Each(import => import.ImportInto(graph, log));

            config.RunActions(ConfigurationType.Explicit, graph);
            config.RunActions(ConfigurationType.Policy, graph);
            config.RunActions(ConfigurationType.Reordering, graph);
            config.RunActions(ConfigurationType.Attributes, graph);
            config.RunActions(ConfigurationType.ModifyRoutes, graph);
            config.RunActions(ConfigurationType.InjectNodes, graph);
            config.RunActions(ConfigurationType.Conneg, graph);

            return graph;
        }
        public void SetUp()
        {
            theRegistry = new LoggedFubuRegistry();

            // Do it this way so that it gets the assembly package
            container = new Container();
            theGraph = FubuApplication.For(theRegistry).StructureMap(container)
                .Bootstrap().Factory.Get<BehaviorGraph>();

            theGraph.BehaviorFor<LoggedEndpoint>(x => x.get_logged_hello()).ShouldNotBeNull();

            theLogs = container.GetInstance<ConfigLog>();
        }
        public void SetUp()
        {
            theRegistry = new LoggedFubuRegistry();

            // Do it this way so that it gets the assembly package
            container = new Container();
            theGraph = FubuApplication.For(theRegistry).StructureMap(container)
                .Bootstrap().Factory.Get<BehaviorGraph>();

            theLogs = container.GetInstance<ConfigLog>();
        }
Exemple #8
0
 internal void Import(ConfigLog log)
 {
     _sources.AddRange(log._sources);
 }