Exemplo n.º 1
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_AircraftDatasAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             AircraftData aircraft = new AircraftData();
             aircraft.SetProperties(reader);
             Add(aircraft);
         }
     }
 }
Exemplo n.º 2
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_ContactsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             Contacts contact = new Contacts();
             contact.SetProperties(reader);
             Add(contact);
         }
     }
 }
Exemplo n.º 3
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_SuppliersAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             Suppliers supplier = new Suppliers();
             supplier.SetProperties(reader);
             Add(supplier);
         }
     }
 }
Exemplo n.º 4
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_CustomerDetailsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             CustomerDetails detail = new CustomerDetails();
             detail.SetProperties(reader);
             Add(detail);
         }
     }
 }
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_FuelOrderCustomerPricingsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             FuelOrderCustomerPricings pricing = new FuelOrderCustomerPricings();
             pricing.SetProperties(reader);
             Add(pricing);
         }
     }
 }
Exemplo n.º 6
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_PriceMarginsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             PriceMargins margin = new PriceMargins();
             margin.SetProperties(reader);
             Add(margin);
         }
     }
 }
Exemplo n.º 7
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_AcukwikAirportsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             AcukwikAirports airport = new AcukwikAirports();
             airport.SetProperties(reader);
             Add(airport);
         }
     }
 }
Exemplo n.º 8
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_AcukwikCountriesAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             AcukwikCountries country = new AcukwikCountries();
             country.SetProperties(reader);
             Add(country);
         }
     }
 }
Exemplo n.º 9
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_CustomerNotesAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             CustomerNotes note = new CustomerNotes();
             note.SetProperties(reader);
             Add(note);
         }
     }
 }
 public override void Fire <TArgument>(ParameterizedTrigger <TTrigger, TArgument> parameterizedTrigger,
                                       TArgument argument)
 {
     if (m_monitor.TryEnter())
     {
         try { base.Fire(parameterizedTrigger, argument); }
         finally { m_monitor.Exit(); }
     }
     else
     {
         if (IsEnabled)
         {
             ExecutionHelper.ThrowInTransition();
         }
     }
 }
Exemplo n.º 11
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_EmailRoutingsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             EmailRouting email = new EmailRouting();
             email.SetProperties(reader);
             Add(email);
         }
     }
 }
Exemplo n.º 12
0
 private void LoadFromDatabase(List <SqlParameter> parameters)
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_DraggableEvents", parameters))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             DraggableEvent calendarEvent = new DraggableEvent();
             calendarEvent.LoadFromReader(reader);
             Add(calendarEvent);
         }
     }
 }
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_FBODetailVendorExclusionsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             FBODetailVendorExclusions FBODetailVendorExclusion = new FBODetailVendorExclusions();
             FBODetailVendorExclusion.SetProperties(reader);
             Add(FBODetailVendorExclusion);
         }
     }
 }
Exemplo n.º 14
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_VendorsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             Vendors Vendor = new Vendors();
             Vendor.SetProperties(reader);
             Add(Vendor);
         }
     }
 }
Exemplo n.º 15
0
        public void TestGss()
        {
            using (var mtouch = new MTouchTool()) {
                mtouch.CreateTemporaryApp(code: MonoNativeGss);
                mtouch.Linker = LinkerOption.LinkAll;
                mtouch.AssertExecute(MTouchAction.BuildSim, "build");

                AssertStaticLinked(mtouch);
                var symbols = mtouch.NativeSymbolsInExecutable;
                Assert.That(symbols, Does.Contain("_mono_native_initialize"));
                Assert.That(symbols, Does.Contain("_NetSecurityNative_ImportUserName"));

                var otool_exe = ExecutionHelper.Execute("otool", new [] { "-L", mtouch.NativeExecutablePath }, hide_output: true);
                Assert.That(otool_exe, Does.Contain("/System/Library/Frameworks/GSS.framework/GSS"));
            }
        }
Exemplo n.º 16
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_FBODetailCustomFieldsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             FBODetailCustomFields margin = new FBODetailCustomFields();
             margin.SetProperties(reader);
             Add(margin);
         }
     }
 }
Exemplo n.º 17
0
        public async Task <TAggregateRoot> GetAsync <TAggregateRoot>()
            where TAggregateRoot : class, IEventStored, new()
        {
            if (_trackedAggregate == null)
            {
                _trackedAggregate = await ExecutionHelper.ExecuteWithRetriesAsync(async ct =>
                {
                    var eventStream = await _stateManager.GetOrAddStateAsync("state", new TEventStream(), ct);
                    var aggregate   = new TAggregateRoot();
                    aggregate.Initialize(_eventController, eventStream.DomainEvents, UtcNowTimeProvider.Instance);
                    return(aggregate);
                }, 3, TimeSpan.FromSeconds(1), CancellationToken.None);
            }

            return((TAggregateRoot)_trackedAggregate);
        }
