Esempio n. 1
0
 /// <summary>
 /// Obtaining application information
 /// </summary>
 /// <param name="platform"></param>
 /// <returns></returns>
 public Application application(Platfroms platform)
 {
     if (Platfroms.IOS_PATFORM == platform)
     {
         return(applications[0]);
     }
     else if (Platfroms.ANDROID_PLATFORM == platform)
     {
         return(applications[1]);
     }
     else
     {
         return(null);
     }
 }
    public override void CreateStructure()
    {
        string errorMsg = null;

        //Brief Description:
        //Pre-conditions:
        //Based on QualityCenter test version
        //Variations from QualityCenter:
        this.AddStep(new PreCondition(), "Precondition: Get Channel Numbers From ini File & Sync & enter Standby to clear review buffer");
        this.AddStep(new Step1(), "Step 1:  Zap to  FTA Channel,Verify launching Menu & Schedule a recording");
        this.AddStep(new Step2(), "Step 2: Rewind back in Review buffer,Switch to Play mode ");
        this.AddStep(new Step3(), "Step 3: On Review Buffer playback Launch Main Menu,Verify PIP");
        this.AddStep(new Step4(), "Step 4: Playback the recorded Event Launch Main Meny,Verify PIP");


        //Initialize Platforms EA's
        if (Platfroms.ContainsKey("GW"))
        {
            GW.Platform = Platfroms["GW"];
            var tmpIEX = GW.Platform.IEX;
            GW.EA.TestName = this.ToString();
            GW.EA.Init(ref tmpIEX, Project, ref errorMsg);
            if (errorMsg != null)
            {
                GW.LogComment("Failed to initilaized Gateway EA object!");
            }
            Platfroms["GW"].EA = GW.EA;
            multiBoxTest       = true;
        }

        CL.Platform = Platfroms["CL1"];
        var tmpIEX2 = CL.Platform.IEX;

        CL.EA.TestName = this.ToString();
        CL.EA.Init(ref tmpIEX2, Project, ref errorMsg);
        if (errorMsg != null)
        {
            CL.LogComment("Failed to initilaized Client EA object!");
        }
        Platfroms["CL1"].EA = CL.EA;
    }
Esempio n. 3
0
 /// <summary>
 /// Two parameter constructor
 /// </summary>
 /// <param name="platformTypes"></param>
 /// <param name="applicationArn"></param>
 public Application(Platfroms platform, string SNSarn)
 {
     this.platform = platform;
     this.SNSarn   = SNSarn;
 }
Esempio n. 4
0
        /// <summary>
        /// This is the main function for sending notification
        /// </summary>
        public void sendNotification()
        {
            foreach (Client client in clients)
            {
                int clientID = client.getClientID();

                #region AWS connection - This code block is same for every push message type - This is the basic block.

                _client = new AmazonSimpleNotificationServiceClient("XXXXXXX", "XXXXXXXXXX", Amazon.RegionEndpoint.EUCentral1);
                string    token       = client.getPushToken();
                Platfroms mobilOsType = client.getMobileType() == 0 ? Platfroms.IOS_PATFORM : Platfroms.ANDROID_PLATFORM;

                try
                {
                    string applicationArn = "";

                    try
                    {
                        applicationArn = applications[(int)mobilOsType].getArn();
                    }
                    catch
                    {
                        continue;
                    }

                    string endPointArn = createEndPointArn(token, applicationArn);

                    if (string.IsNullOrEmpty(endPointArn))
                    {
                        continue;
                    }
                    else
                    {
                        PublishRequest publishRequest          = new PublishRequest();
                        Dictionary <string, string> messageMap = new Dictionary <string, string>();
                        messageMap.Add("default", "default message");
                        string platform = mobilOsType == 0 ? "APNS_SANDBOX" : "GCM";

                        // This application developed for IOS and Android
                        if (mobilOsType != Platfroms.IOS_PATFORM && mobilOsType != Platfroms.ANDROID_PLATFORM)
                        {
                            continue;
                        }

                        int    clientsID = client.getClientID();
                        Guid   pushesID  = client.getPushID();
                        string message   = mobilOsType == 0 ? getAPNSMessage(notification, title, pushesID, clientsID) : getGCMMessage(notification, title, pushesID, clientsID);
                        messageMap.Add(platform, message);

                        publishRequest.TargetArn        = endPointArn;
                        publishRequest.MessageStructure = "json";

                        string messageJSON = "";

                        try
                        {
                            messageJSON = JsonConvert.SerializeObject(messageMap);
                        }
                        catch
                        {
                            continue;
                        }

                        try
                        {
                            publishRequest.Message = messageJSON;
                            _client.Publish(publishRequest);
                        }
                        catch
                        {
                            continue;
                        }

                        try
                        {
                            // for deleting endPointArn
                            DeleteEndpointRequest _request = new DeleteEndpointRequest();
                            _request.EndpointArn = endPointArn;
                            _client.DeleteEndpoint(_request);
                        }
                        catch
                        {
                            continue;
                        }
                    }
                }
                catch
                {
                    continue;
                }

                #endregion
            }
        }