示例#1
0
        public void TestInitialize()
        {
            Log4netFactory          = new Log4netFactoryImpl();
            MockBootstrapperFactory = new MockBootstrapperFactoryImpl();
            MainFactory             = new MainFactoryClass();
            BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl();

            LoggerSetter      = Log4netFactory.NewLoggerSetter();
            MockBootstrapper  = MockBootstrapperFactory.NewMockBootstrapper();
            MockRunner        = new MockRunnerClass();
            MockRunner.IsDone = false;
        }
示例#2
0
 public void TestInitialize()
 {
     Log4netFactory      = new Log4netFactoryImpl();
     BootstrapperFactory = new BootstrapperFactoryImpl();
     MainFactory         = new MainFactoryClass();
     LogBootstrapper     = BootstrapperFactory.NewLogBootstrapper();
     LoggerSetter        = Log4netFactory.NewLoggerSetter();
     AssemblyResolver    = BootstrapperFactory.NewAssemblyResolver(LoggerSetter);
     SpringBootstrapper  = BootstrapperFactory.NewSpringBootstrapper(LoggerSetter);
     Bootstrappers       = new List <Bootstrapper>();
     Bootstrappers.Add(LogBootstrapper);
     Bootstrappers.Add(AssemblyResolver);
     Bootstrappers.Add(SpringBootstrapper);
     CompositeBootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, Bootstrappers);
     Runner = BootstrapperFactory.NewSpringRunner(LoggerSetter, SpringBootstrapper);
 }
示例#3
0
        static void Main(string[] args)
        {
            // Get a way to create the top level objects
            Log4netFactory      log4netFactory      = new Log4netFactoryImpl();
            BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl();
            MainFactory         mainFactory         = new MainFactoryClass();

            mainFactory.BootstrapperFactory = bootstrapperFactory;

            // Initialise the individual bootstrappers
            LogBootstrapper    logBootstrapper    = bootstrapperFactory.NewLogBootstrapper();
            LoggerSetter       loggerSetter       = log4netFactory.NewBootstrapDependentLoggerSetter(logBootstrapper);
            AssemblyResolver   assemblyResolver   = bootstrapperFactory.NewAssemblyResolver(loggerSetter);
            SpringBootstrapper springBootstrapper = bootstrapperFactory.NewSpringBootstrapper(loggerSetter);

            // Create the program components
            Bootstrapper bootstrapper = mainFactory.NewProgramBootstrapper(logBootstrapper, loggerSetter, assemblyResolver, springBootstrapper);
            Runner       runner       = bootstrapperFactory.NewSpringRunner(loggerSetter, springBootstrapper);

            // Create and run the program
            Program program = mainFactory.NewProgram(bootstrapper, runner);

            program.Run();
        }