Exemplo n.º 18
0
 public void LoadAll()
 {
     using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_CustomerDetailAircraftExclusionsAll"))
     {
         if (reader == null)
         {
             return;
         }
         while (reader.Read())
         {
             CustomerDetailAircraftExclusions CustomerDetailAircraftExclusion = new CustomerDetailAircraftExclusions();
             CustomerDetailAircraftExclusion.SetProperties(reader);
             Add(CustomerDetailAircraftExclusion);
         }
     }
 }
Exemplo n.º 19
0
    public static void AssertRunProcess(string filename, string[] arguments, TimeSpan timeout, string workingDirectory, Dictionary <string, string> environment_variables, string message)
    {
        var exitCode = 0;
        var output   = new List <string> ();

        Action <string> output_callback = (v) => {
            lock (output)
                output.Add(v);
        };

        if (environment_variables == null)
        {
            environment_variables = new Dictionary <string, string> ();
        }
        environment_variables ["XCODE_DEVELOPER_DIR_PATH"] = null;
        environment_variables ["DEVELOPER_DIR"]            = Configuration.XcodeLocation;

        exitCode = ExecutionHelper.Execute(filename, arguments, out var timed_out, workingDirectory, environment_variables, output_callback, output_callback, timeout);

        // Write execution log to disk (and print the path)
        var logfile = Path.Combine(LogDirectory, $"{filename}-{Interlocked.Increment (ref counter)}.log");

        File.WriteAllLines(logfile, output);
        TestContext.AddTestAttachment(logfile, $"Execution log for {filename}");
        Console.WriteLine("Execution log for {0}: {1}", filename, logfile);

        var errors       = new List <string> ();
        var errorMessage = "";

        if ((!timed_out || exitCode != 0) && output.Count > 0)
        {
            var regex = new Regex(@"error\s*(MSB....)?(CS....)?(MT....)?(MM....)?:", RegexOptions.IgnoreCase | RegexOptions.Singleline);
            foreach (var line in output)
            {
                if (regex.IsMatch(line) && !errors.Contains(line))
                {
                    errors.Add(line);
                }
            }
            if (errors.Count > 0)
            {
                errorMessage = "\n\t[Summary of errors from the build output below]\n\t" + string.Join("\n\t", errors);
            }
        }
        Assert.IsFalse(timed_out, $"{message} timed out after {timeout.TotalMinutes} minutes{errorMessage}");
        Assert.AreEqual(0, exitCode, $"{message} failed (unexpected exit code){errorMessage}");
    }
Exemplo n.º 20
0
        public void TestDeviceDylib(Profile profile, string version, string mono_native_dylib)
        {
            using (var mtouch = new MTouchTool()) {
                mtouch.Profile = profile;
                if (profile == Profile.watchOS)
                {
                    mtouch.CreateTemporaryWatchKitExtension(code: MonoNativeWatchInitialize, extraCode: MonoNativeInitialize);
                }
                else
                {
                    mtouch.CreateTemporaryApp(code: MonoNativeInitialize);
                }
                mtouch.Linker = LinkerOption.LinkAll;
                mtouch.AssemblyBuildTargets.Add("@all=dynamiclibrary");
                mtouch.TargetVer = version;

                mtouch.AssertExecute(MTouchAction.BuildDev, "build");

                var files = Directory.EnumerateFiles(mtouch.AppPath, "libmono-native*", SearchOption.AllDirectories).Select(Path.GetFileName);
                Assert.That(files.Count, Is.EqualTo(1), "One single libmono-native* library");
                Assert.That(files.First(), Is.EqualTo(mono_native_dylib));

                var mono_native_path = Path.Combine(mtouch.AppPath, mono_native_dylib);

                var symbols     = MTouch.GetNativeSymbols(mono_native_path);
                var otool_dylib = ExecutionHelper.Execute("otool", new [] { "-L", mono_native_path }, hide_output: true);

                Assert.That(symbols, Does.Contain("_mono_native_initialize"));
                Assert.That(otool_dylib, Does.Contain($"@rpath/{mono_native_dylib}"));
                Assert.That(otool_dylib.Replace(mono_native_path, ""), Does.Not.Contain("/Users/"));

                if (profile == Profile.iOS)
                {
                    Assert.That(symbols, Does.Contain("_NetSecurityNative_ImportUserName"));
                    Assert.That(otool_dylib, Does.Contain("/System/Library/Frameworks/GSS.framework/GSS"));
                }
                else
                {
                    Assert.That(symbols, Does.Not.Contain("_NetSecurityNative_ImportUserName"));
                    Assert.That(otool_dylib, Does.Not.Contain("/System/Library/Frameworks/GSS.framework/GSS"));
                }

                var otool_exe = ExecutionHelper.Execute("otool", new [] { "-L", mtouch.NativeExecutablePath }, hide_output: true);
                Assert.That(otool_exe, Does.Not.Contain("GSS"));
                Assert.That(otool_exe, Does.Contain($"@rpath/{mono_native_dylib}"));
            }
        }
