Ejemplo n.º 1
0
 private void BtnLoadDataClick(object sender, EventArgs e)
 {
     using (Reference <ILogger> logRef = Reference <ILogger> .Create(new ConsoleLogger("LoadReferenceData: ")))
     {
         logRef.Target.LogInfo("Running...");
         int exitCode = 0;
         try
         {
             // load configuration data
             //AppSettingsLoader.Load(logRef.Target, _client, EnvironmentProp.DefaultNameSpace);
             LoadConfigDataHelper.LoadConfigurationData(logRef.Target, _client.Proxy, _nameSpace);
             // done
             logRef.Target.LogInfo("Success");
             //}
         }
         catch (Exception exception)
         {
             logRef.Target.Log(exception);
             logRef.Target.LogInfo("FAILED");
             exitCode = 2;
         }
         finally
         {
             Environment.ExitCode = exitCode;
         }
     }
 }
Ejemplo n.º 2
0
 public static void Setup(TestContext context)
 {
     UTE    = new UnitTestEnvironment();
     Engine = new Orion.CurveEngine.CurveEngine(UTE.Logger, UTE.Cache, UTE.NameSpace);
     // load regresssion test data and expected values
     LoadConfigDataHelper.LoadConfigurationData(UTE.Logger, UTE.Cache, UTE.NameSpace);
     //RegressionTestDataLoader.Load(UTE.Logger, UTE.Cache);
     // stress all loaded curves
     StressAllFxCurves();
     StressAllRateCurves();
     //load expected values
     ExpectedValues = LoadExpectedValues();
     // Set the Retention
     Retention = TimeSpan.FromHours(1);
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            using (Reference <ILogger> logRef = Reference <ILogger> .Create(new ConsoleLogger("FpML.V5r3.ConfigDataLoader: ")))
            {
                logRef.Target.LogInfo("Running...");
                int exitCode = 0;
                try
                {
                    using (ICoreClient client = new CoreClientFactory(logRef).SetEnv("DEV").Create())
                    {
                        // delete 'old' configuration data in all environments greater than DEV
                        if (client.ClientInfo.ConfigEnv >= EnvId.SIT_SystemTest)
                        {
                            client.DeleteUntypedObjects(null, Expr.StartsWith(Expr.SysPropItemName, "Orion.FpML.V5r3.Configuration."));
                        }

                        // load configuration data
                        //AppSettingsLoader.Load(logRef.Target, client);
                        LoadConfigDataHelper.LoadConfigurationData(logRef.Target, client);
                        // done
                        logRef.Target.LogInfo("Success");
                    }
                }
                catch (Exception e)
                {
                    logRef.Target.Log(e);
                    for (int i = 0; i < args.Length; i++)
                    {
                        logRef.Target.LogDebug("  args[{0}]='{1}'", i, args[i]);
                    }
                    logRef.Target.LogInfo("FAILED");
                    exitCode = 2;
                }
                finally
                {
                    Environment.ExitCode = exitCode;
                }
            }
        }
Ejemplo n.º 4
0
        public CurveUnitTestEnvironment(string nameSpace)
        {
            NameSpace = nameSpace;
            string env       = EnvHelper.EnvName(EnvId.Utt_UnitTest);
            var    stopwatch = new Stopwatch();

            stopwatch.Start();
            var random = new Random(Environment.TickCount);
            int port   = random.Next(8000, 8099);

            _server = new CoreServer(_logRef, env, NodeType.Router, port, WcfConst.NetTcp);
            _server.Start();
            _client = new CoreClientFactory(_logRef)
                      .SetEnv(env)
                      .SetServers("localhost:" + port.ToString(CultureInfo.InvariantCulture))
                      .SetProtocols(WcfConst.NetTcp)
                      .Create();
            Cache = _client.CreateCache();
            LoadConfigDataHelper.LoadCurveConfigurationData(_logRef.Target, Cache, nameSpace);
            stopwatch.Stop();
            Debug.Print("Initialized test environment, in {0} seconds", stopwatch.Elapsed.TotalSeconds);
        }