Exemplo n.º 21
0
        //public void Delete()
        //{
        //    DeleteFBODetailCustomField(Id);
        //}

        public void Update()
        {
            //ArrayList propertiesToOmit = new ArrayList();
            //propertiesToOmit.Add("IsEditable");
            //propertiesToOmit.Add("IsOmitted");
            using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_InsertUpdate_FBODetailCustomField", GetSQLParameters(/*propertiesToOmit*/)))
            {
                if (reader == null)
                {
                    return;
                }
                if (reader.Read())
                {
                    SetProperties(reader);
                }
            }
        }
Exemplo n.º 22
0
        public async Task MockActorProxy_should_SaveState_after_Actor_method()
        {
            var fabricRuntime          = new MockFabricRuntime("Overlord");
            var stateActions           = new List <string>();
            var mockActorStateProvider = new MockActorStateProvider(fabricRuntime, stateActions);

            fabricRuntime.SetupActor((service, actorId) => new ActorDemo(service, actorId), createStateProvider: () => mockActorStateProvider);

            // Only to get around the kinda stupid introduced 1/20 msec 'bug'
            await ExecutionHelper.ExecuteWithRetriesAsync((ct) =>
            {
                var actor = fabricRuntime.ActorProxyFactory.CreateActorProxy <IActorDemo>(new ActorId("testivus"));
                return(actor.SetCountAsync(5));
            }, 3, TimeSpan.FromMilliseconds(3), CancellationToken.None);

            stateActions.Should().BeEquivalentTo(new[] { "ContainsStateAsync", "ActorActivatedAsync", "SaveStateAsync" });
        }
Exemplo n.º 23
0
        public void Load()
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@Name", Name));
            using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_AcukwikUploadsByName", parameters))
            {
                if (reader == null)
                {
                    return;
                }
                if (reader.Read())
                {
                    SetProperties(reader);
                }
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Just like <see cref="Search(Weight, int, Sort, bool, bool)"/>, but you choose
        /// whether or not the fields in the returned <see cref="FieldDoc"/> instances should
        /// be set by specifying <paramref name="fillFields"/>.
        /// </summary>
        protected virtual TopFieldDocs Search(Weight weight, FieldDoc after, int nDocs, Sort sort, bool fillFields, bool doDocScores, bool doMaxScore)
        {
            if (sort == null)
            {
                throw new System.ArgumentNullException("Sort must not be null");
            }

            int limit = reader.MaxDoc;

            if (limit == 0)
            {
                limit = 1;
            }
            nDocs = Math.Min(nDocs, limit);

            if (executor == null)
            {
                // use all leaves here!
                return(Search(m_leafContexts, weight, after, nDocs, sort, fillFields, doDocScores, doMaxScore));
            }
            else
            {
                TopFieldCollector topCollector = TopFieldCollector.Create(sort, nDocs, after, fillFields, doDocScores, doMaxScore, false);

                ReentrantLock @lock = new ReentrantLock();
                ExecutionHelper <TopFieldDocs> runner = new ExecutionHelper <TopFieldDocs>(executor);
                for (int i = 0; i < m_leafSlices.Length; i++) // search each leaf slice
                {
                    runner.Submit(new SearcherCallableWithSort(@lock, this, m_leafSlices[i], weight, after, nDocs, topCollector, sort, doDocScores, doMaxScore));
                }
                int   totalHits = 0;
                float maxScore  = float.NegativeInfinity;
                foreach (TopFieldDocs topFieldDocs in runner)
                {
                    if (topFieldDocs.TotalHits != 0)
                    {
                        totalHits += topFieldDocs.TotalHits;
                        maxScore   = Math.Max(maxScore, topFieldDocs.MaxScore);
                    }
                }

                TopFieldDocs topDocs = (TopFieldDocs)topCollector.GetTopDocs();

                return(new TopFieldDocs(totalHits, topDocs.ScoreDocs, topDocs.Fields, topDocs.MaxScore));
            }
        }
Exemplo n.º 25
0
        public void LoadAllFees(int FuelOrderID)
        {
            List <SqlParameter> Params = new List <SqlParameter>();
            SqlParameter        Param  = new SqlParameter("@FuelOrderID", SqlDbType.Int);

            Param.Value = FuelOrderID;
            Params.Add(Param);
            using (SqlDataReader rdr = ExecutionHelper.ExecuteReader("up_Load_FuelOrderFees", Params))
            {
                while (rdr.Read())
                {
                    FuelOrderFees fuelOrderFee = new FuelOrderFees();
                    fuelOrderFee.SetProperties(rdr);
                    Add(fuelOrderFee);
                }
            }
        }
        public static void RunProgram()
        {
            _logger.Info("Acme Program Starter Service has been started...");

            var tempDate    = DateTime.Now;
            var isGenerated = false;

            while (ProgramStarterCaller.IsRunning)
            {
                try
                {
                    if (tempDate.DayOfWeek != DateTime.Now.DayOfWeek)
                    {
                        isGenerated = false;
                    }

                    if (!ExecutionHelper.CheckIfDayIsManday())
                    {
                        Thread.Sleep(ConfigurationHelper.GetWeekendTimeOut());
                    }

                    if ((ExecutionHelper.CheckIfDayIsManday() && ExecutionHelper.ExecutionTime()) &&
                        isGenerated == false)
                    {
                        var listOfPrograms = ConfigurationHelper.GetListOfPrograms();
                        foreach (var program in listOfPrograms)
                        {
                            ExecutionHelper.ExecuteProgram(program);
                            Thread.Sleep(ConfigurationHelper.GetShortTimeOut());
                        }

                        tempDate    = DateTime.Now;
                        isGenerated = true;

                        Thread.Sleep(ConfigurationHelper.GetLongTimeOut());
                    }

                    Thread.Sleep(ConfigurationHelper.GetShortTimeOut());
                }
                catch (Exception ex)
                {
                    _logger.Error(ex.ToString());
                    Thread.Sleep(ConfigurationHelper.GetShortTimeOut());
                }
            }
        }
Exemplo n.º 27
0
        public void BuildUnifiedProject_WithJustNativeRefNoLinkWith_Builds()
        {
            RunMSBuildTest(tmpDir => {
                var dylib          = Path.GetFullPath(Path.Combine(TI.TestDirectory, "test-libraries", ".libs", "macos", "libtest.dylib"));
                string itemGroup   = $"<ItemGroup><NativeReference Include=\"{dylib}\"> <IsCxx>False</IsCxx><Kind>Dynamic</Kind> </NativeReference> </ItemGroup>";
                string projectPath = TI.GenerateEXEProject(new TI.UnifiedTestConfig(tmpDir)
                {
                    ProjectName = "UnifiedExample.csproj", ItemGroup = itemGroup
                });
                var testResults = TI.BuildProject(projectPath);
                testResults.Messages.AssertNoMessage(2006);
                Assert.That(Path.Combine(tmpDir, $"bin", "Debug", "UnifiedExample.app", "Contents", "MonoBundle", Path.GetFileName(dylib)), Does.Exist, "dylib in app");

                Assert.AreEqual(0, ExecutionHelper.Execute("/usr/bin/otool", new [] { "-L", Path.Combine(tmpDir, "bin/Debug/UnifiedExample.app/Contents/MacOS/UnifiedExample") }, out var output));
                Assert.IsTrue(output.ToString().Contains(Path.GetFileName(dylib)));
            });
        }
Exemplo n.º 28
0
        public void Update()
        {
            ArrayList propertiesToOmit = new ArrayList();

            propertiesToOmit.Add("DateAdded");
            using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_InsertUpdate_FuelOrderNote", GetSQLParameters(propertiesToOmit)))
            {
                if (reader == null)
                {
                    return;
                }
                if (reader.Read())
                {
                    SetProperties(reader);
                }
            }
        }
Exemplo n.º 29
0
        public void Load()
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@Id", Id));
            using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_Supplier", parameters))
            {
                if (reader == null)
                {
                    return;
                }
                if (reader.Read())
                {
                    SetProperties(reader);
                }
            }
        }
Exemplo n.º 30
0
        public void Load()
        {
            List <SqlParameter> parameters = new List <SqlParameter>();

            parameters.Add(new SqlParameter("@AircraftID", AircraftID));
            using (SqlDataReader reader = ExecutionHelper.ExecuteReader("up_Select_AircraftDatum", parameters))
            {
                if (reader == null)
                {
                    return;
                }
                if (reader.Read())
                {
                    SetProperties(reader);
                }
            }
        }